unity fbx 导出动画
Posted ylwn817
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了unity fbx 导出动画相关的知识,希望对你有一定的参考价值。
public class ActionConvetTool { [MenuItem("ActionTools/动作处理")] public static void ActionConvert() { UnityEngine.Object[] arr = Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.Unfiltered); for (int index = 0; index < arr.Length; index++) { string strFilePath = AssetDatabase.GetAssetPath(arr[index]); Debug.Log("filePath=" + strFilePath); ActionScriptable action = ScriptableObject.CreateInstance<ActionScriptable>(); UnityEngine.Object[] objects = AssetDatabase.LoadAllAssetsAtPath(strFilePath); if (objects == null || objects.Length == 0) { return; } for (int i = 0; i < objects.Length; i++) { if (objects[i] is AnimationClip) { action.aClip = objects[i] as AnimationClip; string strSerializeFile = "Assets/Resources/Action/"; string strDir = Application.dataPath + "/Resources/Action"; if (!Directory.Exists(strDir)) { Directory.CreateDirectory(strDir); } string strFileName = objects[i].name + ".asset"; string strFile = Application.dataPath + "/Resources/Action/" +strFileName; if (File.Exists(strFile)) { File.Delete(strFile); } AssetDatabase.CreateAsset(action, strSerializeFile+strFileName); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); break; } } } } }
注意事项:需要先选中fbx模型然后导出
以上是关于unity fbx 导出动画的主要内容,如果未能解决你的问题,请参考以下文章
求助,关于MotionBuilder导出动画fbx到Unity
unity只能导入骨骼动画吗?我在maya里做好的ik动画导成fbx文件unity不播放动画···