I’m writing an animation system and need to be able to duplicate an animation clip that is within an fbx file. This can be done via the project view by selecting the clip within the fbx asset and duplicating normally, but for the life of me I can’t work out how to do it in script. I can duplicate the whole fbx file, but not the clip within it.
Yes, I’m using an editor script. I’m writing a node based animation blending system with it’s own ui inside Unity3d. I’d like to be able to import animation clips from fbx files but then duplicate it in order to get access to the AnimationEvents as well as be able to create new animation f-curves inside the animation clips. I can do all this already, but it means manually duplicating the clip rather than it all being within the ui I’ve created. I’ve had a pretty close look at the AssetDatabase class but have only managed to duplicate a whole fbx file, not an animation clip within it.
Re: AnimationUtility class… I’ve had a look and as far as I can see, there is no way to duplicate a clip, I suppose I could find a clip, get all the curves and copy them all… I was hoping for an easier way.