0

I am trying to read FBX file of human and I need to get the joints out of it, I encountered several nodes marked as 'LimbNode' with names of different limbs, I'm pretty sure those are the joints, however I couldn't understand how to find the vertex match to that specific node, for example I have the following attribute in the file:

["Model", [49742448, "mixamorig:HeadTop_End::Model", "LimbNode"], "LSS", [
        ["Version", [232], "I", []],
        ["Properties70", [], "", [
            ["P", ["RotationActive", "bool", "", "", 1], "SSSSI", []],
            ["P", ["ScalingMax", "Vector3D", "Vector", "", 0.0, 0.0, 0.0], "SSSSDDD", []],
            ["P", ["DefaultAttributeIndex", "int", "Integer", "", 0], "SSSSI", []],
            ["P", ["Lcl Translation", "Lcl Translation", "", "A", 0.0, 2.353147506713867, 0.8237115740776062], "SSSSDDD", []]]],
        ["Shading", [true], "C", []],
        ["Culling", ["CullingOff"], "S", []]]]

(It's a FBX file downloaded from Mixamo) I see the number 49742448, and I think it's some internal id of the FBX file, however I can't find how to translate it to a point/vertex on the mesh. This number appears again only at the tree joint specification, and there's no translation to a point in the mesh.

user2207686
  • 107
  • 1
  • 8

1 Answers1

1

Disclaimer: I am just currently exploring the fbx files myself, so I am no expert;

"Lcl Translation" means "local translation", so this may be the translation you are looking for. It probably is the translation relative to its parent.

Be aware of AnimationCurveNodes, which can change the translation / rotation for animations.

Antonio Noack
  • 309
  • 3
  • 11
  • Thank you for the answer! What do you mean by "translation relative to it's parent"? parent in the joint tree? if so, how can I find the indices of the tree root? – user2207686 Sep 16 '20 at 13:05
  • yes, in the joint tree. The bones don't have fixed indices as far as I have seen; you can define them yourself. Best probably is to start with the root, and then walk to the leaves. In my file from Mixamo, there is Deformer elements, which define the limbs as well (additionally to the Model elements). They include a full (local(?)) transform. – Antonio Noack Sep 16 '20 at 14:59
  • Thanks! may I ask another question - under Object-Geometry I have the following: `["Geometry", [73135712, "Group1mesh::Geometry", "Mesh"], "LSS", [["Vertices", [[-1.3143, 15.0686, ...` Do you have any idea what the number **73135712** represents? as far as I can see it only appears here and in the joint tree, but there's no explanation if this a joint or something else. – user2207686 Sep 16 '20 at 21:14
  • Yes, as you already had guessed, it's a unique ID for every object. Effectively, it's a pointer (like in C/C++). The "joint tree" is more of a hierarchy of all objects. Additionally, I have seen property overrides with the type OP (surely object-property) instead of OO (surely object-object) within. OP appears for texture bindings and animated properties. – Antonio Noack Sep 18 '20 at 03:19
  • Objects without ID, like Properties70, are probably meant in general as collections of attributes (or class variables), maybe structs. – Antonio Noack Sep 18 '20 at 03:21
  • Thanks a-lot! Last question(sorry for all that questions but you are the only one I met who knows something about FBX). Do you have any idea how to calculate the mesh position at a specific keyframe? i.e, given for example frame 2, how can I calculate the vertices position? How can I know which joints are moving in this frame, and how to find the joints matrices correspond to that frame? I know how to do it in Collada file, and I though FBX is similar to Collada, but apparently it's very different and I'm very confused. Thanks! – user2207686 Sep 21 '20 at 09:46
  • I see the section 'AnimationCure', which I believe holds all animations data, but I can't figure out how to extract the 4x4 joints matrices for the frame, I have there only few key attributes that none of them seem to have any useful information of the frame. I know how to extract the weights and vertices of each frame, the homogenic matrices but I'm stuck with the joint matrices for each frame – user2207686 Sep 21 '20 at 09:49
  • I am sorry, but I haven't yet worked on this specifically. The AnimationCurve objects contain the values for each property, axes separated; they have a KeyTime property, which is the time points in 1e9 * frame index (in my case), and the property KeyValueFloat, which holds the values. – Antonio Noack Sep 21 '20 at 12:44