From 93b0e0e8e3c0632c9ed0f4c20730cd3ecec476f2 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Thu, 2 Nov 2023 23:47:34 +0900 Subject: [PATCH 1/3] fix: unnecessary some properties are mapped --- Editor/ObjectMapping/AnimationObjectMapper.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Editor/ObjectMapping/AnimationObjectMapper.cs b/Editor/ObjectMapping/AnimationObjectMapper.cs index 0a1002652..e3b01b2bb 100644 --- a/Editor/ObjectMapping/AnimationObjectMapper.cs +++ b/Editor/ObjectMapping/AnimationObjectMapper.cs @@ -130,6 +130,12 @@ public EditorCurveBinding[] MapBinding(EditorCurveBinding binding) if (componentInfo.PropertyMapping.TryGetValue(binding.propertyName, out var newProp)) { + // if mapped one is exactly same as original, return null + if (newProp.AllCopiedTo.Length == 1 + && newProp.AllCopiedTo[0].InstanceId == instanceId + && newProp.AllCopiedTo[0].Name == binding.propertyName) + return null; + // there are mapping for property var curveBindings = new EditorCurveBinding[newProp.AllCopiedTo.Length]; var copiedToIndex = 0; From 55b4b77f8ed3e2789fba8957e916110c4674c642 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Thu, 2 Nov 2023 23:59:47 +0900 Subject: [PATCH 2/3] fix: Proxy animation can be remapped --- Editor/ObjectMapping/ObjectMappingContext.cs | 4 ++++ Editor/Utils/Utils.VRCSDK.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Editor/ObjectMapping/ObjectMappingContext.cs b/Editor/ObjectMapping/ObjectMappingContext.cs index b5d0736ba..8dae14d66 100644 --- a/Editor/ObjectMapping/ObjectMappingContext.cs +++ b/Editor/ObjectMapping/ObjectMappingContext.cs @@ -142,6 +142,10 @@ private Object CustomClone(Object o) { if (o is AnimationClip clip) { +#if AAO_VRCSDK3_AVATARS + // TODO: when BuildContext have property to check if it is for VRCSDK3, additionally use it. + if (clip.IsProxy()) return clip; +#endif var newClip = new AnimationClip(); newClip.name = "rebased " + clip.name; diff --git a/Editor/Utils/Utils.VRCSDK.cs b/Editor/Utils/Utils.VRCSDK.cs index bc4a82af1..cd4ee1369 100644 --- a/Editor/Utils/Utils.VRCSDK.cs +++ b/Editor/Utils/Utils.VRCSDK.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using UnityEngine; using VRC.Dynamics; @@ -25,5 +26,8 @@ public static IEnumerable GetAffectedTransforms(this VRCPhysBoneBase queue.Enqueue(child); } } + + // https://creators.vrchat.com/avatars/#proxy-animations + public static bool IsProxy(this AnimationClip clip) => clip.name.StartsWith("proxy_", StringComparison.Ordinal); } } \ No newline at end of file From 164e610161f0d387e2210525d8d7a028c714a883 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Fri, 3 Nov 2023 00:04:03 +0900 Subject: [PATCH 3/3] fix: proxy animation can be renamed --- CHANGELOG-PRERELEASE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index f859d2812..decb336fe 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog]. ### Removed ### Fixed +- proxy animation can be modified `#678` ### Security