[Unity cainiao] fbx Model Animation Extraction

Source: Internet
Author: User

The role has already been human (humanoid), so its animation can be used on other models, that is, a set of model animations can be shared, but have you found that the animation is tied to the fbx model? It doesn't matter. You can select these animation files and press contrl + D to extract them, then you can delete the entire fbx model, and the newly generated animation is no longer based on fbx, which can greatly reduce the resource size.

If you are a programmer, you may think about the implementation code.

using UnityEngine;using UnityEditor;using System.Collections;using System.IO;public class AnimationClipTool{    [MenuItem("AnimationClip/GetFilteredtoAnim &1", true)]    static bool NotGetFiltered()    {        return Selection.activeObject;    }    [MenuItem("AnimationClip/GetFilteredtoAnim &1")]    static void GetFiltered()    {        string targetPath = Application.dataPath + "/AnimationClip";        if (!Directory.Exists(targetPath))        {            Directory.CreateDirectory(targetPath);        }        Object[] SelectionAsset = Selection.GetFiltered(typeof(Object), SelectionMode.Unfiltered);        Debug.Log(SelectionAsset.Length);        foreach (Object Asset in SelectionAsset)        {            AnimationClip newClip = new AnimationClip();            EditorUtility.CopySerialized(Asset, newClip);            AssetDatabase.CreateAsset(newClip, "Assets/AnimationClip/" + Asset.name + ".anim");        }        AssetDatabase.Refresh();    }}

Select an animation clip and click the animationclip/getfilteredtoanim option on the menu bar (shortcut: Alt + 1). The generated animation clip will appear in the assets/animationclip folder.

(If you choose NOT an animation clip but another resource file, the Source and Destination types do not match error will occur)

 

Reference http://tieba.baidu.com/p/2700101781

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.