Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes error when merging same parameter with different type in RC menu item #1313

Merged
merged 3 commits into from
Oct 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Editor/ReactiveObjects/ParameterAssignerPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using nadena.dev.ndmf;
using UnityEngine;
using UnityEditor.Animations;
using VRC.SDK3.Avatars.ScriptableObjects;

namespace nadena.dev.modular_avatar.core.editor
Expand Down Expand Up @@ -186,6 +187,19 @@ protected override void Execute(ndmf.BuildContext context)

expParams.parameters = expParams.parameters.Concat(newParameters.Values).ToArray();
}

if (_mamiByParam.Count > 0)
{
// This make sures the parameters are correctly merged into the FX layer.
context.AvatarRootObject.AddComponent<ModularAvatarMergeAnimator>().animator = new AnimatorController
{
parameters = _mamiByParam.Keys.Select(name => new AnimatorControllerParameter
{
name = name,
type = AnimatorControllerParameterType.Float,
}).ToArray(),
};
}
}

internal static ControlCondition AssignMenuItemParameter(
Expand Down
Loading