// App World Motion: Unity import helper. // Put this file in any "Editor" folder in your project. FBX files downloaded from App World Motion name their // looping animations with a "_loop" ending; this sets Loop Time and Loop Pose on those clips when they import. // It only changes clips you have not customised yet, so your own import settings are never overwritten. using UnityEditor; public class AppWorldMotionImport : AssetPostprocessor { void OnPreprocessAnimation() { var importer = assetImporter as ModelImporter; if (importer == null || importer.clipAnimations.Length > 0) return; // already customised: leave it alone var clips = importer.defaultClipAnimations; bool any = false; foreach (var clip in clips) { if (!clip.takeName.EndsWith("_loop")) continue; clip.loopTime = true; clip.loopPose = true; clip.name = clip.takeName.Substring(0, clip.takeName.Length - 5); any = true; } if (any) importer.clipAnimations = clips; } }