|
hi, all
i want to wirte a plugin with sdk, is it possible to call mel command in my plugin? and how?
Thanks in advance.
|
|
|
|
see here
http://ewertb.soundlinker.com/api/api.019.htm
How do I execute MEL commands from the API? And why would I want or need to execute MEL from the API?
Yes, it is possible to execute MEL commands from the API. Sometimes it’s a convenience, but there are times you have no other choice. There are two methods in the API for this purpose:
MGlobal::executeCommand()
MDGModifier::commandToExecute()
The difference between these two is how the Undo is handled. Refer to this useful reply from Dean Edmonds in the Maya Developer’s Mailing List:
http://www.highend3d.com/maya/devarchive/sp.3d?mail_id=3583
To précis: You can use MDGModifier::commandToExecute() to “stack” MEL commands so that a series is controllable through a single undo/redo event. Using MGlobal::executeCommand(), each MEL command creates an additional undo/redo event. If you are executing many small or iterative commands it would be inconvenient for the user to require multiple undos, and filling up the queue means that it would be impossible for the user to completely undo to a previous state.
|
|
|