From 10a944f84dc4a2ca0d8a75eb2c6a3d9885fefe43 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Wed, 13 Nov 2024 14:47:27 +0900 Subject: [PATCH 1/2] fix: broken synced Layer support --- Editor/ObjectMapping/ObjectMappingContext.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Editor/ObjectMapping/ObjectMappingContext.cs b/Editor/ObjectMapping/ObjectMappingContext.cs index cf01cfc8..de351525 100644 --- a/Editor/ObjectMapping/ObjectMappingContext.cs +++ b/Editor/ObjectMapping/ObjectMappingContext.cs @@ -215,8 +215,17 @@ public void FixAnimatorController(AnimatorController? controller) foreach (var layer in layers) { FixAvatarMask(layer.avatarMask); - foreach (var animatorState in ACUtils.AllStates(layer.stateMachine)) - animatorState.motion = MapMotion(animatorState.motion); + if (layer.syncedLayerIndex != -1) + { + foreach (var animatorState in ACUtils.AllStates(layers[layer.syncedLayerIndex].stateMachine)) + if (layer.GetOverrideMotion(animatorState) is {} motion) + layer.SetOverrideMotion(animatorState, motion); + } + else + { + foreach (var animatorState in ACUtils.AllStates(layer.stateMachine)) + animatorState.motion = MapMotion(animatorState.motion); + } } controller.layers = layers; foreach (var stateMachineBehaviour in ACUtils.StateMachineBehaviours(controller)) From b8c93b3782966b829cc93cba7230441ffd5221bf Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Wed, 13 Nov 2024 15:55:36 +0900 Subject: [PATCH 2/2] docs(changelog): Broken synced Layer support --- CHANGELOG-PRERELEASE.md | 1 + CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 0d874153..544240da 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog]. ### Fixed - Error with nested merge skinned mesh `#1340` +- Broken synced Layer support `#1341` ### Security diff --git a/CHANGELOG.md b/CHANGELOG.md index d51959b8..d376f849 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,7 +91,7 @@ The format is based on [Keep a Changelog]. - Renamed debug options internally `#1228` - This will lose previously configured debug options. - However, debug options are not considered as Public API as stated in documents so this is not backward incompatible changes in semver 2.0.0 section 8. -- Performance Improvements `#1234` `#1243` `#1240` `#1288` `#1304` `#1307` `#1314` `#1325` `#1327` `#1326` +- Performance Improvements `#1234` `#1243` `#1240` `#1288` `#1304` `#1307` `#1314` `#1325` `#1327` `#1326` `#1341` - Transform gizmo are now hidden while you're editing box of Remove Mesh in Box `#1259` - This prevents mistakenly moving the Skinned Mesh Renderer while editing the box. - Make MergePhysBone implement `INetworkID` `#1260`