From 1c6df6078e46a459630101984185a5d1773f9645 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sun, 22 Dec 2024 16:03:34 +0900 Subject: [PATCH 1/2] fix: animating transform with C# named properties are broken --- Editor/Processors/MergePhysBoneProcessor.cs | 3 +++ .../Processors/TraceAndOptimize/FindUnusedObjectsProcessor.cs | 4 ++++ Editor/Processors/TraceAndOptimize/OptimizePhysBone.cs | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/Editor/Processors/MergePhysBoneProcessor.cs b/Editor/Processors/MergePhysBoneProcessor.cs index f039c2fde..ef398dd7f 100644 --- a/Editor/Processors/MergePhysBoneProcessor.cs +++ b/Editor/Processors/MergePhysBoneProcessor.cs @@ -413,6 +413,9 @@ private static Vector3 QuaternionToEulerXZY(Quaternion q) { "m_LocalRotation.x", "m_LocalRotation.y", "m_LocalRotation.z", "m_LocalRotation.w", "m_LocalPosition.x", "m_LocalPosition.y", "m_LocalPosition.z" , + // Animator Window won't create the following properties, but generated by some scripts and works in runtime + "localRotation.x", "localRotation.y", "localRotation.z", "localRotation.w", + "localPosition.x", "localPosition.y", "localPosition.z", }; sealed class MergePhysBoneMerger : MergePhysBoneEditorModificationUtils diff --git a/Editor/Processors/TraceAndOptimize/FindUnusedObjectsProcessor.cs b/Editor/Processors/TraceAndOptimize/FindUnusedObjectsProcessor.cs index 336b89c76..3281e3cf5 100644 --- a/Editor/Processors/TraceAndOptimize/FindUnusedObjectsProcessor.cs +++ b/Editor/Processors/TraceAndOptimize/FindUnusedObjectsProcessor.cs @@ -416,6 +416,10 @@ bool GameObjectAnimated(Transform transform, BuildContext context) "m_LocalRotation.x", "m_LocalRotation.y", "m_LocalRotation.z", "m_LocalRotation.w", "m_LocalPosition.x", "m_LocalPosition.y", "m_LocalPosition.z", "m_LocalScale.x", "m_LocalScale.y", "m_LocalScale.z", + // Animator Window won't create the following properties, but generated by some scripts and works in runtime + "localRotation.x", "localRotation.y", "localRotation.z", "localRotation.w", + "localPosition.x", "localPosition.y", "localPosition.z", + "localScale.x", "localScale.y", "localScale.z", "localEulerAnglesRaw.x", "localEulerAnglesRaw.y", "localEulerAnglesRaw.z" }; } diff --git a/Editor/Processors/TraceAndOptimize/OptimizePhysBone.cs b/Editor/Processors/TraceAndOptimize/OptimizePhysBone.cs index 6612bd8cd..e05666ab5 100644 --- a/Editor/Processors/TraceAndOptimize/OptimizePhysBone.cs +++ b/Editor/Processors/TraceAndOptimize/OptimizePhysBone.cs @@ -187,6 +187,10 @@ private static bool IsAnimatedExternally(VRCPhysBoneBase physBone, AnimationComp "m_LocalRotation.x", "m_LocalRotation.y", "m_LocalRotation.z", "m_LocalRotation.w", "m_LocalPosition.x", "m_LocalPosition.y", "m_LocalPosition.z", "m_LocalScale.x", "m_LocalScale.y", "m_LocalScale.z", + // Animator Window won't create the following properties, but generated by some scripts and works in runtime + "localRotation.x", "localRotation.y", "localRotation.z", "localRotation.w", + "localPosition.x", "localPosition.y", "localPosition.z", + "localScale.x", "localScale.y", "localScale.z", "localEulerAnglesRaw.x", "localEulerAnglesRaw.y", "localEulerAnglesRaw.z" }; From 5f3891e09c9b0fcc61c32d7f714148cb49294a31 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sun, 22 Dec 2024 16:08:12 +0900 Subject: [PATCH 2/2] docs(changelog): Animating transform with C# named properties are broken by merge bone --- CHANGELOG-PRERELEASE.md | 2 ++ CHANGELOG.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 704189f0e..cacdb22b8 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -17,6 +17,8 @@ The format is based on [Keep a Changelog]. ### Fixed - Prefab overrides on the scene are reverted on first load of the scene at first launch `#1372` +- Animating transform with C# named properties are broken by merge bone `#1373` + - Animator window won't create such animation but some script generates and it works surprisingly ### Security diff --git a/CHANGELOG.md b/CHANGELOG.md index 764bf7cd8..45f183b40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ The format is based on [Keep a Changelog]. ### Fixed - Prefab overrides on the scene are reverted on first load of the scene at first launch `#1372` +- Animating transform with C# named properties are broken by merge bone `#1373` + - Animator window won't create such animation but some script generates and it works surprisingly ### Security