fix type harmonization

This commit is contained in:
bd_ 2025-02-14 19:11:32 -08:00
parent 4455119632
commit dca6ad36ba
4 changed files with 9 additions and 4 deletions

View File

@ -100,9 +100,9 @@ namespace nadena.dev.modular_avatar.core.editor
}
var stash = context.PluginBuildContext.GetState<RenamedMergeAnimators>();
var clonedController = stash.Controllers.GetValueOrDefault(merge)
?? _asc.ControllerContext.CloneContext.Clone(merge.animator);
?? _asc.ControllerContext.CloneContext.CloneDistinct(merge.animator);
string basePath;
if (merge.pathMode == MergeAnimatorPathMode.Relative)

View File

@ -79,6 +79,8 @@ namespace nadena.dev.modular_avatar.core.editor.plugin
seq.Run("Prune empty animator layers",
ctx => { ctx.Extension<AnimatorServicesContext>().RemoveEmptyLayers(); });
seq.Run("Harmonize animator parameter types",
ctx => { ctx.Extension<AnimatorServicesContext>().HarmonizeParameterTypes(); });
});
seq.WithRequiredExtension(typeof(AnimationServicesContext), _s2 =>

View File

@ -70,7 +70,7 @@ namespace nadena.dev.modular_avatar.core.editor
if (mama.animator == null) return null;
var cloned = AnimatorServices.ControllerContext.CloneContext.Clone(mama.animator, mama.layerType);
var cloned = AnimatorServices.ControllerContext.CloneContext.CloneDistinct(mama.animator, mama.layerType);
Controllers[mama] = cloned;
return cloned;

View File

@ -237,7 +237,10 @@ public class ConvertTransitionTypes : TestBase
var fx = (AnimatorController) FindFxController(prefab).animatorController;
Assert.AreEqual(fx.parameters[0].type, AnimatorControllerParameterType.Bool);
Assert.AreEqual(
AnimatorControllerParameterType.Bool,
fx.parameters.First(p => p.name == "bool").type
);
}
void AssertTransitions(AnimatorControllerLayer layer, string src, string dest, int index,