- Home /
Convert .fbx files to .anim batch
Hello, I want to convert hundreds of external .fbx fies to .anim files via script to use in Unity. But I couldn't figured out how to, thanks for your help.
Answer by Positive7 · Jul 28, 2015 at 06:11 PM
using UnityEngine;
using UnityEditor;
public class test : MonoBehaviour {
new AnimationClip[] animation;
void Start(){
animation = Resources.LoadAll<AnimationClip> ("Model");
foreach (AnimationClip i in animation) {
Debug.Log ("Animation: " + i.name);
AssetDatabase.CreateAsset(i, string.Format("Assets/AnimationClips/{0}.anim", i.name));
}
}
}
Could you help me with this error please?
Couldn't create asset file because the AnimationClip 'gesture1_sample_1' is already an asset at 'Assets/Resources/AnimationClips/gesture1_sample_1.fbx'! UnityEditor.AssetDatabase:CreateAsset(Object, String) NewBehaviourScript:Start() (at Assets/NewBehaviourScript.cs:15)
It seems like AnimationClip already exist. Try to change the path or delete/move gesture1_sample_1 somewhere else.
Can I get fbx files from an external resource like Desktop or something? I move them but still it gives the same error
Yes you can load it with WWW
WWW www = new WWW("file://" + path);
Your answer
Follow this Question
Related Questions
how to add a .anim or fbx animation to my NPC/character? 0 Answers
Animation not playing correctly 1 Answer
Scene animation 0 Answers
Rigged model facing the wrong way 1 Answer
How to export turbosmoothed animated model to Unity3d? 0 Answers