public static void ExtractAnCompressClipsFromFBX() { AnimationClip[] extractClips = ExtractClipsFromFBX(); if (extractClips != null && extractClips.Length > 0) { var clipInfos = (from clip in extractClips let clipAssetPath = AssetDatabase.GetAssetPath(clip) select AnimationClipCompress.CreateCompressedClip(clip, 4) ).ToArray(); SelectionUtility.ActiveObjects(clipInfos); } }
public static void CompressClip() { AnimationClip[] selectedClips = Selection.GetFiltered <AnimationClip>(SelectionMode.Assets); if (selectedClips == null || selectedClips.Length == 0) { return; } var clipInfos = (from clip in selectedClips let clipAssetPath = AssetDatabase.GetAssetPath(clip) select AnimationClipCompress.CreateCompressedClip(clip, 4) ).ToArray(); SelectionUtility.ActiveObjects(clipInfos); }
public static AnimationClip[] ExtractClipsFromFBX() { GameObject[] gameObjects = Selection.GetFiltered <GameObject>(SelectionMode.Assets); if (gameObjects == null || gameObjects.Length == 0) { return(null); } var clips = (from go in gameObjects let assetPath = AssetDatabase.GetAssetPath(go) where Path.GetExtension(assetPath).ToLower() == ".fbx" let extractClips = AnimationClipExtract.ExtractClipFromFBX(assetPath, null) from clip in extractClips select clip).ToList(); SelectionUtility.ActiveObjects(clips.ToArray()); return(clips.ToArray()); }