AnimationClips from an fbx file to script

Hello!

I have a problem with pulling actual references of AnimationClips from an .fbx file via script.

Workflow: I’m importing .fbx and cutting animation via script in multiple animations during preprocessing, and then through editor window i input it into Animator and database.

But the only way of getting actual reference of animationClip i found was to get it through LoadAssetAtPath(), and this gets only first one of them( i have 3+ animations in each fbx).

Other way is to instantiate an object, and then i get a copies, but i need references to actual ACs in fbx.
Is there any way around this two? Maybe some method like LoadAssetAtPath which lets to get multiple objects of certain type from AssetDatabase?

My project has tons of animations and i want to automatize work with database and animator as much as possible. Of course i can just drag and drop this animations to animator, but where is fun in that(and animator is laggy af after 300+ animations)

Help much appreciated asap.
Thank you!

Well…
I’ve never believed that legends about finding answer right after asking question were true, but, well this is the case.

I found a solution:

UnityEngine.Object[] data;
data = AssetDatabase.LoadAllAssetRepresentationsAtPath(myPath);
clips = new AnimationClip[numOfClips];
int t = 0;
for (int i = 0; i < data.Length; ++i) {
	if (data*.GetType() == typeof(AnimationClip) &&t<clips.Length) {*

_ clips [t] = data as AnimationClip;_
* ++t;*
* }*
}

It is fairly simple. I’m parsing all assets in fbx file, knowing number of animations that i need(numOfClips). And then adding found animationClip Objects to clips array “as AnimationClip”
Good luck.