*I am dabbling around with the stock 3rd person game project.
*I would like to understand the code portion that deals with the loading of the animation data for the “Blue Man” FBX file (the stock character that is being spawned when you press <PLAY> ).
*Where exactly is this code located?
Am not 100% sure if i understand the qustion you are asking.
If you are looking for the import code that handels the importing of the Animation for the FBX model.
Or if its where the animations are actualy loaded at Runtime.
If its the later i think you should have a look at the Animation Blueprint.
See Doc: UAnimBlueprint::
, thanks for the reply.
I am in fact interested in the whole nine yards of the animation chain.
*When we specify an animated character, for example a Mixamo character, how and where is this FBX file loaded in the game?
*How do we separate the animation part of the FBX and load it into the game?
Hi Frederic,
The FBX isn’t used at runtime. It is imported once and used to create .uasset files, which are actually used at runtime. For example, let’s take a FBX that contains a rigged mesh. This will create three assets by default, although you can turn off the creation of one, and point to an existing asset for the other if desired.
FileName (USkeletalMesh - this contains the rendering data such as the mesh/verticies/weights/etc…)
FileName_Physics (UPhysicsAsset - this contains the physics body setup for the mesh, used for both collision and rendering bounds calculations)
FileName_Skeleton (USkeleton - this contains the bone hierarchy, and is referenced from the USkeletalMesh and any UAnimAssetBase subclasses as well)
Now when you import a FBX containing one or more animations, you need to chose the skeleton they will play against (you can share animations across several skeletal meshes as long as they share the same skeleton). When imported, these create a UAnimSequence asset per sequence. If you just want to use/apply animations you’re done now, you don’t have to worry about FBX under the hood/etc…, just play these assets.
If you’re looking for the lower level code, check out the FBX importer code starting at UFbxFactory. If you just want to look at how animations are handled, UnFbx::FFbxImporter::ImportAnimation handles taking a single animation sequence from the FBX hierarchy and turning it into raw/source anim data in a UAnimSequence. We then compress that data (the PostProcessSequence call) into a format the rest of the runtime consumes.
Cheers,
Michael Noland
Michael, hi! Wow, very detailed reply. Thanks.
After going though your post, I will be concentrating on the .uasset files.
All I want is to get hold of the animations ( in specific the bone transforms for the animations) and write them to a texture in the video memory.