Animator controller, split animations , no import inspector

Hi,

I’m trying to split a mecanim animation into multiple animations using events. We are using a software that generate an animatorController (unity object) with animationClips. (the plugin is Spine)
We would like to be able to split animations into smaller ones.

As there is only a animatorController and no fbx file, the unity importer inspector is not there so we cannot use this :http://docs.unity3d.com/Manual/FBXImporter-Animations.html

So I tried something like this (as an exemple) :

AnimationClip newClip = new AnimationClip();
           EditorUtility.CopySerialized(sourceClip, newClip);

            AnimationClipSettings a = new AnimationClipSettings();
            a.startTime = 0.05f;
            a.stopTime = 0.15f;
           AnimationUtility.SetAnimationClipSettings(newClip, a);
           AssetDatabase.CreateAsset(newClip, path);

The copied animation is created but AnimationClipSettings.startTime and AnimationClipSettings.stopTime do not seem to work. (it’s only a simple copy)

I’ve then tried with AssetPostprocessor class, because of the ModelImporterClipAnimation where we can choose clipImport.firstFrame , clipImport.lastFrame .
The problem is , it only work with Models with OnPostprocessModel, or sprite/texture/audio, or fbx with OnPreprocessAnimation.
For animator we can use OnPostprocessAllAssets, but it have to be declared as static so there is no assetImporter set and no import done.

Is there a way to create a new animationClip from another AnimationClip, from frame x to frame y ?

Thank in advance

(I already created this thread in 2D forum, but it seems more related to animation stuff, and I did not find anything to delete a thread).

Ok if anyone wonder, I found an ugly way (but did not find anything easier).

I have a dummy fbx file and use OnPostprocessModel, then set in modelImporter the desired animations with desired split in ModelImporterClipAnimation (even if the animation are for completly other objects, the only need is to create the animation), and it seems to work. To unlink from the fake model just need to copy the animation and delete the linked ones.