Fix blend tree parameters not being remapped

Closes: #91
This commit is contained in:
bd_ 2022-11-19 18:57:06 -08:00
parent 08897abab1
commit 999add24c9

View File

@ -273,6 +273,25 @@ namespace nadena.dev.modular_avatar.core.editor
ProcessDriver(driver, remaps);
}
}
if (state.motion is BlendTree blendTree)
{
ProcessBlendtree(blendTree, remaps);
}
}
private void ProcessBlendtree(BlendTree blendTree, ImmutableDictionary<string, string> remaps)
{
blendTree.blendParameter = remap(remaps, blendTree.blendParameter);
blendTree.blendParameterY = remap(remaps, blendTree.blendParameterY);
foreach (var childMotion in blendTree.children)
{
if (childMotion.motion is BlendTree subTree)
{
ProcessBlendtree(subTree, remaps);
}
}
}
private void ProcessDriver(VRCAvatarParameterDriver driver, ImmutableDictionary<string, string> remaps)