RMB markingMenu Button on specific controller.

52 views
Skip to first unread message

Soham Parmar

unread,
Jun 19, 2020, 12:08:18 AM6/19/20
to Python Programming for Autodesk Maya
Hi Guys,
I wanted to make custom markingMenu button like "IK / FK Snap" whenever i RMB on "IK_ctrl". I don't want that markingMenu button on other controllers.
can anybody please help, I want to do in python.

Thanks.

vince touache

unread,
Jun 30, 2020, 5:57:07 PM6/30/20
to Python Programming for Autodesk Maya
one way or another, you'd have to override the dagMenuProc from maya, which is in MEL. But if you want to do it in python, nothing prevents you from calling some python code inside the MEL proc, and passing the objectName, I suppose. 

Run (in MEL):
whatIs dagMenuProc
to find the proc on your machine
Then go to the dagMenuProc function, and from here, you can do whatever you want, since the name under your cursor is given (by $object)

hope this helps

Soham Parmar

unread,
Jul 1, 2020, 8:06:29 AM7/1/20
to python_in...@googlegroups.com
Oh so that means if i share the rig file that function wont be available in different machines we haven't edited on that pc, am i right?

thanks!

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/dea2503e-5a1c-46bb-9813-5b48aabe65cao%40googlegroups.com.

vince touache

unread,
Jul 1, 2020, 10:08:39 AM7/1/20
to Python Programming for Autodesk Maya
not necessarily, you can provide your version of the script and ask the person who'll use your rig to run it everytime he uses your rig. Then, run the original version when he's done, so it doesn't screw his RMB in case you do something you shouldn't in your script.
Alternately, you can trigger your script yourself with a scriptJob


Le mercredi 1 juillet 2020 08:06:29 UTC-4, Soham Parmar a écrit :
Oh so that means if i share the rig file that function wont be available in different machines we haven't edited on that pc, am i right?

thanks!
On 01-Jul-2020, at 3:27 AM, vince touache <fruit...@gmail.com> wrote:

one way or another, you'd have to override the dagMenuProc from maya, which is in MEL. But if you want to do it in python, nothing prevents you from calling some python code inside the MEL proc, and passing the objectName, I suppose. 

Run (in MEL):
whatIs dagMenuProc
to find the proc on your machine
Then go to the dagMenuProc function, and from here, you can do whatever you want, since the name under your cursor is given (by $object)

hope this helps

Le vendredi 19 juin 2020 00:08:18 UTC-4, Soham Parmar a écrit :
Hi Guys,
I wanted to make custom markingMenu button like "IK / FK Snap" whenever i RMB on "IK_ctrl". I don't want that markingMenu button on other controllers.
can anybody please help, I want to do in python.

Thanks.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages