Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX SDK / ResetPivotSetAndConvertAnimation issue
  RSS 2.0 ATOM  
2 pages: 1.2 last

ResetPivotSetAndConvertAnimation issue
Rate this thread
 
41155
 
Permlink of this thread  
avatar
  • TheSauce
  • Posted: 25 March 2010 11:11 AM
  • Total Posts: 19
  • Joined: 16 September 2008 01:45 AM

Hey, I’ve been using ResetPivotSetAndConvertAnimation() for a while now without any issues.

However a user has given me a .FBX that doesn’t import correctly. It has 2 takes in it and only 1 take looks correct.

If I compare the broken take’s animation channels with animation channels that I get without calling ResetPivotSetAndConvertAnimation(), they are identical. So this means that ResetPivotSetAndConvertAnimation() is doing nothing to the 2nd take.

Now here’s the tricky part, if I reverse the order that ResetPivotSetAndConvertAnimation() gets call on the takes (so the 2nd take is converted first), the 2nd take converts fine and the 1st take is wrong instead.

Any ideas?



Replies: 0
avatar

Hi, TheSauce
Could you describe the way you call ResetPivotSetAndConvertAnimation() in more detail, maybe put your code snippet here and also provide the FBX file you used for this?
We will take a further look.
Thank you.



Jiayang Xu
Maya Data Platform
Autodesk

Replies: 0
avatar
  • TheSauce
  • Posted: 30 March 2010 12:36 PM

Hey,
I load the scene, then I traverse the entire node tree and call
SetPivotState(KFbxNode::eSOURCE_SET, KFbxNode::ePIVOT_STATE_ACTIVE) on every node

Then in a loop for each take I call
SetCurrentTake(takeName)
GetRootNode()->ResetPivotSetAndConvertAnimation()

Finally I call
SetPivotState(KFbxNode::eSOURCE_SET, KFbxNode::ePIVOT_STATE_REFERENCE) on every node

Here is the .fbx file that shows the issue.

I’ve been able to import other multi-take .fbx files without issues before.



Replies: 0
avatar
  • TheSauce
  • Posted: 30 March 2010 12:37 PM

Attachment not working, trying again



Replies: 0
avatar
  • TheSauce
  • Posted: 30 March 2010 12:39 PM

Trying with the filename renamed



Replies: 0
avatar
  • TheSauce
  • Posted: 30 March 2010 12:40 PM

Hmm dunno, it’s only 1.5 megs so if you give me an email address I can send it to your directly.



Replies: 0
avatar

Hi,

Maybe your issue has been solved, but if you still need to email files, you can use fbxsdk (at) autodesk.com.

I think the AREA only accepts .txt, maybe .zip, as attachments.

Regards,

Viviane



Viviane Rochon
Maya Data Platform
Autodesk

Replies: 0
avatar

This post specifies how to attach files on the AREA.
http://area.autodesk.com/for...ea-ate-my-attachment40s41/



Viviane Rochon
Maya Data Platform
Autodesk

Replies: 0
avatar
  • TheSauce
  • Posted: 22 April 2010 09:57 AM

Ya it’s still an issue, here’s the file.



Attachment Attachment
Replies: 0
avatar

Hi, TheSauce,
Here are some findings:
1. I think for files with multi-takes, ResetPivotSetAndConvertAnimation() should not be called, which will reset SourceSet after it handle the current take, then the other takes won’t be converted correctly. This function should only be used once on current take, we will improve document to including this information.

For your case, what you should do is something like this:
for all takes: 
Step1: lRootNode->ResetPivotSet( KFbxNode::eDESTINATION_SET )
Step2: SetPivotState(KFbxNode::eSOURCE_SET, KFbxNode::ePIVOT_STATE_ACTIVE) on every node.
Step3: ConvertPivotAnimationRecursive()

After handle all takes,
lRootNode->ResetPivotSet( KFbxNode::eSOURCE_SET )

2. To call ResetPivotSetAndConvertAnimation(), you actually do not need to SetPivotState(KFbxNode::eSOURCE_SET, KFbxNode::ePIVOT_STATE_ACTIVE) on every node.
Internally the function itself will do so recursively (We will improve document to including this information), so you just need to call it this way:

lRootNode lScene->GetRootNode()
ResetPivotSetAndConvertAnimation(lRootNode)


Jiayang Xu
Maya Data Platform
Autodesk

Replies: 0
avatar
  • TheSauce
  • Posted: 26 April 2010 08:50 AM

Thanks for the info. This seems to work.
Can you confirm a few things?

I should call ConvertPivotAnimationRecursive() with KFbxNode::eDESTINATION_SET as the first parameter, right?

After I’m done all this, should I still call SetPivotState(KFbxNode::eSOURCE_SET, KFbxNode::ePIVOT_STATE_REFERENCE)? And should I do that once per take?

Thanks



Replies: 1
/userdata/avatar/vx3501hqr_small.jpg

Yes, you should call ConvertPivotAnimationRecursive() with KFbxNode::eDESTINATION_SET as the first parameter, which means to convert from SourceSet to DestinationSet.

After you are done all this, it depends on you to reset source pivot or keep source pivot but set them to be reference. And you do not need to do so on per take, pivot is only related to nodes, not to takes.

Here is a brief documentation about pivot, for more details please check documentation of KFbxNode in 2011.2 SDK:
* A node has two pivot contexts defined by the EPivotSet enumeration. The node’s animation
* data can be converted from one pivot context to the other. Each context can be set to be
* either active or passive (reference). By default the two pivot contexts are passive. They
* need to be active to be processed during the evaluation of the node final transformation
* matrix. In its passive state, a pivot context can still be accessed to retrieve its content
* for any other required purpose.

Author: Jiayang Xu

Replied: 26 April 2010 03:10 PM  
2 pages: 1.2 last