mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-01 20:25:07 +08:00
opti: prune garbage sample expression parameters found in VRChat's template asset (#578)
This commit is contained in:
parent
93aa4db3e8
commit
9e4c876305
17
Editor/OptimizationPasses/PruneParametersPass.cs
Normal file
17
Editor/OptimizationPasses/PruneParametersPass.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
3
Editor/OptimizationPasses/PruneParametersPass.cs.meta
Normal file
3
Editor/OptimizationPasses/PruneParametersPass.cs.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 81c7d9255ba848e4be29b291bc086ed6
|
||||||
|
timeCreated: 1703573974
|
@ -83,6 +83,7 @@ namespace nadena.dev.modular_avatar.core.editor.plugin
|
|||||||
UnityEngine.Object.DestroyImmediate(component);
|
UnityEngine.Object.DestroyImmediate(component);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
seq.Run(PruneParametersPass.Instance);
|
||||||
});
|
});
|
||||||
|
|
||||||
InPhase(BuildPhase.Optimizing)
|
InPhase(BuildPhase.Optimizing)
|
||||||
|
Loading…
Reference in New Issue
Block a user