Exemplo n.º 1
0
        internal override void OnEnable()
        {
            Editor.AssignCachedProperties(this, serializedObject.GetIterator());

            m_ExposeTransformEditor = new ExposeTransformEditor();

            string[] transformPaths = singleImporter.transformPaths;
            m_RootMotionBoneList = new GUIContent[transformPaths.Length];
            for (int i = 0; i < transformPaths.Length; i++)
            {
                m_RootMotionBoneList[i] = new GUIContent(transformPaths[i]);
            }

            if (m_RootMotionBoneList.Length > 0)
            {
                m_RootMotionBoneList[0] = EditorGUIUtility.TrTextContent("None");
            }

            m_ExposeTransformEditor.OnEnable(singleImporter.transformPaths, serializedObject);

            m_CanMultiEditTransformList = CanMultiEditTransformList();

            m_IsBiped            = false;
            m_BipedMappingReport = new List <string>();

            UpdateBipedMappingReport();

            if (m_AnimationType.intValue == (int)ModelImporterAnimationType.Human && m_Avatar == null)
            {
                ResetAvatar();
            }
        }
Exemplo n.º 2
0
        internal override void OnEnable()
        {
            Editor.AssignCachedProperties(this, serializedObject.GetIterator());

            if (serializedObject.isEditingMultipleObjects)
            {
                return;
            }

            // Find all serialized property before calling SetupDefaultClips
            if (m_ClipAnimations.arraySize == 0)
            {
                SetupDefaultClips();
            }
            UpdateList();

            selectedClipIndex = EditorPrefs.GetInt("ModelImporterClipEditor.ActiveClipIndex", 0);
            EditorPrefs.SetInt("ModelImporterClipEditor.ActiveClipIndex", selectedClipIndex);

            // Automatically select the first clip
            if (m_ClipAnimations.arraySize != 0)
            {
                SelectClip(selectedClipIndex);
            }

            string[] transformPaths = singleImporter.transformPaths;
            m_MotionNodeList = new GUIContent[transformPaths.Length + 1];

            m_MotionNodeList[0] = EditorGUIUtility.TrTextContent("<None>");

            for (int i = 0; i < transformPaths.Length; i++)
            {
                if (i == 0)
                {
                    m_MotionNodeList[1] = EditorGUIUtility.TrTextContent("<Root Transform>");
                }
                else
                {
                    m_MotionNodeList[i + 1] = new GUIContent(transformPaths[i]);
                }
            }

            motionNodeIndex = ArrayUtility.FindIndex(m_MotionNodeList, delegate(GUIContent content) { return(content.text == m_MotionNodeName.stringValue); });
            motionNodeIndex = motionNodeIndex < 1 ? 0 : motionNodeIndex;

            // caching errors values now as they can't change until next re-import that will triggers a new OnEnable
            m_Errors           = m_AnimationImportErrors.stringValue;
            m_Warnings         = m_AnimationImportWarnings.stringValue;
            m_RigWarnings      = m_RigImportWarnings.stringValue;
            m_RetargetWarnings = m_AnimationRetargetingWarnings.stringValue;
        }
Exemplo n.º 3
0
        internal override void OnEnable()
        {
            Editor.AssignCachedProperties(this, serializedObject.GetIterator());

            // caching errors values now as they can't change until next re-import that will triggers a new OnEnable
            m_Errors           = m_AnimationImportErrors.stringValue;
            m_Warnings         = m_AnimationImportWarnings.stringValue;
            m_RigWarnings      = m_RigImportWarnings.stringValue;
            m_RetargetWarnings = m_AnimationRetargetingWarnings.stringValue;

            RegisterListeners();

            if (serializedObject.isEditingMultipleObjects)
            {
                return;
            }

            //Sometimes we dont want to start at the 0th index, this is where we're editing a clip - see
            m_ClipList.index = EditorPrefs.GetInt(ActiveClipIndex, 0);
            EditorPrefs.SetInt(ActiveClipIndex, m_ClipList.index);
            //Reset the Model Importer to its serialized copy
            DeserializeClips();

            string[] transformPaths = singleImporter.transformPaths;
            m_MotionNodeList = new GUIContent[transformPaths.Length + 1];

            m_MotionNodeList[0] = EditorGUIUtility.TrTextContent("<None>");
            if (m_MotionNodeList.Length > 1)
            {
                m_MotionNodeList[1] = EditorGUIUtility.TrTextContent("<Root Transform>");
            }

            for (int i = 1; i < transformPaths.Length; i++)
            {
                m_MotionNodeList[i + 1] = new GUIContent(transformPaths[i]);
            }

            motionNodeIndex = ArrayUtility.FindIndex(m_MotionNodeList, delegate(GUIContent content) { return(content.text == m_MotionNodeName.stringValue); });
            motionNodeIndex = motionNodeIndex < 1 ? 0 : motionNodeIndex;
        }
Exemplo n.º 4
0
 internal override void OnEnable()
 {
     Editor.AssignCachedProperties(this, serializedObject.GetIterator());
 }
Exemplo n.º 5
0
 public AnimationClipInfoProperties(SerializedProperty prop)
 {
     m_Property = prop;
     Editor.AssignCachedProperties(this, prop);
 }