PDA

View Full Version : executing mel script files by using API


caspermel
05-20-2007, 01: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 :)

GennadiyKorol
05-20-2007, 02:01 PM
Hey,

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,
Henry

caspermel
05-22-2007, 09:45 PM
Hi Henry;

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

Melis

CGTalk Moderation
05-22-2007, 09: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.