mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-17 11:50:11 +08:00
fix: Animator can cache incorrect humanoid bone mappings (#431)
When multiple bones with the same name exist in the initial hierarchy, the root Animator can cache (prior to MA execution) bones that will later be deleted or renamed due to MA action. While this isn't persisted to the avatar asset bundle, it can result in validation failures blocking upload. To resolve this, invalidate this cache late in MA execution.
This commit is contained in:
parent
29ca97e0c1
commit
c8e535cd7e
@ -223,6 +223,16 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
new GCGameObjectsPass(context, avatarGameObject).OnPreprocessAvatar();
|
||||
|
||||
context.CommitReferencedAssets();
|
||||
|
||||
// workaround problem with avatar matching
|
||||
// https://github.com/bdunderscore/modular-avatar/issues/430
|
||||
var animator = avatarGameObject.GetComponent<Animator>();
|
||||
if (animator) {
|
||||
var avatar = animator.avatar;
|
||||
animator.avatar = null;
|
||||
// ReSharper disable once Unity.InefficientPropertyAccess
|
||||
animator.avatar = avatar;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user