IsBiped() public static method

public static IsBiped ( Transform root, List report ) : bool
root UnityEngine.Transform
report List
return bool
Beispiel #1
0
 internal override void Apply()
 {
     MappingRelevantSettings[] sourceArray = new MappingRelevantSettings[base.targets.Length];
     for (int i = 0; i < base.targets.Length; i++)
     {
         SerializedObject   obj2      = new SerializedObject(base.targets[i]);
         SerializedProperty property  = obj2.FindProperty("m_AnimationType");
         SerializedProperty property2 = obj2.FindProperty("m_CopyAvatar");
         sourceArray[i].humanoid       = property.intValue == 3;
         sourceArray[i].hasNoAnimation = property.intValue == 0;
         sourceArray[i].copyAvatar     = property2.boolValue;
     }
     MappingRelevantSettings[] destinationArray = new MappingRelevantSettings[base.targets.Length];
     Array.Copy(sourceArray, destinationArray, base.targets.Length);
     for (int j = 0; j < base.targets.Length; j++)
     {
         if (!this.m_AnimationType.hasMultipleDifferentValues)
         {
             destinationArray[j].humanoid = this.m_AnimationType.intValue == 3;
         }
         if (!this.m_CopyAvatar.hasMultipleDifferentValues)
         {
             destinationArray[j].copyAvatar = this.m_CopyAvatar.boolValue;
         }
     }
     base.serializedObject.ApplyModifiedProperties();
     for (int k = 0; k < base.targets.Length; k++)
     {
         if (sourceArray[k].usesOwnAvatar && !destinationArray[k].usesOwnAvatar)
         {
             SerializedObject serializedObject = new SerializedObject(base.targets[k]);
             AvatarSetupTool.ClearAll(serializedObject);
             serializedObject.ApplyModifiedProperties();
         }
         if (!sourceArray[k].usesOwnAvatar && destinationArray[k].usesOwnAvatar)
         {
             ModelImporter importer = base.targets[k] as ModelImporter;
             if (sourceArray[k].hasNoAnimation)
             {
                 AssetDatabase.ImportAsset(importer.assetPath);
             }
             SerializedObject modelImporterSerializedObject = new SerializedObject(base.targets[k]);
             GameObject       original  = AssetDatabase.LoadMainAssetAtPath(importer.assetPath) as GameObject;
             Animator         component = original.GetComponent <Animator>();
             bool             flag      = (component != null) && !component.hasTransformHierarchy;
             if (flag)
             {
                 original = UnityEngine.Object.Instantiate <GameObject>(original);
                 AnimatorUtility.DeoptimizeTransformHierarchy(original);
             }
             AvatarSetupTool.AutoSetupOnInstance(original, modelImporterSerializedObject);
             this.m_IsBiped = AvatarBipedMapper.IsBiped(original.transform);
             if (flag)
             {
                 UnityEngine.Object.DestroyImmediate(original);
             }
             modelImporterSerializedObject.ApplyModifiedProperties();
         }
     }
 }
