mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-30 18:22:52 +08:00
fix: auto-rename PB parameters are not applied on animators (#803)
This commit is contained in:
parent
cb2fd75ec6
commit
7881aa920e
@ -64,6 +64,14 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
|
||||
private int internalParamIndex = 0;
|
||||
|
||||
// TODO: Move into NDMF
|
||||
private ImmutableList<string> PhysBoneSuffixes = ImmutableList<string>.Empty
|
||||
.Add("_IsGrabbed")
|
||||
.Add("_IsPosed")
|
||||
.Add("_Angle")
|
||||
.Add("_Stretch")
|
||||
.Add("_Squish");
|
||||
|
||||
class ParameterInfo
|
||||
{
|
||||
private static long encounterOrderCounter;
|
||||
@ -367,7 +375,19 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
var controller = merger.animator as AnimatorController;
|
||||
if (controller != null)
|
||||
{
|
||||
ProcessAnimator(ref controller, paramInfo.GetParameterRemappingsAt(obj));
|
||||
var mappings = paramInfo.GetParameterRemappingsAt(obj);
|
||||
var remap = mappings.SelectMany(item =>
|
||||
{
|
||||
if (item.Key.Item1 == ParameterNamespace.Animator) return new[] { item };
|
||||
|
||||
return PhysBoneSuffixes.Select(suffix =>
|
||||
new KeyValuePair<(ParameterNamespace, string), ParameterMapping>(
|
||||
(ParameterNamespace.Animator, item.Key.Item2 + suffix),
|
||||
new ParameterMapping(item.Value.ParameterName + suffix, item.Value.IsHidden)
|
||||
)
|
||||
);
|
||||
}).ToImmutableDictionary();
|
||||
ProcessAnimator(ref controller, remap);
|
||||
merger.animator = controller;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user