From 488bd3da103d195a2d4a6b26481b5252cb3b6d0d Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Mon, 23 Sep 2024 20:56:43 +0900 Subject: [PATCH 1/2] fix: Avatars with Visame Skinned Mesh disabled will not able to upload --- Editor/APIInternal/ComponentInfos.VRCSDK.cs | 62 ++++++++++++++------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/Editor/APIInternal/ComponentInfos.VRCSDK.cs b/Editor/APIInternal/ComponentInfos.VRCSDK.cs index 5e296959a..9faa95bc4 100644 --- a/Editor/APIInternal/ComponentInfos.VRCSDK.cs +++ b/Editor/APIInternal/ComponentInfos.VRCSDK.cs @@ -139,18 +139,29 @@ protected override void ApplySpecialMapping(T component, MappingSource mappingSo case VRC_AvatarDescriptor.LipSyncStyle.VisemeBlendShape: { var info = mappingSource.GetMappedComponent(component.VisemeSkinnedMesh); - component.VisemeSkinnedMesh = info.MappedComponent; - var removed = false; - foreach (ref var shapeName in component.VisemeBlendShapes.AsSpan()) + + if (info.MappedComponent == null) { - if (info.TryMapProperty($"blendShape.{shapeName}", out var mapped) - && mapped.Component == info.MappedComponent) - shapeName = ParseBlendShapeProperty(mapped.Property); - else - removed = true; + component.VisemeSkinnedMesh = null; + component.lipSync = VRC_AvatarDescriptor.LipSyncStyle.VisemeParameterOnly; + } + else + { + component.VisemeSkinnedMesh = info.MappedComponent; + var removed = false; + foreach (ref var shapeName in component.VisemeBlendShapes.AsSpan()) + { + if (info.TryMapProperty($"blendShape.{shapeName}", out var mapped) + && mapped.Component == info.MappedComponent) + shapeName = ParseBlendShapeProperty(mapped.Property); + else + removed = true; + } + + if (removed) + BuildLog.LogError("ApplyObjectMapping:VRCAvatarDescriptor:viseme BlendShape Removed"); } - if (removed) - BuildLog.LogError("ApplyObjectMapping:VRCAvatarDescriptor:viseme BlendShape Removed"); + break; } case VRC_AvatarDescriptor.LipSyncStyle.VisemeParameterOnly: @@ -290,19 +301,28 @@ protected override void ApplySpecialMapping(VRCAvatarDescriptor component, Mappi case VRCAvatarDescriptor.EyelidType.Blendshapes: { var info = mappingSource.GetMappedComponent(component.customEyeLookSettings.eyelidsSkinnedMesh); - component.customEyeLookSettings.eyelidsSkinnedMesh = info.MappedComponent; - var removed = false; - foreach (ref var eyelidsBlendshape in component.customEyeLookSettings.eyelidsBlendshapes.AsSpan()) + if (info.MappedComponent == null) { - if (info.TryMapProperty(VProp.BlendShapeIndex(eyelidsBlendshape), out var mapped) - && mapped.Component == info.MappedComponent) - eyelidsBlendshape = VProp.ParseBlendShapeIndex(mapped.Property); - else - removed = true; + component.customEyeLookSettings.eyelidsSkinnedMesh = null; + component.customEyeLookSettings.eyelidType = VRCAvatarDescriptor.EyelidType.None; + } + else + { + component.customEyeLookSettings.eyelidsSkinnedMesh = info.MappedComponent; + var removed = false; + foreach (ref var eyelidsBlendshape in component.customEyeLookSettings.eyelidsBlendshapes + .AsSpan()) + { + if (info.TryMapProperty(VProp.BlendShapeIndex(eyelidsBlendshape), out var mapped) + && mapped.Component == info.MappedComponent) + eyelidsBlendshape = VProp.ParseBlendShapeIndex(mapped.Property); + else + removed = true; + } + + if (removed) + BuildLog.LogError("ApplyObjectMapping:VRCAvatarDescriptor:eyelids BlendShape Removed"); } - - if (removed) - BuildLog.LogError("ApplyObjectMapping:VRCAvatarDescriptor:eyelids BlendShape Removed"); } break; default: From 8444fbe8aacafd0e8808702de4485b3690d11790 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Mon, 23 Sep 2024 21:04:41 +0900 Subject: [PATCH 2/2] docs(changelog): Avatars with Visame Skinned Mesh disabled will not able to upload --- CHANGELOG-PRERELEASE.md | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 479a4221c..b4a6ff328 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog]. ### Fixed - Null Reference Exception with newly created VRCAnimatorPlayAudio `#1199` - Particle System that uses local scale will be broken `#1197` +- Avatars with Visame Skinned Mesh disabled will not able to upload `#1202` ### Security diff --git a/CHANGELOG.md b/CHANGELOG.md index d316d47c6..d19f47423 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog]. ### Fixed - Null Reference Exception with newly created VRCAnimatorPlayAudio `#1199` - Particle System that uses local scale will be broken `#1197` +- Avatars with Visame Skinned Mesh disabled will not able to upload `#1202` ### Security