From a9a0fd648e9e70f94093180263ad26c13a9f746f Mon Sep 17 00:00:00 2001 From: bd_ Date: Wed, 27 Dec 2023 18:54:59 +0900 Subject: [PATCH] feat: prune empty layers (#579) Closes: #554 --- .github/ProjectRoot/vpm-manifest-2019.json | 4 +- .github/ProjectRoot/vpm-manifest-2022.json | 4 +- Editor/AnimatorMerger.cs | 106 ++++- Editor/MergeAnimatorProcessor.cs | 33 +- UnitTests~/Animation/LayerPruningTest.cs | 40 ++ UnitTests~/Animation/LayerPruningTest.cs.meta | 11 + UnitTests~/Animation/LayerPruningTest.meta | 8 + UnitTests~/Animation/LayerPruningTest.prefab | 426 ++++++++++++++++++ .../Animation/LayerPruningTest.prefab.meta | 7 + UnitTests~/Animation/LayerPruningTest/A1.anim | 53 +++ .../Animation/LayerPruningTest/A1.anim.meta | 8 + UnitTests~/Animation/LayerPruningTest/A2.anim | 53 +++ .../Animation/LayerPruningTest/A2.anim.meta | 8 + UnitTests~/Animation/LayerPruningTest/A3.anim | 53 +++ .../Animation/LayerPruningTest/A3.anim.meta | 8 + .../Animation/LayerPruningTest/AC1.controller | 103 +++++ .../LayerPruningTest/AC1.controller.meta | 8 + .../Animation/LayerPruningTest/AC2.controller | 103 +++++ .../LayerPruningTest/AC2.controller.meta | 8 + .../Animation/LayerPruningTest/AC3.controller | 241 ++++++++++ .../LayerPruningTest/AC3.controller.meta | 8 + .../BlendshapeSyncIntegrationTest.prefab | 89 ++-- UnitTests~/SyncedLayerHandling/AC1.controller | 33 +- UnitTests~/TestBase.cs | 3 + package.json | 2 +- 25 files changed, 1343 insertions(+), 77 deletions(-) create mode 100644 UnitTests~/Animation/LayerPruningTest.cs create mode 100644 UnitTests~/Animation/LayerPruningTest.cs.meta create mode 100644 UnitTests~/Animation/LayerPruningTest.meta create mode 100644 UnitTests~/Animation/LayerPruningTest.prefab create mode 100644 UnitTests~/Animation/LayerPruningTest.prefab.meta create mode 100644 UnitTests~/Animation/LayerPruningTest/A1.anim create mode 100644 UnitTests~/Animation/LayerPruningTest/A1.anim.meta create mode 100644 UnitTests~/Animation/LayerPruningTest/A2.anim create mode 100644 UnitTests~/Animation/LayerPruningTest/A2.anim.meta create mode 100644 UnitTests~/Animation/LayerPruningTest/A3.anim create mode 100644 UnitTests~/Animation/LayerPruningTest/A3.anim.meta create mode 100644 UnitTests~/Animation/LayerPruningTest/AC1.controller create mode 100644 UnitTests~/Animation/LayerPruningTest/AC1.controller.meta create mode 100644 UnitTests~/Animation/LayerPruningTest/AC2.controller create mode 100644 UnitTests~/Animation/LayerPruningTest/AC2.controller.meta create mode 100644 UnitTests~/Animation/LayerPruningTest/AC3.controller create mode 100644 UnitTests~/Animation/LayerPruningTest/AC3.controller.meta diff --git a/.github/ProjectRoot/vpm-manifest-2019.json b/.github/ProjectRoot/vpm-manifest-2019.json index 33a8cf16..563ec031 100644 --- a/.github/ProjectRoot/vpm-manifest-2019.json +++ b/.github/ProjectRoot/vpm-manifest-2019.json @@ -4,7 +4,7 @@ "version": "3.4.2" }, "nadena.dev.ndmf": { - "version": "1.3.0-alpha.1" + "version": "1.3.0-alpha.2" } }, "locked": { @@ -19,7 +19,7 @@ "dependencies": {} }, "nadena.dev.ndmf": { - "version": "1.3.0-alpha.1" + "version": "1.3.0-alpha.2" } } } \ No newline at end of file diff --git a/.github/ProjectRoot/vpm-manifest-2022.json b/.github/ProjectRoot/vpm-manifest-2022.json index bcbf691b..7ea811c7 100644 --- a/.github/ProjectRoot/vpm-manifest-2022.json +++ b/.github/ProjectRoot/vpm-manifest-2022.json @@ -4,7 +4,7 @@ "version": "3.5.0" }, "nadena.dev.ndmf": { - "version": "1.3.0-alpha.1" + "version": "1.3.0-alpha.2" } }, "locked": { @@ -19,7 +19,7 @@ "dependencies": {} }, "nadena.dev.ndmf": { - "version": "1.3.0-alpha.1" + "version": "1.3.0-alpha.2" } } } \ No newline at end of file diff --git a/Editor/AnimatorMerger.cs b/Editor/AnimatorMerger.cs index 4cf331d7..a019369e 100644 --- a/Editor/AnimatorMerger.cs +++ b/Editor/AnimatorMerger.cs @@ -1,18 +1,18 @@ /* * MIT License - * + * * Copyright (c) 2022 bd_ - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -27,9 +27,11 @@ using System.Collections.Generic; using System.Linq; using nadena.dev.modular_avatar.animation; using nadena.dev.modular_avatar.editor.ErrorReporting; +using nadena.dev.ndmf.util; using UnityEditor; using UnityEditor.Animations; using UnityEngine; +using VRC.SDKBase; #if MA_VRCSDK3_AVATARS using VRC.SDK3.Avatars.Components; @@ -45,7 +47,7 @@ namespace nadena.dev.modular_avatar.core.editor private bool isSaved; private DeepClone _deepClone; - + private AnimatorOverrideController _overrideController; private List _layers = new List(); @@ -63,6 +65,8 @@ namespace nadena.dev.modular_avatar.core.editor private int controllerBaseLayer = 0; + public VRC_AnimatorLayerControl.BlendableLayer? BlendableLayer; + public AnimatorCombiner(BuildContext context, String assetName) { _combined = context.CreateAnimator(); @@ -74,12 +78,94 @@ namespace nadena.dev.modular_avatar.core.editor public AnimatorController Finish() { + PruneEmptyLayers(); + _combined.parameters = _parameters.Values.ToArray(); _combined.layers = _layers.ToArray(); return _combined; } - public void AddController(string basePath, AnimatorController controller, bool? writeDefaults, bool forceFirstLayerWeight = false) + private void PruneEmptyLayers() + { + var originalLayers = _layers; + int[] layerIndexMappings = new int[originalLayers.Count]; + + List newLayers = new List(); + + for (int i = 0; i < originalLayers.Count; i++) + { + if (i > 0 && IsEmptyLayer(originalLayers[i])) + { + layerIndexMappings[i] = -1; + } + else + { + layerIndexMappings[i] = newLayers.Count; + newLayers.Add(originalLayers[i]); + } + } + + foreach (var layer in newLayers) + { + if (layer.stateMachine == null) continue; + + foreach (var asset in layer.stateMachine.ReferencedAssets(includeScene: false)) + { + if (asset is AnimatorState alc) + { + alc.behaviours = AdjustStateBehaviors(alc.behaviours); + } + else if (asset is AnimatorStateMachine asm) + { + asm.behaviours = AdjustStateBehaviors(asm.behaviours); + } + } + } + + _layers = newLayers; + + StateMachineBehaviour[] AdjustStateBehaviors(StateMachineBehaviour[] behaviours) + { + if (behaviours.Length == 0) return behaviours; + + var newBehaviors = new List(); + foreach (var b in behaviours) + { + if (b is VRCAnimatorLayerControl alc && alc.playable == BlendableLayer) + { + int newLayer = -1; + if (alc.layer >= 0 && alc.layer < layerIndexMappings.Length) + { + newLayer = layerIndexMappings[alc.layer]; + } + + if (newLayer != -1) + { + alc.layer = newLayer; + newBehaviors.Add(alc); + } + } + else + { + newBehaviors.Add(b); + } + } + + return newBehaviors.ToArray(); + } + } + + private bool IsEmptyLayer(AnimatorControllerLayer layer) + { + if (layer.syncedLayerIndex >= 0) return false; + if (layer.avatarMask != null) return false; + + return layer.stateMachine == null + || (layer.stateMachine.states.Length == 0 && layer.stateMachine.stateMachines.Length == 0); + } + + public void AddController(string basePath, AnimatorController controller, bool? writeDefaults, + bool forceFirstLayerWeight = false) { controllerBaseLayer = _layers.Count; _cloneMap = new Dictionary(); @@ -112,7 +198,7 @@ namespace nadena.dev.modular_avatar.core.editor { _layers[_layers.Count - 1].defaultWeight = 1; } - + first = false; } } @@ -165,10 +251,10 @@ namespace nadena.dev.modular_avatar.core.editor var overrideMotion = layer.GetOverrideMotion(state); if (overrideMotion != null) { - newLayer.SetOverrideMotion((AnimatorState) _cloneMap[state], overrideMotion); + newLayer.SetOverrideMotion((AnimatorState)_cloneMap[state], overrideMotion); } - var overrideBehaviors = (StateMachineBehaviour[]) layer.GetOverrideBehaviours(state)?.Clone(); + var overrideBehaviors = (StateMachineBehaviour[])layer.GetOverrideBehaviours(state)?.Clone(); if (overrideBehaviors != null) { for (int i = 0; i < overrideBehaviors.Length; i++) @@ -177,7 +263,7 @@ namespace nadena.dev.modular_avatar.core.editor AdjustBehavior(overrideBehaviors[i]); } - newLayer.SetOverrideBehaviours((AnimatorState) _cloneMap[state], overrideBehaviors); + newLayer.SetOverrideBehaviours((AnimatorState)_cloneMap[state], overrideBehaviors); } } diff --git a/Editor/MergeAnimatorProcessor.cs b/Editor/MergeAnimatorProcessor.cs index 69a9cc57..3e70ebab 100644 --- a/Editor/MergeAnimatorProcessor.cs +++ b/Editor/MergeAnimatorProcessor.cs @@ -24,6 +24,7 @@ #if MA_VRCSDK3_AVATARS +using System; using System.Collections.Generic; using System.Linq; using nadena.dev.modular_avatar.editor.ErrorReporting; @@ -31,6 +32,7 @@ using UnityEditor; using UnityEditor.Animations; using UnityEngine; using VRC.SDK3.Avatars.Components; +using VRC.SDKBase; using Object = UnityEngine.Object; namespace nadena.dev.modular_avatar.core.editor @@ -105,20 +107,22 @@ namespace nadena.dev.modular_avatar.core.editor .ToList(); var afterOriginal = sorted.Where(x => x.layerPriority >= 0) .ToList(); - + var session = new AnimatorCombiner(context, layerType.ToString() + " (merged)"); mergeSessions[layerType] = session; + mergeSessions[layerType].BlendableLayer = BlendableLayerFor(layerType); foreach (var component in beforeOriginal) { MergeSingle(context, session, component); } - - if (defaultControllers_.TryGetValue(layerType, out var defaultController) && defaultController.layers.Length > 0) + + if (defaultControllers_.TryGetValue(layerType, out var defaultController) && + defaultController.layers.Length > 0) { session.AddController("", defaultController, null, forceFirstLayerWeight: true); } - + foreach (var component in afterOriginal) { MergeSingle(context, session, component); @@ -132,7 +136,7 @@ namespace nadena.dev.modular_avatar.core.editor { var targetObject = merge.relativePathRoot.Get(context.AvatarRootTransform); if (targetObject == null) targetObject = merge.gameObject; - + var relativePath = RuntimeUtil.RelativePath(context.AvatarRootObject, targetObject); basePath = relativePath != "" ? relativePath + "/" : ""; } @@ -140,9 +144,9 @@ namespace nadena.dev.modular_avatar.core.editor { basePath = ""; } - + bool? writeDefaults = merge.matchAvatarWriteDefaults ? writeDefaults_[merge.layerType] : null; - session.AddController(basePath, (AnimatorController) merge.animator, writeDefaults); + session.AddController(basePath, (AnimatorController)merge.animator, writeDefaults); if (merge.deleteAttachedAnimator) { @@ -155,7 +159,7 @@ namespace nadena.dev.modular_avatar.core.editor VRCAvatarDescriptor.CustomAnimLayer[] layers ) { - layers = (VRCAvatarDescriptor.CustomAnimLayer[]) layers.Clone(); + layers = (VRCAvatarDescriptor.CustomAnimLayer[])layers.Clone(); for (int i = 0; i < layers.Length; i++) { @@ -191,11 +195,24 @@ namespace nadena.dev.modular_avatar.core.editor // For non-default layers, ensure we always clone the controller for the benefit of subsequent // processing phases mergeSessions[layer.type] = new AnimatorCombiner(_context, layer.type.ToString()); + mergeSessions[layer.type].BlendableLayer = BlendableLayerFor(layer.type); mergeSessions[layer.type].AddController("", controller, null); } } } + private VRC_AnimatorLayerControl.BlendableLayer? BlendableLayerFor(VRCAvatarDescriptor.AnimLayerType layerType) + { + if (Enum.TryParse(layerType.ToString(), out VRC_AnimatorLayerControl.BlendableLayer result)) + { + return result; + } + else + { + return null; + } + } + private bool? ProbeWriteDefaults(AnimatorController controller) { bool hasWDOn = false; diff --git a/UnitTests~/Animation/LayerPruningTest.cs b/UnitTests~/Animation/LayerPruningTest.cs new file mode 100644 index 00000000..98e73671 --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using modular_avatar_tests; +using nadena.dev.modular_avatar.core.editor; +using NUnit.Framework; +using UnityEditor.Animations; +using UnityEngine; +using VRC.SDK3.Avatars.Components; + +namespace modular_avatar_tests +{ + public class LayerPruningTest : TestBase + { + [Test] + public void Test() + { + var prefab = CreatePrefab("LayerPruningTest.prefab"); + AvatarProcessor.ProcessAvatar(prefab); + + var fxController = (AnimatorController) FindFxController(prefab).animatorController; + var l0 = fxController.layers[0]; + var l1 = fxController.layers[1]; + var l2 = fxController.layers[2]; + var l3 = fxController.layers[3]; + var l3a = fxController.layers[4]; + + Assert.AreEqual("Base Layer", l0.name); + Assert.AreEqual("L1", l1.name); + Assert.AreEqual("L2", l2.name); + Assert.AreEqual("L3", l3.name); + Assert.AreEqual("L3.a", l3a.name); + + Assert.AreEqual(2, l3.stateMachine.defaultState.behaviours.Length); + Assert.AreEqual(4, ((VRCAnimatorLayerControl)l3.stateMachine.defaultState.behaviours[0]).layer); + + Assert.AreEqual(1, l3a.stateMachine.defaultState.behaviours.Length); + Assert.AreEqual(3, ((VRCAnimatorLayerControl)l3a.stateMachine.defaultState.behaviours[0]).layer); + } + } +} \ No newline at end of file diff --git a/UnitTests~/Animation/LayerPruningTest.cs.meta b/UnitTests~/Animation/LayerPruningTest.cs.meta new file mode 100644 index 00000000..85ed03cf --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8474a16b92752ef4ca5b1b103a4d5203 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitTests~/Animation/LayerPruningTest.meta b/UnitTests~/Animation/LayerPruningTest.meta new file mode 100644 index 00000000..851dadb2 --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c3179455de18eb0408d8de469bc07e1a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitTests~/Animation/LayerPruningTest.prefab b/UnitTests~/Animation/LayerPruningTest.prefab new file mode 100644 index 00000000..eb64c74f --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest.prefab @@ -0,0 +1,426 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &297507832645406391 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3768585541765473155} + - component: {fileID: 6455825992886719098} + m_Layer: 0 + m_Name: AC3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3768585541765473155 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 297507832645406391} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 218299073270739300} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6455825992886719098 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 297507832645406391} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1bb122659f724ebf85fe095ac02dc339, type: 3} + m_Name: + m_EditorClassIdentifier: + animator: {fileID: 9100000, guid: 53e7e11e88a37e74da7e4f976e83e3bc, type: 2} + layerType: 5 + deleteAttachedAnimator: 0 + pathMode: 0 + matchAvatarWriteDefaults: 0 + relativePathRoot: + referencePath: + layerPriority: 0 +--- !u!1 &2371557157035544519 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 218299073270739300} + - component: {fileID: 6245952007433778407} + - component: {fileID: 2372371832881319092} + - component: {fileID: 8080194624350802332} + m_Layer: 0 + m_Name: LayerPruningTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &218299073270739300 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2371557157035544519} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.5591636, y: 0.3612466, z: -2.6844854} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 597109336632722659} + - {fileID: 3768585541765473155} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &6245952007433778407 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2371557157035544519} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 0} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &2372371832881319092 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2371557157035544519} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 542108242, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3} + m_Name: + m_EditorClassIdentifier: + Name: + ViewPosition: {x: 0, y: 1.6, z: 0.2} + Animations: 0 + ScaleIPD: 1 + lipSync: 0 + lipSyncJawBone: {fileID: 0} + lipSyncJawClosed: {x: 0, y: 0, z: 0, w: 1} + lipSyncJawOpen: {x: 0, y: 0, z: 0, w: 1} + VisemeSkinnedMesh: {fileID: 0} + MouthOpenBlendShapeName: Facial_Blends.Jaw_Down + VisemeBlendShapes: [] + unityVersion: + portraitCameraPositionOffset: {x: 0, y: 0, z: 0} + portraitCameraRotationOffset: {x: 0, y: 1, z: 0, w: -0.00000004371139} + networkIDs: [] + customExpressions: 0 + expressionsMenu: {fileID: 0} + expressionParameters: {fileID: 0} + enableEyeLook: 0 + customEyeLookSettings: + eyeMovement: + confidence: 0.5 + excitement: 0.5 + leftEye: {fileID: 0} + rightEye: {fileID: 0} + eyesLookingStraight: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyesLookingUp: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyesLookingDown: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyesLookingLeft: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyesLookingRight: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyelidType: 0 + upperLeftEyelid: {fileID: 0} + upperRightEyelid: {fileID: 0} + lowerLeftEyelid: {fileID: 0} + lowerRightEyelid: {fileID: 0} + eyelidsDefault: + upper: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + lower: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyelidsClosed: + upper: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + lower: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyelidsLookingUp: + upper: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + lower: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyelidsLookingDown: + upper: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + lower: + linked: 1 + left: {x: 0, y: 0, z: 0, w: 0} + right: {x: 0, y: 0, z: 0, w: 0} + eyelidsSkinnedMesh: {fileID: 0} + eyelidsBlendshapes: + customizeAnimationLayers: 1 + baseAnimationLayers: + - isEnabled: 0 + type: 0 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + - isEnabled: 0 + type: 4 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + - isEnabled: 0 + type: 5 + animatorController: {fileID: 9100000, guid: 5d37144010e4244428ae76ee3f14a681, + type: 2} + mask: {fileID: 0} + isDefault: 0 + specialAnimationLayers: + - isEnabled: 0 + type: 6 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + - isEnabled: 0 + type: 7 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + - isEnabled: 0 + type: 8 + animatorController: {fileID: 0} + mask: {fileID: 0} + isDefault: 1 + AnimationPreset: {fileID: 0} + animationHashSet: [] + autoFootsteps: 1 + autoLocomotion: 1 + collider_head: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_torso: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_footR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_footL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_handR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_handL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerIndexL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerMiddleL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerRingL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerLittleL: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerIndexR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerMiddleR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerRingR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + collider_fingerLittleR: + isMirrored: 1 + state: 0 + transform: {fileID: 0} + radius: 0 + height: 0 + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} +--- !u!114 &8080194624350802332 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2371557157035544519} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -1427037861, guid: 4ecd63eff847044b68db9453ce219299, type: 3} + m_Name: + m_EditorClassIdentifier: + launchedFromSDKPipeline: 0 + completedSDKPipeline: 0 + blueprintId: + contentType: 0 + assetBundleUnityVersion: + fallbackStatus: 0 +--- !u!1 &9115810342297830269 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 597109336632722659} + - component: {fileID: 6811725640517355942} + m_Layer: 0 + m_Name: AC2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &597109336632722659 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9115810342297830269} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 218299073270739300} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6811725640517355942 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9115810342297830269} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1bb122659f724ebf85fe095ac02dc339, type: 3} + m_Name: + m_EditorClassIdentifier: + animator: {fileID: 9100000, guid: c5a35c3dbaf81404e8c6c50c18f11202, type: 2} + layerType: 5 + deleteAttachedAnimator: 0 + pathMode: 0 + matchAvatarWriteDefaults: 0 + relativePathRoot: + referencePath: + layerPriority: 0 diff --git a/UnitTests~/Animation/LayerPruningTest.prefab.meta b/UnitTests~/Animation/LayerPruningTest.prefab.meta new file mode 100644 index 00000000..8525175b --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 77564726da91f0346a2ee2e946bb5646 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitTests~/Animation/LayerPruningTest/A1.anim b/UnitTests~/Animation/LayerPruningTest/A1.anim new file mode 100644 index 00000000..5738833d --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/A1.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: A1 + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/UnitTests~/Animation/LayerPruningTest/A1.anim.meta b/UnitTests~/Animation/LayerPruningTest/A1.anim.meta new file mode 100644 index 00000000..52f9aabe --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/A1.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 00c954198f03e0545b38dd77259d9386 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitTests~/Animation/LayerPruningTest/A2.anim b/UnitTests~/Animation/LayerPruningTest/A2.anim new file mode 100644 index 00000000..d3449c73 --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/A2.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: A2 + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/UnitTests~/Animation/LayerPruningTest/A2.anim.meta b/UnitTests~/Animation/LayerPruningTest/A2.anim.meta new file mode 100644 index 00000000..dba34445 --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/A2.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 642352171c99eb54a9d43e89ad7a0abe +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitTests~/Animation/LayerPruningTest/A3.anim b/UnitTests~/Animation/LayerPruningTest/A3.anim new file mode 100644 index 00000000..38eb55b5 --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/A3.anim @@ -0,0 +1,53 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: A3 + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: [] + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/UnitTests~/Animation/LayerPruningTest/A3.anim.meta b/UnitTests~/Animation/LayerPruningTest/A3.anim.meta new file mode 100644 index 00000000..581ff6a7 --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/A3.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a8f9236c6cf1b7e4bbdd962706c12c8c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitTests~/Animation/LayerPruningTest/AC1.controller b/UnitTests~/Animation/LayerPruningTest/AC1.controller new file mode 100644 index 00000000..f2b7f3dd --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/AC1.controller @@ -0,0 +1,103 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-770484051737339598 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: [] + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 0} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AC1 + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -770484051737339598} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: L1 + m_StateMachine: {fileID: 4893700334294944578} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &4893700334294944578 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: L1 + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 7817523504018975025} + m_Position: {x: 359.0884, y: 13.900177, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 7817523504018975025} +--- !u!1102 &7817523504018975025 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: A1 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 00c954198f03e0545b38dd77259d9386, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/UnitTests~/Animation/LayerPruningTest/AC1.controller.meta b/UnitTests~/Animation/LayerPruningTest/AC1.controller.meta new file mode 100644 index 00000000..40ff95c1 --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/AC1.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d37144010e4244428ae76ee3f14a681 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitTests~/Animation/LayerPruningTest/AC2.controller b/UnitTests~/Animation/LayerPruningTest/AC2.controller new file mode 100644 index 00000000..834911fb --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/AC2.controller @@ -0,0 +1,103 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-9119924940247954802 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: A2 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 642352171c99eb54a9d43e89ad7a0abe, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &-4032435208519193477 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: L2 + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -9119924940247954802} + m_Position: {x: 347.0022, y: 244.51819, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -9119924940247954802} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AC2 + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 2004384519545651229} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: L2 + m_StateMachine: {fileID: -4032435208519193477} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &2004384519545651229 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: [] + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 0} diff --git a/UnitTests~/Animation/LayerPruningTest/AC2.controller.meta b/UnitTests~/Animation/LayerPruningTest/AC2.controller.meta new file mode 100644 index 00000000..7c39f72f --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/AC2.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c5a35c3dbaf81404e8c6c50c18f11202 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitTests~/Animation/LayerPruningTest/AC3.controller b/UnitTests~/Animation/LayerPruningTest/AC3.controller new file mode 100644 index 00000000..4df78521 --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/AC3.controller @@ -0,0 +1,241 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-6599268793956612610 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: L3 + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -4792629132175338459} + m_Position: {x: 389.72168, y: 79.74304, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -4792629132175338459} +--- !u!1107 &-6221695993386190035 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: L3_a + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 7630388764650502246} + m_Position: {x: 470, y: 50, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 7630388764650502246} +--- !u!114 &-5810767411481023895 +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: 1 + layer: 1 + goalWeight: 1 + blendDuration: 0 + debugString: +--- !u!1102 &-4792629132175338459 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: A3 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: + - {fileID: 2645212092703721488} + - {fileID: -4263003778027536188} + - {fileID: 1637143755065747004} + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: a8f9236c6cf1b7e4bbdd962706c12c8c, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!114 &-4263003778027536188 +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: 2 +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AC3 + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 5672149797109502553} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: L3 + m_StateMachine: {fileID: -6599268793956612610} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: L3.a + m_StateMachine: {fileID: -6221695993386190035} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!114 &1637143755065747004 +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: -646210727, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3} + m_Name: + m_EditorClassIdentifier: + trackingHead: 0 + trackingLeftHand: 0 + trackingRightHand: 0 + trackingHip: 0 + trackingLeftFoot: 0 + trackingRightFoot: 0 + trackingLeftFingers: 0 + trackingRightFingers: 0 + trackingEyes: 0 + trackingMouth: 0 + debugString: +--- !u!114 &2645212092703721488 +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: 1 + layer: 0 + goalWeight: 0 + blendDuration: 0 + debugString: 1 +--- !u!1107 &5672149797109502553 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: [] + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 0} +--- !u!1102 &7630388764650502246 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: A3 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: + - {fileID: -5810767411481023895} + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: a8f9236c6cf1b7e4bbdd962706c12c8c, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/UnitTests~/Animation/LayerPruningTest/AC3.controller.meta b/UnitTests~/Animation/LayerPruningTest/AC3.controller.meta new file mode 100644 index 00000000..7c1e75ec --- /dev/null +++ b/UnitTests~/Animation/LayerPruningTest/AC3.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53e7e11e88a37e74da7e4f976e83e3bc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnitTests~/BlendshapeSyncTests/BlendshapeSyncIntegrationTest.prefab b/UnitTests~/BlendshapeSyncTests/BlendshapeSyncIntegrationTest.prefab index 46e1bb93..55b1bb32 100644 --- a/UnitTests~/BlendshapeSyncTests/BlendshapeSyncIntegrationTest.prefab +++ b/UnitTests~/BlendshapeSyncTests/BlendshapeSyncIntegrationTest.prefab @@ -26,19 +26,18 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3825275463613500755} - serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0.023681391, y: 1.0559628, z: -0.6872994} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 m_Children: - {fileID: 3646968714803193661} - {fileID: 3646968713996568948} m_Father: {fileID: 0} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!95 &3825275463613500750 Animator: - serializedVersion: 5 + serializedVersion: 3 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} @@ -51,12 +50,10 @@ Animator: m_UpdateMode: 0 m_ApplyRootMotion: 0 m_LinearVelocityBlending: 0 - m_StabilizeFeet: 0 m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 - m_KeepAnimatorStateOnDisable: 0 - m_WriteDefaultValuesOnDisable: 0 + m_KeepAnimatorControllerStateOnDisable: 0 --- !u!114 &3825275463613500753 MonoBehaviour: m_ObjectHideFlags: 0 @@ -325,12 +322,40 @@ MonoBehaviour: contentType: 0 assetBundleUnityVersion: fallbackStatus: 0 +--- !u!114 &3825275463971368602 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4167925416990528462} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6fd7cab7d93b403280f2f9da978d8a4f, type: 3} + m_Name: + m_EditorClassIdentifier: + Bindings: + - ReferenceMesh: + referencePath: BaseMesh + Blendshape: shape_0 + LocalBlendshape: shape_0_local + - ReferenceMesh: + referencePath: BaseMesh + Blendshape: shape_1 + LocalBlendshape: shape_1 + - ReferenceMesh: + referencePath: MissingMesh + Blendshape: missing_mesh_shape + LocalBlendshape: missing_mesh_shape + - ReferenceMesh: + referencePath: + Blendshape: missing_mesh_shape_2 + LocalBlendshape: missing_mesh_shape_2 --- !u!1001 &3825275463173128406 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - serializedVersion: 3 m_TransformParent: {fileID: 3825275463613500751} m_Modifications: - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, @@ -429,9 +454,6 @@ PrefabInstance: value: BaseMesh objectReference: {fileID: 0} m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3} --- !u!4 &3646968714803193661 stripped Transform: @@ -444,7 +466,6 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - serializedVersion: 3 m_TransformParent: {fileID: 3825275463613500751} m_Modifications: - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, @@ -548,52 +569,16 @@ PrefabInstance: value: SyncedMesh objectReference: {fileID: 0} m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: - - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - type: 3} - insertIndex: -1 - addedObject: {fileID: 3825275463971368602} m_SourcePrefab: {fileID: 100100000, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3} ---- !u!4 &3646968713996568948 stripped -Transform: - m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - type: 3} - m_PrefabInstance: {fileID: 3825275463971368607} - m_PrefabAsset: {fileID: 0} --- !u!1 &4167925416990528462 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3} m_PrefabInstance: {fileID: 3825275463971368607} m_PrefabAsset: {fileID: 0} ---- !u!114 &3825275463971368602 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} +--- !u!4 &3646968713996568948 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, + type: 3} + m_PrefabInstance: {fileID: 3825275463971368607} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4167925416990528462} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6fd7cab7d93b403280f2f9da978d8a4f, type: 3} - m_Name: - m_EditorClassIdentifier: - Bindings: - - ReferenceMesh: - referencePath: BaseMesh - Blendshape: shape_0 - LocalBlendshape: shape_0_local - - ReferenceMesh: - referencePath: BaseMesh - Blendshape: shape_1 - LocalBlendshape: shape_1 - - ReferenceMesh: - referencePath: MissingMesh - Blendshape: missing_mesh_shape - LocalBlendshape: missing_mesh_shape - - ReferenceMesh: - referencePath: - Blendshape: missing_mesh_shape_2 - LocalBlendshape: missing_mesh_shape_2 diff --git a/UnitTests~/SyncedLayerHandling/AC1.controller b/UnitTests~/SyncedLayerHandling/AC1.controller index 77e1dd56..6307b230 100644 --- a/UnitTests~/SyncedLayerHandling/AC1.controller +++ b/UnitTests~/SyncedLayerHandling/AC1.controller @@ -82,7 +82,10 @@ AnimatorStateMachine: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Base Layer - m_ChildStates: [] + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 7429053045055472530} + m_Position: {x: 310.35324, y: 17.679626, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] @@ -92,7 +95,7 @@ AnimatorStateMachine: m_EntryPosition: {x: 50, y: 120, z: 0} m_ExitPosition: {x: 800, y: 120, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} - m_DefaultState: {fileID: 0} + m_DefaultState: {fileID: 7429053045055472530} --- !u!1102 &592244106348618204 AnimatorState: serializedVersion: 6 @@ -187,3 +190,29 @@ AnimatorStateMachine: m_ExitPosition: {x: 800, y: 120, z: 0} m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} m_DefaultState: {fileID: 3457079820388324162} +--- !u!1102 &7429053045055472530 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: New State + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 0} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/UnitTests~/TestBase.cs b/UnitTests~/TestBase.cs index b30e29d7..6ca8a22f 100644 --- a/UnitTests~/TestBase.cs +++ b/UnitTests~/TestBase.cs @@ -4,6 +4,7 @@ using System.Linq; using nadena.dev.modular_avatar.core.editor; using nadena.dev.modular_avatar.editor.ErrorReporting; using nadena.dev.ndmf; +using nadena.dev.ndmf.ui; using NUnit.Framework; using UnityEditor; using UnityEditor.Animations; @@ -41,6 +42,7 @@ namespace modular_avatar_tests } ErrorReport.Clear(); + ErrorReportWindow.DISABLE_WINDOW = true; objects = new List(); } @@ -54,6 +56,7 @@ namespace modular_avatar_tests AssetDatabase.DeleteAsset(TEMP_ASSET_PATH); FileUtil.DeleteFileOrDirectory(TEMP_ASSET_PATH); + ErrorReportWindow.DISABLE_WINDOW = false; } protected nadena.dev.ndmf.BuildContext CreateContext(GameObject root) diff --git a/package.json b/package.json index 7ec7b5c9..98b00697 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,6 @@ }, "vpmDependencies": { "com.vrchat.avatars": ">=3.2.0", - "nadena.dev.ndmf": ">=1.3.0-alpha.1 <2.0.0-a" + "nadena.dev.ndmf": ">=1.3.0-alpha.2 <2.0.0-a" } }