コード例 #1
0
        void OnPreprocessModel()
        {
            AnimationClipPreprocessorSettings ais = AnimationClipPreprocessorSettings.FindParentSettings(assetPath);

            if (ais == null)
            {
                return;
            }

            ModelImporter modelImporter = assetImporter as ModelImporter;

            modelImporter.importAnimation        = true;
            modelImporter.resampleCurves         = true;
            modelImporter.animationCompression   = ModelImporterAnimationCompression.KeyframeReduction;
            modelImporter.animationRotationError = ais.rotationError;
            modelImporter.animationPositionError = ais.positionError;
            modelImporter.animationScaleError    = ais.scaleError;
            modelImporter.animationType          = ModelImporterAnimationType.Generic;
            if (ais.defaultAvatar != null)
            {
                modelImporter.sourceAvatar = ais.defaultAvatar;
            }

            modelImporter.importMaterials = ais.importMaterials;
        }
コード例 #2
0
        void OnPostprocessAnimation(GameObject go, AnimationClip clip)
        {
            Debug.Log("Post anim: " + clip.name + " in " + assetPath);
            AnimationClipPreprocessorSettings ais = AnimationClipPreprocessorSettings.FindParentSettings(assetPath);

            if (ais == null)
            {
                return;
            }

            //AnimationClip clipCopy =
            CreateCopyWithDefaultEvents(clip, ais);
        }