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

fix: ParameterAssignerPass forces all parameters to float type #1337

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Changes from all 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
10 changes: 7 additions & 3 deletions Editor/ReactiveObjects/ParameterAssignerPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,21 @@ protected override void Execute(ndmf.BuildContext context)
expParams.parameters = expParams.parameters.Concat(newParameters.Values).ToArray();
}

if (_mamiByParam.Count > 0)
var mamiWithRC = _mamiByParam.Where(kvp => kvp.Value.Any(
component => component.TryGetComponent<ReactiveComponent>(out _)
)).ToList();

if (mamiWithRC.Count > 0)
{
// This make sures the parameters are correctly merged into the FX layer.
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
parameters = mamiWithRC.Select(kvp => new AnimatorControllerParameter
{
name = name,
name = kvp.Key,
type = AnimatorControllerParameterType.Float,
}).ToArray(),
};
Expand Down
Loading