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