Baked animations - what does it mean for Unity?
I want to export a mesh with animations from 3ds max to fbx. There is an option to bake animations. What does it mean for Unity?
The reason I ask is because I want to do a lot of corrections in animations inside 3ds max that can't be done in Unity, such as Morpher, Skin Morph targets. So if I then make animations and bake it in FBX, does it mean that the skeleton is not needed for the character and it will be the character mesh animated itself?
Am I correct that baking animation means to record all kinds of animations (skeleton, morpher, skin morph targets) into mesh itself? So in Unity it will be only the mesh with recorded animations?
Answer by theANMATOR2b · May 20, 2017 at 04:03 PM
So if I then make animations and bake it in FBX, does it mean that the skeleton is not needed for the character and it will be the character mesh animated itself?
No
Am I correct that baking animation means to record all kinds of animations (skeleton, morpher, skin morph targets) into mesh itself? So in Unity it will be only the mesh with recorded animations?
No
There is an option to bake animations. What does it mean for Unity?
Basically - this bakes all animation movement into keyframe on every frame/tick of the animation duration on the timeline. So if the animation lasts for 1 second and the animation speed is set to 30 frames per second, the bake option will create a keyframe for all animated bones on every frame - in this case 30 frames.
There is a built in option in 3D Max (Under motion panel maybe) to bake animations, and depending upon how the mesh is animated, it could bake vertex animation data into the mesh or bake animation data into other objects. This is commonly used when there is a special set up on a bone hierarchy that doesn't place animation keys on bones, but instead on a manipulator or on the animation controller it self within Max, like a noise controller, position constraint etc etc. The controller animation parameters can be baked down into the bones so then the bones will have animation keys on them and then they can be exported to a real-time engine. Other uses for this baking process are cashe proxies and other unique setups.
If you are looking to bake vertex animation data into an animated mesh - like when using a wave or noise modifier to mimic an ocean or waves, the only way I'm aware this works is to use the megafliers asset in the asset store. It is a pretty expensive asset - but very useful from my research. Might not be worth the cost if you are only using it for a simple mesh deformation though.
Hope this helps.
I think I almost got it from your answer, very informative btw. I only need to clarify what is "baking vertex animation data into the mesh or bake animation data into other objects". So in short baking means transfor$$anonymous$$g all animation and deformations into keyframes on the timeline regardless of how the animation is done. But you can bake to mesh and bake to other objects, like bones, right? What is baking to mesh?
One example of baking keyframes onto other objects. This is rare - but used in characters quite often. Look up the difference between F$$anonymous$$ and I$$anonymous$$. O$$anonymous$$ now - when animating in F$$anonymous$$ the artist sets animation keys directly on the bones. When using I$$anonymous$$ the artist uses a control rig to animate the character, but does not set animation keys onto the bones. He sets animation keys on the control rig - or I$$anonymous$$ controls. When the character is exported as fbx (and this can be done internally in $$anonymous$$ax as well) the keyframes of the I$$anonymous$$ controls get "baked" down onto the bones. So the animation information previously only existing on the animation/I$$anonymous$$ controls - is now present on the bones - and transfers into Unity as simply animated bones and mesh.
One example of baking vertex data directly into the mesh. When the artist uses a modifier in $$anonymous$$ax - like a wave modifier or a noise modifier - that animation data is not on the mesh - it is driven by the deformation modifier. This animation information is really not usable by anything other than $$anonymous$$ax. If you want to transfer that animation data down into the mesh - the best way is to "bake" that down into the vertices. This is an internal $$anonymous$$ax process that you can research. This allows the animation information to be transferred into each vertex - so the mesh will deform just like it was when the modifier was animating the mesh. There are several reasons why someone would want to bake the animation information down into the vertices.
However - this is a very expensive technique - and is commonly not used in game engines. This baked vertex animation data is usable in Unity - but it will be expensive to run real-time and requires extra tools and set up to get working correctly in engine. There are a couple assets in the asset store that help with transferring this baked vertex data into Unity - but the best and most widely used is megafliers tools. I have not used these tools - but compared to the other offerings that aid this animation transfer - this one is best supported and robust.
Thank you for explanation, I now understand. You also told a little about F$$anonymous$$ and I$$anonymous$$ and I kind of completed this puzzle in my head, it's clear now. You helped me combine some pieces of information into the whole thing.
But I have a new wave of questions, I feel I don't understand some concepts of animating game characters actually for games, not for static scenes. About the second example, baking vertex data into the mesh. I want to clarify it regarding Unity, that's exactly my main topic in this discussion. If I bake anything like that into the mesh, for example some parts of cloth that I want to just repeat some deformations in the game at certain frames, not be animated dynamically with bones, I can bake those deformations in 3ds max into the mesh, right? Let's say I baked it, nvm. But then I export it into fbx, load the file in Unity and what do I see? Unity does not recognize it by default and I need those paid plugins?
Generally, if I want cloth or hair or tools on the character to have some $$anonymous$$or repeating deformations when the character performs some moves and I don't want to animate it dynamically in the game using bones, but rather be statically written down into certain frames, what are the options?
Ok, thank you very much. I can't reply to your newest comment, there is no reply option for it, but yep, you clarified things. $$anonymous$$akes sense. I don't know how gpu/cpu hungry vertex animation is, I want to animate a part of mesh not bigger than maybe 30-50 vertices, but if it requires any special efforts/plugins to make it work in Unity, it's not the best choice I think.
You want to animate a portion of mesh that is 30-50 verts?
Another option is to look into morph/blend shapes. These can be created in 3D and then animated in Unity. Could be a quasi-solution to get the effect you are after, however you will have to set up a animation controller that controls the animations of the morph/blend shapes how you want them to look.
$$anonymous$$orph/blend shapes are essentially vertex animations - however they are utilized by about half the entire industry to get facial animations in game - Unity has a built in interface to facilitate morphs/blend shapes. When imported the morphs will be in the mesh renderer component (I think) I can't exactly remember. But they aren't exclusive to only characters for facial animation. They can be used on any type of mesh - but the mesh might need a skinned mesh renderer. Check those out to see if they can be a solution.