Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Importing animation clip list

Discussion in 'Editor & General Support' started by r_stenberg, Jan 14, 2016.

  1. r_stenberg

    r_stenberg

    Joined:
    Apr 14, 2015
    Posts:
    8
    Hi,

    I started a new contract with a startup, they are using one large FBX file to hold all animations per character and separating out the animations within the clips section. Any new animations are added to the clips list by hand, this is obnoxious and slow. Is there a way to auto-populate the clip list and frame numbers off something like a CSV or XML file?

    I am currently writing a tool for Max to keep the animation list, start frame, end frame, etc. I plan to have the tool create a csv/xml/etc something readable for manually inputting new clips. That file could easily be used to update the clips list.

    If not could it be created? I am a few years removed from programming within Unity, could someone point me in the direction of how I would write one? I know just enough programming to be dangerous. I write small tools for 3D programs and am stubborn enough to keep googling till I figure out how it would work.

    Thanks
     
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    Unity gives you the possibility to automate steps you need to have done after importing.
    For that you can use the assetpre and post processor classes.

    For your case i found this
    https://docs.unity3d.com/ScriptReference/ModelImporter-clipAnimations.html
    This should enable you to read your custome list of animation clips via XML/CSV/JSON and automate the splitting on inport.