mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-11 23:19:00 +08:00
port layer pruning to ndmf-anim-api
This commit is contained in:
parent
5862f6cf97
commit
4455119632
@ -7,6 +7,7 @@ using nadena.dev.modular_avatar.editor.ErrorReporting;
|
|||||||
using nadena.dev.ndmf;
|
using nadena.dev.ndmf;
|
||||||
using nadena.dev.ndmf.animator;
|
using nadena.dev.ndmf.animator;
|
||||||
using nadena.dev.ndmf.fluent;
|
using nadena.dev.ndmf.fluent;
|
||||||
|
using nadena.dev.ndmf.util;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
@ -76,6 +77,8 @@ namespace nadena.dev.modular_avatar.core.editor.plugin
|
|||||||
#endif
|
#endif
|
||||||
seq.Run(MergeArmaturePluginPass.Instance);
|
seq.Run(MergeArmaturePluginPass.Instance);
|
||||||
|
|
||||||
|
seq.Run("Prune empty animator layers",
|
||||||
|
ctx => { ctx.Extension<AnimatorServicesContext>().RemoveEmptyLayers(); });
|
||||||
});
|
});
|
||||||
|
|
||||||
seq.WithRequiredExtension(typeof(AnimationServicesContext), _s2 =>
|
seq.WithRequiredExtension(typeof(AnimationServicesContext), _s2 =>
|
||||||
|
@ -32,8 +32,12 @@ namespace modular_avatar_tests
|
|||||||
Assert.AreEqual("L3", l3.name);
|
Assert.AreEqual("L3", l3.name);
|
||||||
Assert.AreEqual("L3.a", l3a.name);
|
Assert.AreEqual("L3.a", l3a.name);
|
||||||
|
|
||||||
Assert.AreEqual(2, l3.stateMachine.defaultState.behaviours.Length);
|
// The layer control behavior referencing the deleted layer should be removed
|
||||||
Assert.AreEqual(4, ((VRCAnimatorLayerControl)l3.stateMachine.defaultState.behaviours[0]).layer);
|
Assert.AreEqual(3, l3.stateMachine.defaultState.behaviours.Length);
|
||||||
|
Assert.AreEqual("2", ((VRCAnimatorLayerControl)l3.stateMachine.defaultState.behaviours[0]).debugString);
|
||||||
|
Assert.IsTrue(l3.stateMachine.defaultState.behaviours[1] is VRCAnimatorTrackingControl);
|
||||||
|
Assert.AreEqual("3", ((VRCAnimatorLayerControl)l3.stateMachine.defaultState.behaviours[2]).debugString);
|
||||||
|
Assert.AreEqual(3, ((VRCAnimatorLayerControl)l3.stateMachine.defaultState.behaviours[0]).layer);
|
||||||
|
|
||||||
Assert.AreEqual(1, l3a.stateMachine.defaultState.behaviours.Length);
|
Assert.AreEqual(1, l3a.stateMachine.defaultState.behaviours.Length);
|
||||||
Assert.AreEqual(3, ((VRCAnimatorLayerControl)l3a.stateMachine.defaultState.behaviours[0]).layer);
|
Assert.AreEqual(3, ((VRCAnimatorLayerControl)l3a.stateMachine.defaultState.behaviours[0]).layer);
|
||||||
|
@ -1,5 +1,22 @@
|
|||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!114 &-8943217745761122886
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 1
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 0}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: -1936262289, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
playable: 0
|
||||||
|
layer: 0
|
||||||
|
goalWeight: 0
|
||||||
|
blendDuration: 0
|
||||||
|
debugString: 3
|
||||||
--- !u!1107 &-6599268793956612610
|
--- !u!1107 &-6599268793956612610
|
||||||
AnimatorStateMachine:
|
AnimatorStateMachine:
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
@ -76,6 +93,7 @@ AnimatorState:
|
|||||||
- {fileID: 2645212092703721488}
|
- {fileID: 2645212092703721488}
|
||||||
- {fileID: -4263003778027536188}
|
- {fileID: -4263003778027536188}
|
||||||
- {fileID: 1637143755065747004}
|
- {fileID: 1637143755065747004}
|
||||||
|
- {fileID: -8943217745761122886}
|
||||||
m_Position: {x: 50, y: 50, z: 0}
|
m_Position: {x: 50, y: 50, z: 0}
|
||||||
m_IKOnFeet: 0
|
m_IKOnFeet: 0
|
||||||
m_WriteDefaultValues: 1
|
m_WriteDefaultValues: 1
|
||||||
@ -102,8 +120,8 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: -1936262289, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3}
|
m_Script: {fileID: -1936262289, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
playable: 0
|
playable: 1
|
||||||
layer: 0
|
layer: 1
|
||||||
goalWeight: 0
|
goalWeight: 0
|
||||||
blendDuration: 0
|
blendDuration: 0
|
||||||
debugString: 2
|
debugString: 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user