I'm having trouble calling a function defined in a mel script and loaded at run time from C++. In particular, I have a setup along these lines:
foo.mel
global proc fooFunc( string $bar ) {
// do stuff, don't return anything
}
main.cpp
MStatus status = MGlobal::sourceFile( "foo.mel" )
CHECK_MSTATUS(status);
// line below fails
status = MGlobal::executeCommand("fooFunc( \"howdy!\" )");
// so does this alternative
status = MGlobal::executeCommand("eval(\"fooFunc( \\\"howdy!\\\" )\");");
CHECK_MSTATUS(status);
The custom function call (which works if I just plug it in the script editor) fails, even if I wrap it in an eval(). How do I do this? Also, is there a list of specific MEL commands somewhere which won't work from the Maya API in library mode?
Thanks,
-Nick