View Full Version : executing mel script files by using API

05 May 2007, 12:36 PM
Hi there;
I have been trying to use the "source melScript.mel" command of mel to execute from api by MGlobal::executeCommand function. but it seems that it doesn't work.

Do I have to register the sript file name or something like that similar to the command creation??? No idea :(

I also give the full path before the melscript.mel file name. But it seems it still doesnt work?

Any idea??

Thanks a lot;

Melis :)

05 May 2007, 01:01 PM

source is not a command but a directive for MEL interpreter. So it practically has one argument and that should be hardcoded (not a variable) string. What you are missing are the quotes for the interpreter to understand that your name is a string.

Thus try:

MString command ("source \"melScript.mel\"");
MGlobal::executeCommand (command ... );

Hope that helps,

05 May 2007, 08:45 PM
Hi Henry;

Thanks a lot, it was just as you mentioned, it worked :)


CGTalk Moderation
05 May 2007, 08:45 PM
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.