I’m trying to get all the animation clips stored inside an fbx file. The fbx file is an asset, NOT a Game Object, i.e: it shows in the project’s window, not in the hierarchy.
What I want is a method to access the Motion object in the animation file, as I’m building an script to automatically map motions to mecanim states/animationclips given a set of filename named with some conventions.
I’ve tried:
-
Accessing the motion inside the fbx file directly. Unfortunatley the fbx file is of type
UnityEngine.Object
and does not includes an Component of type Animation. -
Instantiating the fbx file in the scene (so I create a proper GameObject from that asset) and then accessing the
GameObject.animation
property. Unfortunately when I instantiate it the resulting GameObject in the hierarchy, it does not contains an Animation Component neither so I’m pretty stuck.
Any ideas?