Home Website Youtube GitHub

Bake animation on joints skeleton

URGENT!

Hi,

I finished my animation and now I’d like to do a baking (simulation bake) on the skeleton joints of my character (so I can import the animation in Unreal Engine. To import in Unreal, I must have a FBX file with the binded character in T-Pose and a FBX file of the baked animated joints only.) The problem is when I bake in Maya (Edit - Keys - Bake Simulation), some deformations are not applied to the skeleton left alone without the controllers (i.e. Eyelids, Lips). There’s even some issues with the hands…

Can someone help me please?!

Hey there! Can you make a screenshot of what exactly happens when you try to bake joints?
If you do Edit - Keys - Bake Simulation, then it’s not exactly what you need. Go to Animation tab -> Key -> Bake Animation. When you do this, you should notice your skeleton moving independently of your control curves now. That’s the sign you baked your animation right. Hope this helped!

Hi Sam,

Thank you for answering! :slight_smile: I tried to do the bake with the Animation tab but it gave me the same result (same deformations and everything). I believe there is a issue with my rig, but I am not too sure what it is.

Here’s a little video I quickly did so you can see what is happening in my scene: https://youtu.be/9h4SwBsuAo8

Here’s the screenshot you ask for. Thank you!

Video

Alright, so a few things that bothered me a bit: If you only need animation on your squirrel mesh, you bake only deformation group (joint chain). Then export it as FBX. It is not necessary to delete rig parts at all. Also why would you get rid of the namespaces before baking?
I’m not really sure whether the pipeline is different if you work with Sequencers/movies, but you should have your Skeletal Mesh separated from animation files in Unreal (at least that’s how I export animations for my game models).

If you have also have a prop, just put 1 joint in 0 world position and the other one inside the prop. That will allow you to make a Sequencer with all animated things you have in Maya.
Also, check if you have a proper joint chain, meaning you have a “root” joint and everything attached to it. You may have separared joint chains with groups above them. In that case, you need to rebuild the rig itself, or parent groups correctly.
Sorry for the rushed reply, but I hope that helped you!

1 Like

Oh! Thank you so much! Your help is really appreciated.

I was cleaning the rig because I thought it was required for the importation in Unreal. At my 3D school, teachers emphasized a lot on the importance of having a clean rig to avoid errors in the engine. However, I followed your instructions to not touch anything and it seems to work just fine. :slight_smile: Thank you!! (Sometimes, the solution is the easiest way.)

