예제 #1
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);
     }
 }
예제 #2
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();
            }
        }
 public void OnEnable()
 {
   this.m_AnimationType = this.serializedObject.FindProperty("m_AnimationType");
   this.m_AvatarSource = this.serializedObject.FindProperty("m_LastHumanDescriptionAvatarSource");
   this.m_OptimizeGameObjects = this.serializedObject.FindProperty("m_OptimizeGameObjects");
   this.m_RootMotionBoneName = this.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 index = 0; index < transformPaths.Length; ++index)
     this.m_RootMotionBoneList[index] = new GUIContent(transformPaths[index]);
   if (this.m_RootMotionBoneList.Length > 0)
     this.m_RootMotionBoneList[0] = new GUIContent("None");
   this.rootIndex = ArrayUtility.FindIndex<GUIContent>(this.m_RootMotionBoneList, (Predicate<GUIContent>) (content => FileUtil.GetLastPathNameComponent(content.text) == this.m_RootMotionBoneName.stringValue));
   this.rootIndex = this.rootIndex >= 1 ? this.rootIndex : 0;
   this.m_CopyAvatar = this.serializedObject.FindProperty("m_CopyAvatar");
   this.m_LegacyGenerateAnimations = this.serializedObject.FindProperty("m_LegacyGenerateAnimations");
   this.m_AnimationCompression = this.serializedObject.FindProperty("m_AnimationCompression");
   this.m_ExposeTransformEditor.OnEnable(this.singleImporter.transformPaths, this.serializedObject);
   this.m_CanMultiEditTransformList = this.CanMultiEditTransformList();
   this.CheckIfAvatarCopyIsUpToDate();
   this.m_IsBiped = false;
   this.m_BipedMappingReport = new List<string>();
   if (this.m_AnimationType.intValue != 3)
     return;
   this.m_IsBiped = AvatarBipedMapper.IsBiped((AssetDatabase.LoadMainAssetAtPath(this.singleImporter.assetPath) as GameObject).transform, this.m_BipedMappingReport);
 }
        internal override void OnEnable()
        {
            m_AnimationType = serializedObject.FindProperty("m_AnimationType");
            m_AvatarSetup   = serializedObject.FindProperty("m_AvatarSetup");
            m_AvatarSource  = serializedObject.FindProperty("m_LastHumanDescriptionAvatarSource");

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

            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_SrcHasExtraRoot = serializedObject.FindProperty("m_HasExtraRoot");
            m_DstHasExtraRoot = serializedObject.FindProperty("m_HumanDescription.m_HasExtraRoot");

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

            m_SkinWeightsMode   = serializedObject.FindProperty("skinWeightsMode");
            m_MaxBonesPerVertex = serializedObject.FindProperty("maxBonesPerVertex");
            m_MinBoneWeight     = serializedObject.FindProperty("minBoneWeight");

            m_OptimizeGameObjects = serializedObject.FindProperty("m_OptimizeGameObjects");

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

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

            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>();

            UpdateBipedMappingReport();

            if (m_AnimationType.intValue == (int)ModelImporterAnimationType.Human && m_Avatar == null)
            {
                ResetAvatar();
            }
        }
예제 #5
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();
         }
     }
 }
		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, (GUIContent 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();
		}
        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();
                }
            }
        }