Ah yes. The quotes didn't read very easily, sorry.

<SQ> = single quote
<DQ> = double quote

python(<DQ>import ZebraRig\nZebraRig.doLeftSwitch(<SQ><DQ> + $refname + 
<DQ><SQ>)<DQ>);

What you are doing is just wrapping the value of $refname in single quotes, so 
that when python see it, it will be:
(assuming $refname = "fooName")

import ZebraRig
ZebraRig.doLeftSwitch('fooName')


MEL and Python are two separate environments, so they cannot see each others 
varaible, unless you use something like this, or an intermediate storage like 
optionVar. But this string concat should work. it was just a misunderstanding 
of the format.


On Oct 14, 2012, at 10:34 AM, Bay wrote:

>  python("import ZebraRig\nZebraRig.doLeftSwitch('''+$refname+''')");
> 

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to