Set defaults to ModularAvatarMergeAnimator to prevent potential errors

This commit is contained in:
JLChnToZ 2024-10-22 22:34:43 +08:00
parent 97af2308d6
commit d087b05c8a

View File

@ -4,6 +4,7 @@ using System.Linq;
using nadena.dev.ndmf;
using UnityEngine;
using UnityEditor.Animations;
using VRC.SDK3.Avatars.Components;
using VRC.SDK3.Avatars.ScriptableObjects;
namespace nadena.dev.modular_avatar.core.editor
@ -191,7 +192,10 @@ namespace nadena.dev.modular_avatar.core.editor
if (_mamiByParam.Count > 0)
{
// This make sures the parameters are correctly merged into the FX layer.
context.AvatarRootObject.AddComponent<ModularAvatarMergeAnimator>().animator = new AnimatorController
var mergeAnimator = context.AvatarRootObject.AddComponent<ModularAvatarMergeAnimator>();
mergeAnimator.layerType = VRCAvatarDescriptor.AnimLayerType.FX;
mergeAnimator.deleteAttachedAnimator = false;
mergeAnimator.animator = new AnimatorController
{
parameters = _mamiByParam.Keys.Select(name => new AnimatorControllerParameter
{