diff --git a/Editor/FixupPasses/FixupExpressionsMenuPass.cs b/Editor/FixupPasses/FixupExpressionsMenuPass.cs index f4b549ee..4f36ec2b 100644 --- a/Editor/FixupPasses/FixupExpressionsMenuPass.cs +++ b/Editor/FixupPasses/FixupExpressionsMenuPass.cs @@ -19,6 +19,8 @@ internal class FixupExpressionsMenuPass internal static void FixupExpressionsMenu(BuildContext context) { + if (!context.AvatarDescriptor) return; + context.AvatarDescriptor.customExpressions = true; var expressionsMenu = context.AvatarDescriptor.expressionsMenu; diff --git a/Editor/MergeAnimatorProcessor.cs b/Editor/MergeAnimatorProcessor.cs index 69fb0e28..5b25649c 100644 --- a/Editor/MergeAnimatorProcessor.cs +++ b/Editor/MergeAnimatorProcessor.cs @@ -65,6 +65,7 @@ internal void OnPreprocessAvatar(GameObject avatarGameObject, BuildContext conte mergeSessions.Clear(); var descriptor = avatarGameObject.GetComponent(); + if (!descriptor) return; if (descriptor.baseAnimationLayers != null) InitSessions(descriptor.baseAnimationLayers); if (descriptor.specialAnimationLayers != null) InitSessions(descriptor.specialAnimationLayers); diff --git a/Editor/OptimizationPasses/PruneParametersPass.cs b/Editor/OptimizationPasses/PruneParametersPass.cs index a38b3655..801fb3e9 100644 --- a/Editor/OptimizationPasses/PruneParametersPass.cs +++ b/Editor/OptimizationPasses/PruneParametersPass.cs @@ -9,6 +9,8 @@ internal class PruneParametersPass : Pass { protected override void Execute(ndmf.BuildContext context) { + if (!context.AvatarDescriptor) return; + var expParams = context.AvatarDescriptor.expressionParameters; if (expParams != null && context.IsTemporaryAsset(expParams)) { diff --git a/Editor/RenameParametersHook.cs b/Editor/RenameParametersHook.cs index 697633b7..c4ae0b75 100644 --- a/Editor/RenameParametersHook.cs +++ b/Editor/RenameParametersHook.cs @@ -183,6 +183,8 @@ private void SetExpressionParameters(GameObject avatarRoot, ImmutableDictionary< .ToImmutableDictionary(); var avatar = avatarRoot.GetComponent(); + if (!avatar) return; + var expParams = avatar.expressionParameters; if (expParams == null)