Community
FBX Forum
Welcome to Autodesk’s FBX Forums. Share your knowledge, ask questions, and explore popular FBX topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Node connected to Bone problem

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
400 Views, 6 Replies

Node connected to Bone problem

Hi

Our FBX parser seems to work fine with rigid meshes, and bones, but seems to have a problem when a mesh is attached as a child of a bone.

We have a simpoe object with a bone with seven cubes attached to it all as sibling children. They should be arranged in a 3d cross shape around the centre cube, such that the centre cube is at 0,0,0, and there are cubes in each direction along X Y and Z at distances 100 units away.

When we use KFbxXMatrix matTransform = pNode->GetGlobalFromDefault() to read the matrices of the cubes, we indeed get seven cubes based around a middle one, and they all so seem to be facing the same direction, also they are 100 units away from the centre, but they are all offset at different angles, not at right angles from each other. I've tracked the problem dpown the the results coming from the above call.

The angle of the cubes, while consistent with each other, doesnt seem to be the same as the bone to which they are connected (though this may be down to how they are attached)

What coudl possibly be goign wrong ? Am I missing a call to initialise the matrices correctly ? Am I using the wrong call ? Could it be a pivot or offset problem, or another matrix I'm not taking into account ?

We just use this to initialise and load the scene

InitializeSdkObjects(lSdkManager, pFbxScene);
lResult = LoadScene(lSdkManager, pFbxScene, name);


An image is attached of what the cubes look like when rendered. They shoudl all be attached squarely along their faces...



Thanks for your help

Shaun Southern

6 REPLIES 6
Message 2 of 7
Numerator
in reply to: Anonymous

Can you post the FBX file? Use .zip
Message 3 of 7
Anonymous
in reply to: Anonymous

Sure, here you go. There may well be something odd about the setup... This file has been exported from Max. I'm not sure if this fbx file loads back into Max ok, I cant test that until tomorrow...

parent_test_mesh.zip

Message 4 of 7
Numerator
in reply to: Anonymous

Are you taking into account the frame hierarchy? It looks like a straight forward unskinned bone dependency with each bone controlling 7 boxes.
Message 5 of 7
Anonymous
in reply to: Anonymous

Hi

We loaded the fbx file back into Max, and its fine.

Yes, the file shoudl be three bones, each with seven boxes attached to it. That was our problem, meshes attached as children of bones.

Somethign is very wrong about the angles/positioning of the boxes, as you can see from the picture - they're not even at right angles offsets to each other..


So what do you mean by taking into account the "frame heirarchy" ? Do I need to call a fucntion after loading the fbx to sort this out ?

I just use GetGlobalFromDefault to read each object's global matrix - or so I thought....


Thanks again

Shaun
Message 6 of 7
viviane.rochon
in reply to: Anonymous

Hi Shaun,

Which version of the FBX SDK are you using?
In 2011.3.1, you should use lScene->GetEvaluator()->GetNodeGlobalTransform(lNode); to get the global transform of a node.

Viviane


Viviane Rochon Montplaisir
Message 7 of 7
Anonymous
in reply to: Anonymous

OK, thanks again for the replies. I changed the function and it was still the same. I couldn't understand why the data coming out was wrong as it came straight from that function, then was output to our file.

Or so I thought.....

In the output matrix function, there was code to flip the matrices from Max's Z-UP format to Y up. It had worked with everythign we'd done so far, however.... one of the matrix multiplies was the wrong way round... which hadn't mattered because most of our objects were simple enough and lined up along Z. So unit matrix * rotate Z to Y worked either way. However, as soon as one of the matrices was offset at an angle, which the bones were, there was a problem. The cubes attached to the bones looked in line, but they were cubes and actually roated 90 degrees in X and Z to the bone. So becasue the matrix multiplies were the wrong way round, all hell broke loose.

Thanks again for everyone's help, it only went to prove that the problem wasn't in the FBX code or the model, which led me to look a little deeper and try something I wouldn't have bothered with otherwise....


Until the next time !


Shaun Southern

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report