private static ModelImporterClipAnimation[] GetImportedAnimationClips(ModelImporterClipAnimation[] animations,
                                                                       ModelImportData modelImportData)
 {
     for (var index = 0; index < animations.Length; index++)
     {
         var animationData = modelImportData.GetAnimationData(animations[index].name);
         animations[index].loopTime = animationData.LoopTime;
         animations[index].loopPose = animationData.LoopPose;
     }
     return(animations);
 }
Exemplo n.º 2
0
        private static void DrawAnimationSettings(ModelImportData mid,
                                                  ModelImportData.AnimationData animation)
        {
            var animationData = mid.GetAnimationData(animation.Name);

            EditorGUILayout.LabelField("Loop", EditorStyles.miniLabel, GUILayout.Width(25));
            animation.LoopTime = animationData.LoopTime = EditorGUILayout.Toggle(animationData.LoopTime,
                                                                                 GUILayout.Width(16));
            EditorGUILayout.LabelField("Loop blend", EditorStyles.miniLabel, GUILayout.Width(53));
            animation.LoopPose = animationData.LoopPose = EditorGUILayout.Toggle(animationData.LoopPose,
                                                                                 GUILayout.Width(16));
            EditorGUILayout.LabelField("Default", EditorStyles.miniLabel, GUILayout.Width(36));
            animation.Default = animationData.Default = EditorGUILayout.Toggle(animationData.Default,
                                                                               GUILayout.Width(16));
        }
        private List <AnimationView> LoadAnimations()
        {
            var assets     = AssetDatabase.LoadAllAssetsAtPath(_path);
            var animations = new List <AnimationView>();

            for (var index = 0; index < assets.Length; index++)
            {
                var animation = assets[index] as AnimationClip;
                if (animation != null && !animation.name.Contains("__preview__"))
                {
                    animations.Add(new AnimationView()
                    {
                        Animation             = animation,
                        AnimationClipSettings = AnimationUtility.GetAnimationClipSettings(animation),
                        Checked = true,
                        Default = _mid.GetAnimationData(animation.name).Default,
                    });
                }
            }
            return(animations);
        }