run MEL procedures within PYTHON?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 05 May 2009   #1
run MEL procedures within PYTHON?

Hi all,

I've discovered a MEL global procedure ( doPaintEffectsToPoly ) that's loaded with Maya. However such a module does not exist in python- so is there a way to run a mel command/global procedure within Python?

Thanks, I eagerly await your response.
Old 05 May 2009   #2
Yup there is. Look up the eval Python command. Example shows this:
import maya.mel as mel
mel.eval('match "a+b+" "abbcc"')

You can also get variables from mel like this:

Ryan Trowbridge
Character TD
NaughtyDog Inc
Old 05 May 2009   #3
Thanks man! By the way- we've been emailing recently- I'm the guy in New Zealand! Seems you're quite active online...
Old 05 May 2009   #4
Ahh thats funny. Yes I try to be when I can.

Another thing when you want to call commands 95% can be called with Python because they are real commands. Autodesk started adding scripts to the commands help documents and those have a blue icon next to them to signify that. So As long as it doesnt have the blue icon you can call it like normal. Otherwise you have to do the import maya.mel thing.
Ryan Trowbridge
Character TD
NaughtyDog Inc
Old 05 May 2009   #5
well good on yah mate!
thanks again for your help, without people like you learning would be a cold painful experience!
Old 05 May 2009   #6
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 12:43 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.