Beispiel #2
0
 public void OnEnable()
 {
     this.m_AnimationType         = base.serializedObject.FindProperty("m_AnimationType");
     this.m_AvatarSource          = base.serializedObject.FindProperty("m_LastHumanDescriptionAvatarSource");
     this.m_OptimizeGameObjects   = base.serializedObject.FindProperty("m_OptimizeGameObjects");
     this.m_RootMotionBoneName    = base.serializedObject.FindProperty("m_HumanDescription.m_RootMotionBoneName");
     this.m_ExposeTransformEditor = new ExposeTransformEditor();
     string[] transformPaths = this.singleImporter.transformPaths;
     this.m_RootMotionBoneList = new GUIContent[transformPaths.Length];
     for (int i = 0; i < transformPaths.Length; i++)
     {
         this.m_RootMotionBoneList[i] = new GUIContent(transformPaths[i]);
     }
     if (this.m_RootMotionBoneList.Length > 0)
     {
         this.m_RootMotionBoneList[0] = new GUIContent("None");
     }
     this.rootIndex    = ArrayUtility.FindIndex <GUIContent>(this.m_RootMotionBoneList, content => FileUtil.GetLastPathNameComponent(content.text) == this.m_RootMotionBoneName.stringValue);
     this.rootIndex    = (this.rootIndex >= 1) ? this.rootIndex : 0;
     this.m_CopyAvatar = base.serializedObject.FindProperty("m_CopyAvatar");
     this.m_LegacyGenerateAnimations = base.serializedObject.FindProperty("m_LegacyGenerateAnimations");
     this.m_AnimationCompression     = base.serializedObject.FindProperty("m_AnimationCompression");
     this.m_ExposeTransformEditor.OnEnable(this.singleImporter.transformPaths, base.serializedObject);
     this.m_CanMultiEditTransformList = this.CanMultiEditTransformList();
     this.CheckIfAvatarCopyIsUpToDate();
     this.m_IsBiped = false;
     if (this.m_AnimationType.intValue == 3)
     {
         GameObject obj2 = AssetDatabase.LoadMainAssetAtPath(this.singleImporter.assetPath) as GameObject;
         this.m_IsBiped = AvatarBipedMapper.IsBiped(obj2.transform);
     }
 }
 internal override void Apply()
 {
     ModelImporterRigEditor.MappingRelevantSettings[] array = new ModelImporterRigEditor.MappingRelevantSettings[base.targets.Length];
     for (int i = 0; i < base.targets.Length; i++)
     {
         SerializedObject   serializedObject    = new SerializedObject(base.targets[i]);
         SerializedProperty serializedProperty  = serializedObject.FindProperty("m_AnimationType");
         SerializedProperty serializedProperty2 = serializedObject.FindProperty("m_CopyAvatar");
         array[i].humanoid       = (serializedProperty.intValue == 3);
         array[i].hasNoAnimation = (serializedProperty.intValue == 0);
         array[i].copyAvatar     = serializedProperty2.boolValue;
     }
     ModelImporterRigEditor.MappingRelevantSettings[] array2 = new ModelImporterRigEditor.MappingRelevantSettings[base.targets.Length];
     Array.Copy(array, array2, base.targets.Length);
     for (int j = 0; j < base.targets.Length; j++)
     {
         if (!this.m_AnimationType.hasMultipleDifferentValues)
         {
             array2[j].humanoid = (this.m_AnimationType.intValue == 3);
         }
         if (!this.m_CopyAvatar.hasMultipleDifferentValues)
         {
             array2[j].copyAvatar = this.m_CopyAvatar.boolValue;
         }
     }
     base.serializedObject.ApplyModifiedProperties();
     for (int k = 0; k < base.targets.Length; k++)
     {
         if (array[k].usesOwnAvatar && !array2[k].usesOwnAvatar)
         {
             SerializedObject serializedObject2 = new SerializedObject(base.targets[k]);
             AvatarSetupTool.ClearAll(serializedObject2);
             serializedObject2.ApplyModifiedProperties();
         }
         if (!array[k].usesOwnAvatar && array2[k].usesOwnAvatar)
         {
             ModelImporter modelImporter = base.targets[k] as ModelImporter;
             if (array[k].hasNoAnimation)
             {
                 AssetDatabase.ImportAsset(modelImporter.assetPath);
             }
             SerializedObject serializedObject3 = new SerializedObject(base.targets[k]);
             GameObject       gameObject        = AssetDatabase.LoadMainAssetAtPath(modelImporter.assetPath) as GameObject;
             Animator         component         = gameObject.GetComponent <Animator>();
             bool             flag = component && !component.hasTransformHierarchy;
             if (flag)
             {
                 gameObject = UnityEngine.Object.Instantiate <GameObject>(gameObject);
                 AnimatorUtility.DeoptimizeTransformHierarchy(gameObject);
             }
             AvatarSetupTool.AutoSetupOnInstance(gameObject, serializedObject3);
             this.m_IsBiped = AvatarBipedMapper.IsBiped(gameObject.transform, this.m_BipedMappingReport);
             if (flag)
             {
                 UnityEngine.Object.DestroyImmediate(gameObject);
             }
             serializedObject3.ApplyModifiedProperties();
         }
     }
 }
        protected void Init()
        {
            if (gameObject == null)
            {
                return;
            }

            m_HumanBoneArray = serializedObject.FindProperty("m_HumanDescription.m_Human");
            m_Skeleton       = serializedObject.FindProperty("m_HumanDescription.m_Skeleton");

            m_IsBiped = AvatarBipedMapper.IsBiped(gameObject.transform, null);

            // Handle human bones
            if (m_Bones == null)
            {
                m_Bones = AvatarSetupTool.GetHumanBones(m_HumanBoneArray, modelBones);
            }
            ValidateMapping();

            if (m_CurrentTransformEditor != null)
            {
                DestroyImmediate(m_CurrentTransformEditor);
                m_CurrentTransformEditor = null;
            }
            m_CurrentTransformEditorFoldout = true;
            m_HasSkinnedMesh = (gameObject.GetComponentInChildren <SkinnedMeshRenderer>() != null);

            // Handle pose
            InitPose();

            // Repaint
            SceneView.RepaintAll();
        }
