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

Blender animation to Unity

Discussion in 'Asset Importing & Exporting' started by DreamPhantom, Oct 26, 2014.

  1. DreamPhantom

    DreamPhantom

    Joined:
    Oct 26, 2014
    Posts:
    2
    So I've covered the concepts of importing blender animation files to unity through saving it as a FBX file, I've also covered the idea of having a single fbx file holding multiple animation by adding them through the action editor and having the [F] pressed to have them saved. The issue are with these two questions:

    1) Is it better to keep them together or separate?

    Why? I've come across the issue when trying to save them together that blender will set all of the animation time to the same and won't let me change the end frame for each individual animation.

    So this also leads to the question that if I was to make each animation file separate does unity know that each animation will be linked to the same object? Since if the object was changed during one of the animation by chance then what would happen? I haven't tried doing them individual yet so would I only export the animation file over to unity without the object[not even sure if that is possible]? Most likely yes, silly question but just in case.

    Before you send me links to the many videos [which I've seen most likely] on how to do this [their way] which is to simply swap out an already working type. . . I would like to know how to do it from scratch.
     
  2. DreamPhantom

    DreamPhantom

    Joined:
    Oct 26, 2014
    Posts:
    2
    After doing further research http://docs.unity3d.com/Manual/Splittinganimations.html , it seems that you can put all the animation together and then split it up in unity. So the question for blender is do I still make each individual animation or just make it all into a long animation for example : idle -> walk -> run -> etc all into one single long animation clip and let unity take care of breaking it up? This doesn't seem right since in unity it'll have all the names of the animation separated. This made me arrive at the thought that you make them separate and as that link up above showed all the animation ending at the same time [which is okay] since you'll split it up as needed for unity. So in blender go ahead and set the end key frame to the longest possible animation?
     
  3. GoesTo11

    GoesTo11

    Joined:
    Jul 22, 2014
    Posts:
    604
    I don't know what is the best way but I did separate animations in the same blend file and exported them in the same .fbx file. Worked for me. I think that I read somewhere that Unity has a naming convention something like model@action and if you name separate files that way Unity will recognize that they belong to the same model.
     
  4. eelstork

    eelstork

    Joined:
    Jun 15, 2014
    Posts:
    221
    This setting that you are referring to ('end frame') is irrelevant to the length of animations inside Unity, it is only used while previewing animations in Blender and is meant to be used to create complete CG movies using Blender.

    Unity assumes that the length of an animation is from the first key frame to the last key frame, on a per animation basis. Sometimes this is incorrect (because it is not uncommon that we set key-frames before the first frame and/or after the last frame, but this is not an issue as you can override the start/end frame (again, on a per animation basis) from within Unity.

    I don't know whether there is a 'recommended' (by whom?) way to do things but splitting animations isn't very logical or well organised, and separating animations on a per file basis isn't very practical. imho blender actions are the way to go.
     
    pixoloco likes this.