stao
07-04-2008, 03:08 AM
Hi,
I am totally lost and "depressed" :) Command below could be correctly executed in Maya Script Editor. But it fails when I tried to run it in program.
int main(int argc, char **argv)
{
MStatus status;
status = MLibrary::initialize (true, argv[0], true);
if ( !status ) {
status.perror("MLibrary::initialize");
return (1);
}
// ONLY lines I added to c:\Program Files\Alias\Maya8.0\devkit\applications\helloWorld.cpp
const char* fixedname = "C:/t.mb";
MString tmp = MString("file -open -force -loadAllReferences \"") + fixedname + "\"";
status = MGlobal::executeCommand( tmp );
_ASSERTE( status );
// Write the text out in 3 different ways.
cout << "Hello World! (cout)\n";
MGlobal::displayInfo("Hello world! (script output)" );
MGlobal::executeCommand( "print \"Hello world! (command script output)\\n\"", true );
MLibrary::cleanup();
return (0);
}
Maya 8, Windows XP sp2
I am totally lost and "depressed" :) Command below could be correctly executed in Maya Script Editor. But it fails when I tried to run it in program.
int main(int argc, char **argv)
{
MStatus status;
status = MLibrary::initialize (true, argv[0], true);
if ( !status ) {
status.perror("MLibrary::initialize");
return (1);
}
// ONLY lines I added to c:\Program Files\Alias\Maya8.0\devkit\applications\helloWorld.cpp
const char* fixedname = "C:/t.mb";
MString tmp = MString("file -open -force -loadAllReferences \"") + fixedname + "\"";
status = MGlobal::executeCommand( tmp );
_ASSERTE( status );
// Write the text out in 3 different ways.
cout << "Hello World! (cout)\n";
MGlobal::displayInfo("Hello world! (script output)" );
MGlobal::executeCommand( "print \"Hello world! (command script output)\\n\"", true );
MLibrary::cleanup();
return (0);
}
Maya 8, Windows XP sp2
