Python commands in marking menu

129 views
Skip to first unread message

Meng-Yang Lu

unread,
Aug 28, 2009, 1:13:32 PM8/28/09
to maya...@googlegroups.com
This is a noob question I'm sure. 

How do I get my python commands working in marking menus?  They're defined as functions, but they're not being sourced/imported properly. 

Thanks in advance,

-Lu

Chris Bayol

unread,
Aug 28, 2009, 1:42:06 PM8/28/09
to maya...@googlegroups.com
I'd love to know this as well, any ideas?

CharlieWales

unread,
Aug 28, 2009, 1:44:37 PM8/28/09
to maya...@googlegroups.com

I think you can use the  the "python" mel command to send a string as python commands.

I'm using it this way:

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
menuItem -l "Wiimote Device Editor" -c "python(\"from cra_wiiMan import *\\ncra_wiiMan()\")";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Escaping each line by \\n as it is also within a string so you have to escape \ to \\ to use the \n (new line) escape code . You need having your py file in one of you scripts directories or PYTHONPATH defined directories to import it properly.

Don't know if that's what you're asking. Hope it helps.


2009/8/28 Meng-Yang Lu <ntmo...@gmail.com>

Meng-Yang Lu

unread,
Aug 28, 2009, 2:47:10 PM8/28/09
to maya...@googlegroups.com
Ah  cool.  Gonna give that shot.  Thanks! 

-Lu
Reply all
Reply to author
Forward
0 new messages