Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: broken synced Layer support #1341

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading