Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Different calculate result when convert pivot animation between sdk2018 and sdk2020

Different calculate result when convert pivot animation between sdk2018 and sdk2020

xingyufengVVWJC
Explorer Explorer
266 Views
0 Replies
Message 1 of 1

Different calculate result when convert pivot animation between sdk2018 and sdk2020

xingyufengVVWJC
Explorer
Explorer

Problem Describe:

Consider this joint orientation in the picture,

xingyufengVVWJC_1-1733799145505.png

it's lcl rotation is (-143.73, 24.61, 13.34) and rotation order is zyx, at the same time, we have some prerotation which it's value is (-131.91, 12.11, -115.21), so in order to get rid of this prerotation, i set the destination pivotset's prerotation is zero and keep the rotation order as the source. It's code like below:

 

Python:

def set_node_state_recursively(node)

    zero_vec = FbxVector4(0, 0, 0, 0)
    source_rotation_order = node.GetRotationOrder(FbxNode.EPivotSet.eSourcePivot)

    node.SetPivotState(FbxNode.EPivotSet.eSourcePivot, FbxNode.EPivotState.ePivotActive)
    node.SetPivotState(FbxNode.EPivotSet.eDestinationPivot, FbxNode.EPivotState.ePivotActive)

    node.SetPreRotation(FbxNode.EPivotSet.eDestinationPivot, zero_vec)
    node.SetPostRotation(FbxNode.EPivotSet.eDestinationPivot, zero_vec)

    node.SetRotationOrder(FbxNode.EPivotSet.eDestinationPivot, source_rotation_order)

    for i in range(node.GetChildCount()):
        set_node_state_recursively(node.GetChild(i))
   
def convert_animation(root_node)
    set_node_state_recursively(root_node)
    root_node.ConvertPivotAnimationRecursive(None, FbxNode.EPivotSet.eDestinationPivot, 60, False)

 

But in sdk 2018.1.1 it will get result with final rotation (-32.49, -90.00, -32.49) which is wrong, but in the sdk 2020.3, it's result will be (45, -90, -45). From visual perspective, the 2020.3 sdk get the right result.

 

So, I am quite curious about what happened behind the sdk and why it calculate different result,thank you in advance and hope get some help from fbx guys.

 

0 Likes
267 Views
0 Replies
Replies (0)