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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question How to play alembic and fbx animations both on the same model?

Discussion in 'Animation' started by Kartik0330, Jul 12, 2021.

  1. Kartik0330

    Kartik0330

    Joined:
    Apr 5, 2021
    Posts:
    1
    Hi everyone,

    So here is the problem that I am stuck with, there is this enemy I am implementing having two kind of animations.

    1. FBX animations (.fbx extension) involving movement of body parts with no FX.
    2. Alembic animation (.abc extension) involving movement of body parts with FX.

    FBX animation has it's own rig and similarly ABC has its own. So in order to play all the FBX animation(s) I choose any one of the FBX rig to create the avatar and then apply that avatar to the rest of the FBX animation rig(s). So in this way I am able to play all the FBX animations on the single model using Animator Controller.

    In order to play alembic I need timeline to play that animation but that too on the rig associated with it.
    NOTE : Both FBX and ABC have there different rig hence FBX needs Animator Controller to play animations and ABC needs Timeline to play the animation.

    The issue I am facing right now is that I want to play both these FBX an ABC animations on the single model whereas right now I am having two different models one of FBX and other of ABC.

    So if anyone can help me out with the stated problem I would highly appreciate that.
    Thanks in advance.
     
  2. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    187
    Hey,

    Thanks for the message.
    Lemme see if I got this straight: You have 2 GameObjects in the scene, 1 for the FBX and 1 for the ABC.
    What you do is you play different animations on the FBX just by switching the animation clip (Animator or Timeline).
    What you would like to achieve is the same behaviour but with ABC.

    2 Things:
    Alembic files don't have any rigs really: they are a "vertex soup": at every frame, all the scene geometry gets overwritten with the data from the current frame. This means the Alembic does not have animation data per say but geometry data.
    FBX are skinned meshes meaning you are able to switch bone animations.


    An idea to try: The latest Alembic version has a feature that might be use: you are able to add an AlembicStreamPlayer to a GO and call LoadFromFile to point it to an ABC file directly.
    If you do this, you'll be able to just call "loadFromFile" repeatedly and point it to a new alembic stream (corresponding to a new animation of the same character). Try to make sure that the GameObject hierarchy of all files stays the same.

    Bare in mind of you do this, you are bypassing the importer, meaning if you change the file hierarchy, you'll have to update it manually inside the scene. Also there are a fair number of limitations when mixed with prefabs.


    Hope this helps.