modular-avatar/Editor/OptimizationPasses/PruneParametersPass.cs
kaikoga 5359e3b006
chore: Fix non-VRChat support (#650)
* add referenced assembly

* remove unused usings

* MA Merge Blend Tree is VRC specific

because it expects VRC style Animator Layer setup

* PruneParametersPass is VRChat specific

* fix: use FindAvatarTransformInParents() to be more cross platform

* fix MergeArmatureHook: nop logic for PhysBones if we do not dedup PhysBones

* fix AnimatorCombiner: ignore VRC components when non-VRC

btw, is AnimatorCombiner VRC specific?

* conditional compile some VRChat specific tests
2024-02-12 14:59:23 +09:00

21 lines
585 B
C#

#if MA_VRCSDK3_AVATARS
using System.Linq;
using nadena.dev.ndmf;
namespace nadena.dev.modular_avatar.core.editor
{
internal class PruneParametersPass : Pass<PruneParametersPass>
{
protected override void Execute(ndmf.BuildContext context)
{
var expParams = context.AvatarDescriptor.expressionParameters;
if (expParams != null && context.IsTemporaryAsset(expParams))
{
expParams.parameters = expParams.parameters.Where(p => !string.IsNullOrEmpty(p.name)).ToArray();
}
}
}
}
#endif