View Full Version : Mel variables in Python
fallenrelics 12-07-2008, 12:06 AM Is there anyway to use to pass variables i globally declared in mel to python?
|
|
NaughtyNathan
12-07-2008, 12:25 AM
Press F1 to open the Maya docs, then browse to: Using Maya > General > Python > Important differences between MEL and Python.
The info you want is at the bottom of the page: Returning Results.
You could also have found it by using the search feature in the Maya docs or the search feature on this forum. :)
:nathaN
fallenrelics
12-07-2008, 12:44 AM
import maya.mel myPythonVariable = maya.mel.eval ('global $myMELvariable; $temp=$myMELvariable;' )
this code wasn't working when i was trying it. turns out i needed to add string. thanks for the quick response.
import maya.mel myPythonVariable = maya.mel.eval ('global string $myMELvariable; $temp=$myMELvariable;' )
CGTalk Moderation
12-07-2008, 12:44 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.