modular-avatar/Editor/OptimizationPasses/PruneParametersPass.cs
kaikoga efa263b551
chore: Fix non-VRChat support (for MA 1.10.5) (#1324)
* feat: add version defines for VRCSDK

* chore: early return if VRCSDK project but not VRChat avatar
2024-10-27 10:06:35 -07:00

23 lines
637 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)
{
if (!context.AvatarDescriptor) return;
var expParams = context.AvatarDescriptor.expressionParameters;
if (expParams != null && context.IsTemporaryAsset(expParams))
{
expParams.parameters = expParams.parameters.Where(p => !string.IsNullOrEmpty(p.name)).ToArray();
}
}
}
}
#endif