Help with a Maya Command in Mel / Python

Help with a Maya Command in Mel / Python

Anonymous
Not applicable
933 Views
2 Replies
Message 1 of 3

Help with a Maya Command in Mel / Python

Anonymous
Not applicable
I’m programming in Python and using Maya commands. I’m currently calling the Maya command cmd.MirrorCutPolygonGeometry( ). I would like to control the variables of this command. For example, how to specify arguments for the mirror direction, such as +y or -z.
 
Unfortunately, when Python, or MEL calls out this command, it defaults to the last used direction, not allowing me to change the direction while running a loop let’s say. Is there I way to do specify this? I have scoured the depths of the internet looking for arguments but have found little or no documentation anywhere. Maya, Mel and Python documentation list no variables.
 
Any help will be greatly appreciated.

 

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

santd
Autodesk
Autodesk

@Anonymous,

 

Thank you for posting to the forums.

 

Unfortunately there are certain commands or procedures in which the options can not be accessed through MEL or Python and the options are taken from the settings set in the options or from a procedure within one of the program scripts. As you can see if I run the help command for that command it states that there are no flags available for it:

 

help MirrorCutPolygonGeometry;
// Result: 

Synopsis: MirrorCutPolygonGeometry
No Flags.


Command Type: Run Time Command
 // 

Sorry for not having a solution on that one. Currently the only way is to set the options you want then run the command. May be able to save those options as preferences then place those prefs on other user machines prior to running the command so that it actually runs the options you want, but unfortunately no flags are available for that particular command.

 

Cheers,




David Santos

0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks, but I found the answer thorough Matthew Bendy at Autodesk:

What you have there is a runtime command, not a normal command, which is why it takes no arguments.
You can tell this in Maya by doing:
whatIs MirrorCutPolygonGeometry;
// Result: Run Time Command //
If you enable “echo all commands” in the script editor you should see that it ends up calling performPolyMirror. If you run whatIs on that then you’ll see that it’s a Mel procedure, and the procedure ends up calling polyMirrorFace…which is the command you’re looking for.
http://help.autodesk.com/cloudhelp/2017/ENU/Maya-Tech-Docs/Commands/polyMirrorFace.html

Runtime commands are a thing that we attach to menu items. they have a command that they actually call when they are called themselves, but we can also give them categories...and tooltips...and a few other parameters

so you call the runtime command -> it calls something else. In most cases that will be a Mel proc which usually looks up a few options, i.e. whatever the current options are in the menu's option box, builds up the real command as a string and then executes that. If you're looking to be very explicit about what gets called then you're probably looking for that final "real" command. which is why you found that it was just calling whatever the current options were at the time. That's what clicking the menu item is supposed to do."


Alex Loyer Hughes A.I.A.
Vice President of Interior Design


[cid:6BCDEBA4-17CF-4379-B235-0E549690AD2D@karimrashid.com]




Karim Rashid Inc
428 West 54th Street
New York NY 10019
P 1 212 929 8657 ext 229
F 1 212 929 0247
www.karimrashid.com


Alex Loyer Hughes R.A., A.I.A.

Alexander Loyer Architect PLLC
428 West 54th Street
New York NY 10019
P 1 212 929 8657 ext 229
F 1 212 929 0247
www.karimrashid.com


Confidentiality Note: The information in this electronic mail message maybe confidential and for use of only the named recipient. The information may be protected by privilege, work product immunity or other applicable law. If you are not the intended recipient the retention, dissemination, distribution or copying of this e-mail message is strictly prohibited. If you receive this email message in error please notify us immediately by telephone at 212 929 8657 or by email at office@karimrashid.com. Thank you.
0 Likes