Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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: 

How to get The transform Matrix of a Node In a Specify Time

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
andrestronic12
753 Views, 4 Replies

How to get The transform Matrix of a Node In a Specify Time

Hi.

 

People in this moment I have a big problem, I have a simple animation using Maya CubeMan, I can get the Fps values and the time of the animation but, When I get the Matrix in a specify time from a node is always the same is a Identity Matrix But my Node is Rotating in the animation here my code.

 

 

 

 

myTakeCount = importer.GetTakeInfo(0)
print(myTakeCount.mName, 'Name Of the animation take')#Imprimo el nombre de la toma
start = myTakeCount.mLocalTimeSpan.GetStart()
end = myTakeCount.mLocalTimeSpan.GetStop()


b = scene.GetNode(2)
print(b.GetName(), 'Name of de Node')





CurrenTime = FbxTime()
for i in range(start.GetFrameCount(FbxTime.eFrames24), end.GetFrameCount(FbxTime.eFrames24)):

    CurrenTime.SetFramePrecise(i, FbxTime.eFrames24)
    TransforMatrix = b.EvaluateGlobalTransform(CurrenTime, FbxNode.eSourcePivot, False, False)
    print("imprimiendo Matrix De Transformacion")
    print(*TransforMatrix[0])
    print(*TransforMatrix[1])
    print(*TransforMatrix[2])
    print(*TransforMatrix[3])

print("Finalizar")

 

 

 

 

Example1.JPG

 

Thanks

Tags (3)
4 REPLIES 4
Message 2 of 5

I had a look at your FBX file -- you have all your animation keys directly on the mesh itself -- which is not something I handle.  -- Usually you have animations on joints that deform the mesh, -- but in your case you don't have deformation, -- but in terms for scalability it's still much better to have skinned animation, but more time consuming to implement.

 

I'm not super familar with python fbx handling -- but for me, I walk the entire hierarchy of the fbx scene, and then grab out animation keys on the node. 

 

I'm assuming your line of code taking the take from "GetTakeInfo(0)" -- is breaking your stuff. 

Each FbxNode has it's own list of takes, and yours is probably returning empty because it is just the take on the first root node. -- Which in your scene has no animation keys. 

Message 3 of 5

Hey Thank you.

 

Yes My fbx File has two takes, In the first take there is no animation, In the other Yes, My animation is on the mesh beceause I just only need an example to take Matrix Transformation for the Nodes animation.

 

my next Objetive is to get the mesh deformations and play the animation

 

Thank you so Much.

 

Thanks.JPG

Message 4 of 5

If you want mesh deformations to work, -- you need to pretty much change everything with your scene. 

 

Also requires somebody with experience with generating a rigged model, though I suppose anyone can learn it

Message 5 of 5

Hi. 

 

Thanks, In this model I don't need to change anything, I only need one Example to Get the transformation Matrix in a specify time "I'm not  3D artist" I just need to play simple animations in the program, Other person will make the animatios, Thanks

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

Post to forums  

Autodesk Design & Make Report