Beispiel #5
0
 internal override void Apply()
 {
     ModelImporterRigEditor.MappingRelevantSettings[] relevantSettingsArray1 = new ModelImporterRigEditor.MappingRelevantSettings[this.targets.Length];
     for (int index = 0; index < this.targets.Length; ++index)
     {
         SerializedObject   serializedObject = new SerializedObject(this.targets[index]);
         SerializedProperty property1        = serializedObject.FindProperty("m_AnimationType");
         SerializedProperty property2        = serializedObject.FindProperty("m_CopyAvatar");
         relevantSettingsArray1[index].humanoid       = property1.intValue == 3;
         relevantSettingsArray1[index].hasNoAnimation = property1.intValue == 0;
         relevantSettingsArray1[index].copyAvatar     = property2.boolValue;
     }
     ModelImporterRigEditor.MappingRelevantSettings[] relevantSettingsArray2 = new ModelImporterRigEditor.MappingRelevantSettings[this.targets.Length];
     Array.Copy((Array)relevantSettingsArray1, (Array)relevantSettingsArray2, this.targets.Length);
     for (int index = 0; index < this.targets.Length; ++index)
     {
         if (!this.m_AnimationType.hasMultipleDifferentValues)
         {
             relevantSettingsArray2[index].humanoid = this.m_AnimationType.intValue == 3;
         }
         if (!this.m_CopyAvatar.hasMultipleDifferentValues)
         {
             relevantSettingsArray2[index].copyAvatar = this.m_CopyAvatar.boolValue;
         }
     }
     this.serializedObject.ApplyModifiedProperties();
     for (int index = 0; index < this.targets.Length; ++index)
     {
         if (relevantSettingsArray1[index].usesOwnAvatar && !relevantSettingsArray2[index].usesOwnAvatar)
         {
             SerializedObject serializedObject = new SerializedObject(this.targets[index]);
             AvatarSetupTool.ClearAll(serializedObject);
             serializedObject.ApplyModifiedProperties();
         }
         if (!relevantSettingsArray1[index].usesOwnAvatar && relevantSettingsArray2[index].usesOwnAvatar)
         {
             ModelImporter target = this.targets[index] as ModelImporter;
             if (relevantSettingsArray1[index].hasNoAnimation)
             {
                 AssetDatabase.ImportAsset(target.assetPath);
             }
             SerializedObject modelImporterSerializedObject = new SerializedObject(this.targets[index]);
             GameObject       gameObject = AssetDatabase.LoadMainAssetAtPath(target.assetPath) as GameObject;
             Animator         component  = gameObject.GetComponent <Animator>();
             bool             flag       = (bool)((UnityEngine.Object)component) && !component.hasTransformHierarchy;
             if (flag)
             {
                 gameObject = UnityEngine.Object.Instantiate <GameObject>(gameObject);
                 AnimatorUtility.DeoptimizeTransformHierarchy(gameObject);
             }
             AvatarSetupTool.AutoSetupOnInstance(gameObject, modelImporterSerializedObject);
             this.m_IsBiped = AvatarBipedMapper.IsBiped(gameObject.transform, this.m_BipedMappingReport);
             if (flag)
             {
                 UnityEngine.Object.DestroyImmediate((UnityEngine.Object)gameObject);
             }
             modelImporterSerializedObject.ApplyModifiedProperties();
         }
     }
 }
 protected void Init()
 {
     if (!(base.gameObject == null))
     {
         if (AvatarSetupTool.sHumanParent.Length != HumanTrait.BoneCount)
         {
             throw new Exception("Avatar's Human parent list is out of sync");
         }
         this.m_IsBiped = AvatarBipedMapper.IsBiped(base.gameObject.transform, null);
         if (this.m_Bones == null)
         {
             this.m_Bones = AvatarSetupTool.GetHumanBones(base.serializedObject, base.modelBones);
         }
         this.ValidateMapping();
         if (this.m_CurrentTransformEditor != null)
         {
             UnityEngine.Object.DestroyImmediate(this.m_CurrentTransformEditor);
             this.m_CurrentTransformEditor = null;
         }
         this.m_CurrentTransformEditorFoldout = true;
         this.m_HasSkinnedMesh = (base.gameObject.GetComponentInChildren <SkinnedMeshRenderer>() != null);
         this.InitPose();
         SceneView.RepaintAll();
     }
 }
