modular-avatar icon indicating copy to clipboard operation
modular-avatar copied to clipboard

MA Parameters may destroy persistent assets indirectly referenced from MA MergeAnimator

Open kaikoga opened this issue 1 year ago • 1 comments

... 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() ),
  • 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 ).

kaikoga avatar Jul 14 '24 07:07 kaikoga