Home Youtube GitHub

Problems with baking keys to skeleton


#1

Hi,

I’m trying to bake the animation keys to the skeleton in order to export an FBX to Unity.
(Edit>Keys>Bake Simulation).
I’ve done this before many times with other rigs.

I have an mGear biped character with lips_rigger and blendshapes for the eyes.
What happens is- when I select all the joints and bake the simulation only the lips joints receive keys and get baked and all the shifter created joints don’t.
Their channels remain locked and key less. I tried unlocking channels the regular way but they remain locked.
What am I doing wrong?

Thank you.


#2

Hi @Tsahi to be honest I am not 100% sure of all the rings and bells of game export to unity. I should research this in the future.
Have you review this topic? Bake animation on joints skeleton and this? FBX Export / Game Tools

I wonder is someone in the forum can help with this?

Cheers,
Miquel


#3

Hi @Miquel,

Thanks for replying.
The basic principals don’t have too many bells and whistles. Unity accepts skinned skeletons and blendshapes, but they should have the keys baked on to them. It’s pretty straightforward.
(If you consider affecting game performance, for example, for mobile games, it gets more complex but nevermind that).

I have reviewed the two threads you mentioned. I could try the workaround of duplicating the skinned skeleton and then constraining each joint to it’s original counterpart in the rigged+animated skeleton, but that’s a little tedious.
In the past, with other rigs, what I’d do is just bake the keys onto the skinned single hierarchy skeleton.
I thought that’s be possible with mGear, but I don’t know if it’s just not possible in mGear or perhaps it’s something went wrong specifically in my files. :thinking:

Do you know if mGear has something that prevents baking? From the other threads it doesn’t sound like it.
Has anyone else encountered an issue with this?

Thanks!


#4

Hi @Tsahi

I did some research about game export.

The shifter game tool doesn’t re-connect correctly the eye and lips rigger parts. I will fix this in the future. But not sure when.

But if I export by preparing the asset by hand. Looks like is working for me.

Here is the sample test animation that I did:

The only thing I did to prepare the asset manually is to parent the joints and the geometry under one transform called “game_export”


Later I exported selection and bake the animation at an export time using the FBX option to bake animation.
So no previous bake before export

The only thing that you probably note at the end of the first gif is the strange scale/shear on the head
that is related to the non-uniform scaling of some joints. FBX export log is warning about it
image

This should be fixed using this setting:

Here is the log with the rig new build with a similar animation

and the animation load in Unity

Also here is one screenshot of the joints in a single hierarchy

I hope this information helps to debug your issue.

Cheers,
Miquel


#5

Hi @Miquel

Thank you! Baking the animation during FBX export did work.
I should’ve thought of trying it.
The rig was left in the file, perhaps due to additional things I connected after the build, but that’s no problem,
I clean them up afterwards.

It’s still weird though that the joints can’t be baked to have keyframes on them.
What if someone doesn’t want to export to FBX for a game engine but wants to bake the animation and delete the rig for render purposes?
I’m still not sure if being unable to unlock the joint channel and unable to bake them is something that happened to me as a bug or if it’s an mGear thing.
@hoover900 if you’re reading this, perhaps you can say if you encountered such issue when baking keys to the bind skeleton?

Thank you!


#6

@Tsahi,

I never did anything special on getting blend shapes into Unreal. Just made sure bake animation keyframes and blend shape options were flagged in the Game Exporter settings.

I would make sure that you’re using the version of FBX that is supported by the version of Unity that you’re using. In my case that was FBX 2016 for Unreal at the time. This was updated later to FBX 2018, but we ran into an issue with Unreal not being able to import FBX because our custom build didn’t have FBX listed as dependency, so FBX import function wasn’t part of the build.

The Unity docs say there is a slight issue with blend shapes, but you should be cool if the blend shape nodes are keyed.

The Autodesk® Maya® FBX Exporter bakes un-supported complex animations constraints, such as Set Driven Keys, in order to import the animation into Unity properly. If you are using Set Driven Keys in Autodesk® Maya®, make sure to set keys on your drivers in order for the animation to be baked properly. For more information, see the Autodesk® Maya® documentation on Keyframe
Animation.

Again from what I read in the docs here you just need keys on your blend shape nodes and should be good to go.


#7

@hoover900 Thanks for the reply.

I didn’t run into any FBX version issues or blendshape bake issues.
I asked about baking keys from within Maya (Edit> Keys> Bake Simulation) and not during the FBX export.
I used to bake keys like that for animated characters, either for games or for rig delete before render.
That method doesn’t work for me with mGear.
But now I understand you didn’t do that, you baked through FBX export like Miquel.
That method works for me in this case (export for games). I suppose for a render pipeline exporting to Alembic will be an alternative for keeping a baked skeleton Maya file.

Thanks,
Tsahi