Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

(Blender issue) How to combine multiple actions/clips to just one action/clip for export to unity

Discussion in 'Animation' started by ig-swapnilwelling, Jan 24, 2020.

  1. ig-swapnilwelling

    ig-swapnilwelling

    Joined:
    Jan 24, 2020
    Posts:
    4
    So, I'm animating a character doing surgery on the patient. But as it stands, when I export the animation file, it's divided into multiple actions, two for each animated character and three for each tool applied in the surgery. This is not optimal for me because I want all the object-related animations to be combined into one action/clip of the surgeon character. But blender won't allow that as I want it to come up as one single clip in Unity.

    So ideally a total of 2 clips, 1 for each character.
    The surgeon would have all 3 tool animations combined.

    This is easy to do in 3Ds Max by just exporting everything within the scene into one single clip.
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,555
    No idea about the Blender side, but if you are exporting it all as one file you can just go to the Animations tab of that file's import settings in Unity where it lets you configure the clips you want to import from it.

    You could also try keeping them separate and using Timeline to set up a sequence to play them.
     
  3. StaticClass

    StaticClass

    Joined:
    Jan 31, 2014
    Posts:
    12
    I use Blender as the main tool for cutscenes in my Unity project, and for example, when I want three actions (walk loop, move in scene, look around) combined into one clip I select all the strips in Blender NLA Editor and then Bake Action. This approach also allows you to blend different strips and make the transition between actions look more fluid. Of course, each time you modify anything about the strips and its actions you have to bake again.

     
  4. ig-swapnilwelling

    ig-swapnilwelling

    Joined:
    Jan 24, 2020
    Posts:
    4
    Hey, @Kybernetik & @StaticClass thanks for the responses. But unfortunately, the issue is not solved.
    But I came up with a solution and I'm posting it here so it might help someone else who needs it.

    Solution:-
    We first need to rig the object that is an attachment. In this case an incision knife.
    So the result would be that you have two armatures in your outliner one for the object and the other is the character.

    Screenshot_1.png

    Outliner:-
    Character1 (Armature1)
    Object (Armature2)

    Now we need to combine the rigs
    So select the parent first, in this case, the character rig and then the Object rig and press ' Ctrl + j '

    Now the rigs are combined into one so it would like this ---> Character1 (Armature1) + Object (Armature2) = Character1 (Armature1 combined)

    Outliner:-
    Character1 (Armature1)

    Now you can animate the object in the same clip since its now part of your armature. You can use bone constraints to animate the object to whichever hand you want and toggle the influence as required which is so much better than using relation parent.
    Just make sure the base file which has the animation controller unity has the same setup.


    Also added a note if anyone is using auto rig pro setup - https://blendermarket.com/products/auto-rig-pro then after combining the mesh make sure that all the extra bones are re-named with a pre-fix ' cc_ ' for example knife_bone would now be cc_knife_bone.

    The script will detect those bones and export them properly.
    Hope this helps :)