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.

What IS broken in C++ API?

What IS broken in C++ API?

RPYTHON
Advocate Advocate
397 Views
1 Reply
Message 1 of 2

What IS broken in C++ API?

RPYTHON
Advocate
Advocate

Sup guys, we're have an unresolvable problem and I'm pretty sure it's 'cause the Maya API is broken after Maya 2018 release.

 

So, I present to you simplified example of c++ code that gives CORRECT results in May 2018.2, and completely INCORRECT results in Maya 2019 and higher.

 

 

 

 How to use it:

1) compile plugin.cpp with visual studio

or

1.1) copy compiled plugin test_skeleton_import.mll from archive to C:\Program Files\Autodesk\MayaNNNN\bin\plug-ins

2) enable test_skeleton_import.mll in plugin manager

3) in script editor execute this command:

 

 

test_skeleton_import

 

 

4) in Maya 2018 you will see correctly oriented joints, but not in Maya 2019 and higher (we tested it on 2019.3.1, 2020 and 2022 versions to be exact).

 

 

Source code and compiled .mll for Maya 2018 and 2019 in .zip below.

0 Likes
Accepted solutions (1)
398 Views
1 Reply
Reply (1)
Message 2 of 2

RPYTHON
Advocate
Advocate
Accepted solution

In the end, it turned out that nothing is broken.

 

 

joint_fn.setOrientation(MEulerRotation(-rx, -ry, rz, MEulerRotation::kZXY));

 

 

The order of the angles must be only kXYZ, or a quaternion must be used. And if you set the angles in a different order, then all of it breaks (until the 2019 version after reloading the scene, and starting from 2019 immediately).

So, this code works fine:

 

 

joint_fn.setOrientation(MEulerRotation(...).asQuaternion())