From 6f91bcd3f443ba812891b9867fa8cd514867cd63 Mon Sep 17 00:00:00 2001 From: Starke Date: Thu, 9 Sep 2021 01:03:51 +0200 Subject: [PATCH] update --- .gitignore | 20 +++++++++---------- .../DataProcessing/Modules/ContactModule.cs | 14 ++++++++++--- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 1f1e61710..a23a1229b 100644 --- a/.gitignore +++ b/.gitignore @@ -32,16 +32,16 @@ AI4Animation/SIGGRAPH_Asia_2019/Unity/UIElementsSchema AI4Animation/SIGGRAPH_Asia_2019/Unity/Logs AI4Animation/SIGGRAPH_Asia_2019/Unity/Packages -AI4Animation/SIGGRAPH_Asia_2020/Unity/[Ll]ibrary/ -AI4Animation/SIGGRAPH_Asia_2020/Unity/[Tt]emp/ -AI4Animation/SIGGRAPH_Asia_2020/Unity/[Oo]bj/ -AI4Animation/SIGGRAPH_Asia_2020/Unity/[Bb]uild/ -AI4Animation/SIGGRAPH_Asia_2020/Unity/[Bb]uilds/ -AI4Animation/SIGGRAPH_Asia_2020/Unity/Assets/AssetStoreTools* -AI4Animation/SIGGRAPH_Asia_2020/Unity/PATCH/ -AI4Animation/SIGGRAPH_Asia_2020/Unity/UIElementsSchema -AI4Animation/SIGGRAPH_Asia_2020/Unity/Logs -AI4Animation/SIGGRAPH_Asia_2020/Unity/Packages +AI4Animation/SIGGRAPH_2020/Unity/[Ll]ibrary/ +AI4Animation/SIGGRAPH_2020/Unity/[Tt]emp/ +AI4Animation/SIGGRAPH_2020/Unity/[Oo]bj/ +AI4Animation/SIGGRAPH_2020/Unity/[Bb]uild/ +AI4Animation/SIGGRAPH_2020/Unity/[Bb]uilds/ +AI4Animation/SIGGRAPH_2020/Unity/Assets/AssetStoreTools* +AI4Animation/SIGGRAPH_2020/Unity/PATCH/ +AI4Animation/SIGGRAPH_2020/Unity/UIElementsSchema +AI4Animation/SIGGRAPH_2020/Unity/Logs +AI4Animation/SIGGRAPH_2020/Unity/Packages # Autogenerated VS/MD/Consulo solution and project files diff --git a/AI4Animation/SIGGRAPH_2020/Unity/Assets/Scripts/DataProcessing/Modules/ContactModule.cs b/AI4Animation/SIGGRAPH_2020/Unity/Assets/Scripts/DataProcessing/Modules/ContactModule.cs index c274765ff..d7f179a7b 100644 --- a/AI4Animation/SIGGRAPH_2020/Unity/Assets/Scripts/DataProcessing/Modules/ContactModule.cs +++ b/AI4Animation/SIGGRAPH_2020/Unity/Assets/Scripts/DataProcessing/Modules/ContactModule.cs @@ -389,13 +389,21 @@ public float GetContact(Frame frame, bool mirrored) { return Contacts[frame.Index-1]; } if(MirrorSensor == null) { - MirrorSensor = Module.GetSensor(Module.Data.Source.Bones[Module.Data.Symmetry[Module.Data.Source.FindBone(ID).Index]].Name); + MotionData.Hierarchy.Bone bone = Module.Data.Source.FindBone(ID); + if(bone != null) { + MirrorSensor = Module.GetSensor(Module.Data.Source.Bones[Module.Data.Symmetry[bone.Index]].Name); + } } return MirrorSensor == null ? 0f : MirrorSensor.Contacts[frame.Index-1]; } public void SetName(string name) { - ID = name; + if(ID != name) { + ID = name; + foreach(Sensor s in Module.Sensors) { + s.MirrorSensor = null; + } + } } public void SetBone(int index, int bone) { @@ -471,7 +479,7 @@ public void Inspector(MotionEditor editor) { if(Utility.GUIButton("+", UltiDraw.DarkGrey, UltiDraw.White, 20f, 20f)) { AddBone(0); } - EditorGUILayout.LabelField("Name", GUILayout.Width(40f)); + EditorGUILayout.LabelField("Group", GUILayout.Width(40f)); SetName(EditorGUILayout.TextField(ID, GUILayout.Width(100f))); EditorGUILayout.LabelField("Mask", GUILayout.Width(40)); Mask = InternalEditorUtility.ConcatenatedLayersMaskToLayerMask(EditorGUILayout.MaskField(InternalEditorUtility.LayerMaskToConcatenatedLayersMask(Mask), InternalEditorUtility.layers, GUILayout.Width(100f)));