- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'd like to pass a variable from my .py script into an expression using the PyMel Expression node / function. I'm new to PyMel / Mel and the documentation (http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/PyMel/generated/classes/pymel.core.nodety...) is slightly hard to figure out as it doesn't seem to provide examples. I've been able to get this much to work in my .py script
y = 20 # unused
exp = Expression() exp.setExpression("thing1.rotateY = 20") exp.evaluate()
However, having difficulty finding the best way to get y to be used in place of the 20 in the assignment of rotateY (I imagine there's a fairly simple / standard way to do this). Note I'm not planning on having y change in the .py script (or expecting the expression to be updated with values provided by that script. y is more or less a precalculated constant).
Thanks
Solved! Go to Solution.