From d23b9f94a2e182d43f3bb0e81f35a47cbb1c877b Mon Sep 17 00:00:00 2001 From: bd_ Date: Sat, 16 Nov 2024 19:02:37 -0800 Subject: [PATCH] fix: empty MA Parameters names break auto param UI (#1346) --- Editor/Inspector/Menu/MenuItemGUI.cs | 9 +++++++-- Editor/ParamsUsage/MAParametersIntrospection.cs | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Editor/Inspector/Menu/MenuItemGUI.cs b/Editor/Inspector/Menu/MenuItemGUI.cs index 8f4ab313..23a20f21 100644 --- a/Editor/Inspector/Menu/MenuItemGUI.cs +++ b/Editor/Inspector/Menu/MenuItemGUI.cs @@ -169,11 +169,16 @@ namespace nadena.dev.modular_avatar.core.editor } Dictionary rootParameters = new(); - + foreach (var param in ParameterIntrospectionCache.GetParametersForObject(parentAvatar.gameObject) .Where(p => p.Namespace == ParameterNamespace.Animator) ) - rootParameters[param.EffectiveName] = param; + { + if (!string.IsNullOrWhiteSpace(param.EffectiveName)) + { + rootParameters[param.EffectiveName] = param; + } + } var remaps = ParameterIntrospectionCache.GetParameterRemappingsAt(paramRef); foreach (var remap in remaps) diff --git a/Editor/ParamsUsage/MAParametersIntrospection.cs b/Editor/ParamsUsage/MAParametersIntrospection.cs index 9c3d4e46..1d9bf2e3 100644 --- a/Editor/ParamsUsage/MAParametersIntrospection.cs +++ b/Editor/ParamsUsage/MAParametersIntrospection.cs @@ -59,7 +59,8 @@ namespace nadena.dev.modular_avatar.core.editor public IEnumerable GetSuppliedParameters(ndmf.BuildContext context = null) { - return _component.parameters.Select(p => + return _component.parameters + .Select(p => { AnimatorControllerParameterType paramType; bool animatorOnly = false;