Beispiel #7
0
 private void UpdateBipedMappingReport()
 {
     if (m_AnimationType.intValue == (int)ModelImporterAnimationType.Human)
     {
         GameObject go = assetTarget as GameObject;
         if (go != null)
         {
             m_IsBiped = AvatarBipedMapper.IsBiped(go.transform, m_BipedMappingReport);
         }
     }
 }
Beispiel #8
0
 internal override void OnEnable()
 {
     this.m_AnimationType          = base.serializedObject.FindProperty("m_AnimationType");
     this.m_AvatarSource           = base.serializedObject.FindProperty("m_LastHumanDescriptionAvatarSource");
     this.m_OptimizeGameObjects    = base.serializedObject.FindProperty("m_OptimizeGameObjects");
     this.m_RootMotionBoneName     = base.serializedObject.FindProperty("m_HumanDescription.m_RootMotionBoneName");
     this.m_RootMotionBoneRotation = base.serializedObject.FindProperty("m_HumanDescription.m_RootMotionBoneRotation");
     this.m_ExposeTransformEditor  = new ExposeTransformEditor();
     string[] transformPaths = this.singleImporter.transformPaths;
     this.m_RootMotionBoneList = new GUIContent[transformPaths.Length];
     for (int i = 0; i < transformPaths.Length; i++)
     {
         this.m_RootMotionBoneList[i] = new GUIContent(transformPaths[i]);
     }
     if (this.m_RootMotionBoneList.Length > 0)
     {
         this.m_RootMotionBoneList[0] = EditorGUIUtility.TrTextContent("None", null, null);
     }
     this.rootIndex                  = ArrayUtility.FindIndex <GUIContent>(this.m_RootMotionBoneList, (GUIContent content) => FileUtil.GetLastPathNameComponent(content.text) == this.m_RootMotionBoneName.stringValue);
     this.rootIndex                  = ((this.rootIndex >= 1) ? this.rootIndex : 0);
     this.m_SrcHasExtraRoot          = base.serializedObject.FindProperty("m_HasExtraRoot");
     this.m_DstHasExtraRoot          = base.serializedObject.FindProperty("m_HumanDescription.m_HasExtraRoot");
     this.m_CopyAvatar               = base.serializedObject.FindProperty("m_CopyAvatar");
     this.m_LegacyGenerateAnimations = base.serializedObject.FindProperty("m_LegacyGenerateAnimations");
     this.m_AnimationCompression     = base.serializedObject.FindProperty("m_AnimationCompression");
     this.m_RigImportErrors          = base.serializedObject.FindProperty("m_RigImportErrors");
     this.m_RigImportWarnings        = base.serializedObject.FindProperty("m_RigImportWarnings");
     this.m_ExposeTransformEditor.OnEnable(this.singleImporter.transformPaths, base.serializedObject);
     this.m_CanMultiEditTransformList = this.CanMultiEditTransformList();
     this.CheckIfAvatarCopyIsUpToDate();
     this.m_IsBiped            = false;
     this.m_BipedMappingReport = new List <string>();
     if (this.m_AnimationType.intValue == 3)
     {
         GameObject gameObject = base.assetTarget as GameObject;
         if (gameObject != null)
         {
             this.m_IsBiped = AvatarBipedMapper.IsBiped(gameObject.transform, this.m_BipedMappingReport);
         }
         if (this.m_Avatar == null)
         {
             this.ResetAvatar();
         }
     }
 }