Last question: Do you know what could be causing these bugs in my animation (watch video: https://youtu.be/CltUPsTANlc)? In Maya, the animation doesn’t play like that.

Have a great day,

Just a quick question @emie231 are you using DualQuaternium Skinning or Linear?

@Jerome I am using DualQuaternium. Do you think it could be responsible for the issues I am facing?

It can if you didn’t turn on the attributes allow non uniform scaling thingy.

Attributes you need to set in the skin cluster node:

Support non-rigid transformations
When on, lets you animate bone scaling on the skinCluster node and activates the Scale settings.
Use Support non-rigid transformations to enable non-rigid transformations (such as scale and shear) in dual-quaternion or blended-skinning modes.

Scale
Lets you apply global scaling.
This attribute is useful as it globally scales DQS deformations with dual quaternion or blended modes when rescaling a bound character to a different size scene (where non-rigid transformations are enabled).

1 Like

Update: I was able to import my animation in Unreal Engine and it is now working perfectly fine.

To make this conversation more informative for other users, I will resume what I did:

To import my animation in Unreal Engine, I added a root joint for the world position. Then, I selected the hierarchy of my joint chain and I baked it (Animation tab -> Key -> Bake Animation). Next, I went in File - Import/Export - Export All… and I exported my file in FBX. (Make sure you check the export Animation option.) I named this file: ANIM_***. I went in Unreal and imported the file. At that point, you must already have your other .FBX file imported for the Skeletal Mesh information (this file does not contain animation). Now it should be working.

My mistake was that I was deleting nodes, constraints and controllers important for the rig (because I thought Unreal wouldn’t take in a file containing deformers, but it did!) Long story short, you do not have to delete anything for the exportation.

For the abnormal deformations occuring, this problem was caused because of the skinCluster node. (see Jerome responds)

Thank you very much for the help I received. Excellent rig by the way! I definitively recommend!

2 Likes

Also, check this issue on Github @emie231. It might affect you if you are using skin.py

hello @emie231

I think is related with non uniform scale and the segment scale comp
image

try to run this and let me know:

import pymel.core as pm
for j in pm.ls(type="joint"):  
    j.segmentScaleCompensate.set(True)

This is disconnected because game engine doesn’t support it. But is also true that doesn’t support non uniform scale

If doesn’t work please let me know. (Can you share the scene with me?)

Cheers,
Miquel

@emie231 Watching your youtube video again. I see the issue with the eyes. This is a different issue.

If you allow me to use your animation, I can record a youtube tutorial on how to fix it… So I fix it for you and other people with similar issue can have a good guide.

Is it possible?

Hi everyone,

I apologize for my late reply. I was in the rush for a school project. I managed to arrange everything. Everything works fine now! I am so happy! mGear rig does work with game engine like Unreal. Now, I am going to answer the questions I had before:

Question 1: Once I have finished the animation, is it possible to export the animation in a game engine (i.e. Unreal)?

Answer: Yes! Here are the steps :

  1. If you were working in reference, make sure to import your objects in your Maya scene
  2. Select everything in your scene and bake the animation (Animation Tab - Key - Bake animation)
  3. Delete deformers. To do it manually, you can select your meshes and, in the Channel Box - Inputs, Edit - Delete node - each deformers. (We delete deformers because FBX files do not support those nodes. Do not worry if you think you might loose some deformations (for example, if you used the Facial Rigger), because it won’t happen. By baking your animation, you kinda saved the deformations on your skeleton/mesh.) However, Soft Tweaks (soft deformations) do not work unfortunately.
  4. Export your animation. File - Export All… FBX (Make sure you check Animation and Deformed Models)
  5. Export your bind mesh. File - Export All… FBX. (Uncheck Animation)
  6. Open Unreal, import first the ‘‘Bind Mesh’’ FBX file, and after import the ‘‘Animation’’ FBX file.

Everything should work just fine. You might get some error messages, but that is normal. (It is because some nodes again are not recognized by Unreal, but we don’t need them anyway.)

I’m sorry if all of this might seem very easy for some of you. I am new to 3D so it took me a while to figure it out. I hope this will help someone one day. :slight_smile:

Question 2: What were the weird deformations occuring in my scene after I baked?

Answer: To be honest, I do not know what was the specific cause of my previous problem. Looking back, I think I did the baking wrong. (Make sure you select EVERYTHING in the hierarchy and everything is bake! I remember there were some channels locked and unkeyable. (If you are facing the same issue, know that you can simply unlocked those channels by right-clicking on them - Unlock Selected - Make Selected Keyable)) Something else I did was that I added a root joint for the World Position.

@Miquel As for the Non Uniform Scale and the Segment Scale Comp, I do not think it was the main cause of my problem because when I clicked on my joints, the Segment Scale Compensate was already checked. And after I ran the script, I didn’t see a drastic change. I still think it was important to take these two things in consideration.

In conclusion, I think my animation was not working because of my lack of knowledge on the ‘‘baking’’ part. When I think of it now, it is super simple to export the animation. mGear offers a complete and high-quality rig easily useable for non-rigger artists (like me). It even includes a facial rig and a soft deformations tool which are super practical. Overall, I really enjoyed my experience using mGear and I will definitively reuse it in the future. Developers, you did a great job! Thank you!

@Miquel For the issue with the eyes, it is now a lot better now that I have fixed the skinning. Of course I would have had really appreciated if you would have taken a deeper look into my model, but the thing is I am not allowed to share my character with anyone because my project is ‘‘owned’’ by my 3D school. Even if there are very low chances that it happens, I don’t want any of us to get in a pursuit. Sorry about that. I wish I could have helped.

Again, thank you everyone who helped me.

2 Likes

Getting the animation to export(game exporter) but I have one error as seen below.
image

Hi,

I am not to sure what is the specific cause of your problem, but I might have a alternative solution. I recently discovered that you can simply bake the animation on your vertices using Alembic. If you do not require a skeleton mesh, it might be a good choice.

In maya,

  1. Select your mesh
  2. Cache - Alembic - Export Selected
    In the settings, make sure you have checked UV write and Write Face Sets.

Voila! It’s gonna give you a .ABC file. Import this file in Unreal in Geometry Cache.

I hope this can help you! :slight_smile:
Good luck!

I tried that as well. I think it’s something to do with my specific mear rig.

Have you looked at the joint orientation of your right foot? Compare both feet and see if there’s a difference.

Check it out for me

https://we.tl/t-SwwJWo4ZSG

Hi @Ross_Daniel

I did a little test export and looks like is not breaking here

image

But still have some warnings when FBX export

I have arrange manually the joint herarchy and eye joint to be in the same hierarcy, Also parent all under geo

image

in FBX export option check bake animation

I will send you the FBX in a PM

Cheers,
Miquel