ModularAvatarMergeAnimator component is added by NDMF plugin before MA pass,
ModularAvatarMergeAnimator.animator is set to a temporary AnimatorController ( new AnimatorController() ),
the AnimatorController is populated with references from persistent assets,
( e.g. maMergeAnimator.animator.layers = existingAnimatorControllerAsset.layers.Where(SomeLogic).ToArray() )
and the parameters in the merged animation are renamed by ModularAvatarParameters.
Analysis
AnimatorController itself is temporary asset (so not deep cloned), but the data it contains is not.
Workaround
Deep copy animator layers, instead of populating ModularAvatarMergeAnimator.animator with references from persistent assets.
Alternatively, do not rename parameters ( set internalParameter = false ).
Hmm. This needs to be fixed, but the performance implications would probably be quite severe with the current architecture. This will have to wait for a refactoring of the animator merge system.
... when conditions below are met:
ModularAvatarMergeAnimator
component is added by NDMF plugin before MA pass,ModularAvatarMergeAnimator.animator
is set to a temporary AnimatorController (new AnimatorController()
),maMergeAnimator.animator.layers = existingAnimatorControllerAsset.layers.Where(SomeLogic).ToArray()
)ModularAvatarParameters
.Analysis
AnimatorController itself is temporary asset (so not deep cloned), but the data it contains is not.
Workaround
ModularAvatarMergeAnimator.animator
with references from persistent assets.internalParameter = false
).