Beispiel #9
0
 protected void Init()
 {
     if (base.gameObject == null)
     {
         return;
     }
     this.m_IsBiped = AvatarBipedMapper.IsBiped(base.gameObject.transform, null);
     if (this.m_Bones == null)
     {
         this.m_Bones = AvatarSetupTool.GetHumanBones(base.serializedObject, base.modelBones);
     }
     this.ValidateMapping();
     if (this.m_CurrentTransformEditor != null)
     {
         UnityEngine.Object.DestroyImmediate(this.m_CurrentTransformEditor);
         this.m_CurrentTransformEditor = null;
     }
     this.m_CurrentTransformEditorFoldout = true;
     this.m_HasSkinnedMesh = (base.gameObject.GetComponentInChildren <SkinnedMeshRenderer>() != null);
     this.InitPose();
     SceneView.RepaintAll();
 }
 internal override void PostApply()
 {
     for (int i = 0; i < base.targets.Length; i++)
     {
         if (this.oldModelSettings[i].usesOwnAvatar && !this.newModelSettings[i].usesOwnAvatar && !this.newModelSettings[i].copyAvatar)
         {
             SerializedObject serializedObject = new SerializedObject(base.targets[i]);
             AvatarSetupTool.ClearAll(serializedObject);
             serializedObject.ApplyModifiedPropertiesWithoutUndo();
         }
         if (!this.m_CopyAvatar.boolValue && !this.newModelSettings[i].humanoid && this.rootIndex > 0)
         {
             ModelImporter modelImporter = base.targets[i] as ModelImporter;
             GameObject    gameObject    = AssetDatabase.LoadMainAssetAtPath(modelImporter.assetPath) as GameObject;
             Animator      component     = gameObject.GetComponent <Animator>();
             bool          flag          = component && !component.hasTransformHierarchy;
             if (flag)
             {
                 gameObject = (this.Instantiate(gameObject) as GameObject);
                 AnimatorUtility.DeoptimizeTransformHierarchy(gameObject);
             }
             Transform transform = gameObject.transform.Find(this.m_RootMotionBoneList[this.rootIndex].text);
             if (transform != null)
             {
                 this.m_RootMotionBoneRotation.quaternionValue = transform.rotation;
             }
             SerializedObject serializedObject2 = new SerializedObject(base.targets[i]);
             serializedObject2.ApplyModifiedPropertiesWithoutUndo();
             if (flag)
             {
                 this.DestroyImmediate(gameObject);
             }
         }
         if (!this.oldModelSettings[i].usesOwnAvatar && this.newModelSettings[i].usesOwnAvatar)
         {
             ModelImporter modelImporter2 = base.targets[i] as ModelImporter;
             if (this.oldModelSettings[i].hasNoAnimation)
             {
                 ModelImporterAnimationType animationType = modelImporter2.animationType;
                 modelImporter2.animationType = ModelImporterAnimationType.Generic;
                 AssetDatabase.ImportAsset(modelImporter2.assetPath);
                 modelImporter2.animationType = animationType;
             }
             SerializedObject serializedObject3 = new SerializedObject(base.targets[i]);
             GameObject       gameObject2       = AssetDatabase.LoadMainAssetAtPath(modelImporter2.assetPath) as GameObject;
             Animator         component2        = gameObject2.GetComponent <Animator>();
             bool             flag2             = component2 && !component2.hasTransformHierarchy;
             if (flag2)
             {
                 gameObject2 = (this.Instantiate(gameObject2) as GameObject);
                 AnimatorUtility.DeoptimizeTransformHierarchy(gameObject2);
             }
             AvatarSetupTool.AutoSetupOnInstance(gameObject2, serializedObject3);
             this.m_IsBiped = AvatarBipedMapper.IsBiped(gameObject2.transform, this.m_BipedMappingReport);
             if (flag2)
             {
                 this.DestroyImmediate(gameObject2);
             }
             serializedObject3.ApplyModifiedPropertiesWithoutUndo();
         }
     }
     this.oldModelSettings = null;
     this.newModelSettings = null;
 }
        internal override void PostApply()
        {
            // But we might not be done yet!
            // For all models which did not have own humanoid before but should have it now,
            // we need to perform auto-mapping. (For the opposite case we also need to clear the mapping.)
            // Iterate through all the models...
            for (int i = 0; i < targets.Length; i++)
            {
                // If this model had its own humanoid avatar before but shouldn't have it now...
                if (oldModelSettings[i].usesOwnAvatar && !newModelSettings[i].usesOwnAvatar && !newModelSettings[i].copyAvatar)
                {
                    // ...then clear auto-setup on this model.
                    SerializedObject so = new SerializedObject(targets[i]);
                    AvatarSetupTool.ClearAll(so);
                    so.ApplyModifiedPropertiesWithoutUndo();
                }

                if (!m_CopyAvatar.boolValue && !newModelSettings[i].humanoid && rootIndex > 0)
                {
                    ModelImporter importer = targets[i] as ModelImporter;

                    GameObject go = AssetDatabase.LoadMainAssetAtPath(importer.assetPath) as GameObject;
                    // The character could be optimized right now
                    // 'm_OptimizeGameObjects' can't be used to tell if it is optimized, because the user can change this value from UI,
                    // and the change hasn't been applied yet.
                    Animator animator             = go.GetComponent <Animator>();
                    bool     noTransformHierarchy = animator && !animator.hasTransformHierarchy;
                    if (noTransformHierarchy)
                    {
                        go = Instantiate(go) as GameObject;
                        AnimatorUtility.DeoptimizeTransformHierarchy(go);
                    }

                    SerializedObject so = new SerializedObject(targets[i]);
                    so.ApplyModifiedPropertiesWithoutUndo();

                    if (noTransformHierarchy)
                    {
                        DestroyImmediate(go);
                    }
                }

                // If this model should have its own humanoid avatar before and didn't have it before,
                // then we need to perform auto-mapping.
                if (!oldModelSettings[i].usesOwnAvatar && newModelSettings[i].usesOwnAvatar)
                {
                    ModelImporter importer = targets[i] as ModelImporter;
                    // Special case if the model didn't have animation before...
                    if (oldModelSettings[i].hasNoAnimation && assetTargets[i] != null)
                    {
                        // We have to do an extra import first, before the automapping works.
                        // Because the model doesn't have any skinned meshes when it was last imported with
                        // Animation Mode: None. And the auro-mapping relies on information in the skinned meshes.
                        var targetAnimationType = importer.animationType;
                        importer.animationType = ModelImporterAnimationType.Generic; // we dont want to build humanoid here, since it will generate errors.
                        AssetDatabase.ImportAsset(importer.assetPath);
                        importer.animationType = targetAnimationType;
                    }

                    // Perform auto-setup on this model.
                    SerializedObject so = new SerializedObject(targets[i]);
                    GameObject       go = assetTargets[i] as GameObject;
                    // The character could be optimized right now
                    // 'm_OptimizeGameObjects' can't be used to tell if it is optimized, because the user can change this value from UI,
                    // and the change hasn't been applied yet.
                    if (go != null)
                    {
                        Animator animator             = go.GetComponent <Animator>();
                        bool     noTransformHierarchy = animator && !animator.hasTransformHierarchy;
                        if (noTransformHierarchy)
                        {
                            go = Instantiate(go) as GameObject;
                            AnimatorUtility.DeoptimizeTransformHierarchy(go);
                        }
                        AvatarSetupTool.AutoSetupOnInstance(go, so);
                        m_IsBiped = AvatarBipedMapper.IsBiped(go.transform, m_BipedMappingReport);

                        if (noTransformHierarchy)
                        {
                            DestroyImmediate(go);
                        }
                    }

                    so.ApplyModifiedPropertiesWithoutUndo();
                }
            }

            oldModelSettings = null;
            newModelSettings = null;
        }
        internal override void OnEnable()
        {
            m_AnimationType       = serializedObject.FindProperty("m_AnimationType");
            m_AvatarSource        = serializedObject.FindProperty("m_LastHumanDescriptionAvatarSource");
            m_OptimizeGameObjects = serializedObject.FindProperty("m_OptimizeGameObjects");

            // Generic bone setup
            m_RootMotionBoneName     = serializedObject.FindProperty("m_HumanDescription.m_RootMotionBoneName");
            m_RootMotionBoneRotation = serializedObject.FindProperty("m_HumanDescription.m_RootMotionBoneRotation");

            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");
            }

            rootIndex = ArrayUtility.FindIndex(m_RootMotionBoneList, delegate(GUIContent content) { return(FileUtil.GetLastPathNameComponent(content.text) == m_RootMotionBoneName.stringValue); });
            rootIndex = rootIndex < 1 ? 0 : rootIndex;

            m_SrcHasExtraRoot = serializedObject.FindProperty("m_HasExtraRoot");
            m_DstHasExtraRoot = serializedObject.FindProperty("m_HumanDescription.m_HasExtraRoot");

            // Animation
            m_CopyAvatar = serializedObject.FindProperty("m_CopyAvatar");
            m_LegacyGenerateAnimations = serializedObject.FindProperty("m_LegacyGenerateAnimations");
            m_AnimationCompression     = serializedObject.FindProperty("m_AnimationCompression");

            m_RigImportErrors   = serializedObject.FindProperty("m_RigImportErrors");
            m_RigImportWarnings = serializedObject.FindProperty("m_RigImportWarnings");

            m_ExposeTransformEditor.OnEnable(singleImporter.transformPaths, serializedObject);

            m_CanMultiEditTransformList = CanMultiEditTransformList();

            // Check if avatar definition is same as the one it's copied from
            CheckIfAvatarCopyIsUpToDate();

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

            if (m_AnimationType.intValue == (int)ModelImporterAnimationType.Human)
            {
                GameObject go = assetTarget as GameObject;
                if (go != null)
                {
                    m_IsBiped = AvatarBipedMapper.IsBiped(go.transform, m_BipedMappingReport);
                }

                if (m_Avatar == null)
                {
                    ResetAvatar();
                }
            }
        }