Python with dR_selConstraintAngle, dR_selConstraintOff

Python with dR_selConstraintAngle, dR_selConstraintOff

00Six00
Contributor Contributor
491 Views
2 Replies
Message 1 of 3

Python with dR_selConstraintAngle, dR_selConstraintOff

00Six00
Contributor
Contributor

Im curious if the commands dR_selConstraintAngle and dR_setSelConstAngle have any documentation anywhere or if anyone knows any ways of querying these commands. Ive read some code snippets that use globals with switch statements in mel to control whats going on in the modeling toolkit but I would like to avoid that. Any help would be appreciated.

0 Likes
492 Views
2 Replies
Replies (2)
Message 2 of 3

Kahylan
Advisor
Advisor

Hi!

 

There isn't really any documentation on dR_selConstraintAngle since it is purely an execution command that gets triggered when the UI is changed.

 

The mode change can either be triggered by using the separate commands for each mode

 

dR_selConstraintOff()

dR_selConstraintAngle()

dR_selConstraintBorder()

dR_selConstraintEdgeLoop()

dR_selConstraintEdgeRing()

dR_selConstraintShell()

dR_selConstraintUVEdgeLoop()

 

or by using the dR_DoCmd() command and feeding it the string that relates to the command, for example:

dR_DoCmd("selConstraintAngle")

 

All of these commands are in the maya.cmds library, some of them have a pymel or CPMel equivalent.

 

As far as I know, none of these commands are queriable. But they also don't throw any errors if the state that overwrites the setting is the same as the current state.

 

I hope this helps!

 

0 Likes
Message 3 of 3

brentmc
Autodesk
Autodesk

Hi,

 

Look at the dR_setSelConst function in drInit.mel (in your Maya installation) and the other related functions in that file.

These commands are just calling polySelectConstraint to toggle various constraints, set/query the angle etc.

https://help.autodesk.com/cloudhelp/2023/ENU/Maya-Tech-Docs/Commands/polySelectConstraint.html

off: 

polySelectConstraint -bo false -bp false -sh false -cr false -ap false -lp false -rp false -ulp false;

angle:
polySelectConstraint -bo false -bp false -sh false -cr false -ap true -lp false -rp false -ulp false;
 
Brent McPherson
Principle Engineer