Control Constraint Priority Programmatically

Control Constraint Priority Programmatically

antoine.trottier-delorme6DR7D
Observer Observer
337 Views
0 Replies
Message 1 of 1

Control Constraint Priority Programmatically

antoine.trottier-delorme6DR7D
Observer
Observer

In my plugin I need to change constraint priority, the only info I found about this is here:

 

https://knowledge.autodesk.com/support/motionbuilder/learn-explore/caas/CloudHelp/cloudhelp/2022/ENU...

 

However it seems like there is no way to do this programmatically (either C++ or python).

 

I tried to do a test by moving the last constraint to the first position however this is not allowed

import pyfbsdk
scene = pyfbsdk.FBSystem().Scene
# Test, try to put the last constraint in the list in the first position
constraints = scene.Constraints
myConstraint = constraints.pop()
constraints.insert(0, myConstraint)

# Returns the following error:
# Traceback (most recent call last):
#   File "<string>", line 1, in <module>
# NotImplementedError: can only insert at the end of a property list

 

Is there any way to do this? Obviously you can do in the navigator, however I did not see any way of doing it in my plugin...

 

Any help would be appreciated.

0 Likes
338 Views
0 Replies
Replies (0)