Skip to content

Commit

Permalink
Merge pull request #1341 from anatawa12/broken-layer-override-support
Browse files Browse the repository at this point in the history
fix: broken synced Layer support
  • Loading branch information
anatawa12 authored Nov 13, 2024
2 parents 9db48cb + b8c93b3 commit 14a6e74
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
13 changes: 11 additions & 2 deletions Editor/ObjectMapping/ObjectMappingContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 14a6e74

Please sign in to comment.