python call inside mel
How can I pass a Mel string variable into a python call from within a mel script ?
so I want to do something like this ... but this doesn't work: string $myString; string $myList = python("myString.split(':')"); Studio where I work cannot move totally to Maya python, but I would like to take advantage of python's string, list, and re methods from within a mel script. I'm wondering if anyone out there has done something similar. I thing I need to precede with another python call to create the python string object named myString .... but still can't get anything to work ... |
Hi suzanne,
I've played about with this in the past and the following should help you on your way. The thing to remember is to make sure the python() call uses double quotes immediately inside it and then to escape any python special characters or quotes. e.g, Code:
python("myVar = \"hello\""); Simon |
All times are GMT. The time now is 09:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018