stuh505
09-03-2005, 12:35 AM
I tried programming in the Maya API once before, but couldn't figure out how to set up the build environment properly on Windows since I didn't have MS Visual Studio .NET 2003 Professional and the Maya documentation is not specific enough to explain how to do things if you don't have that...
...so, I bought Microsoft Visual blagh blagh, and have compiled my first API plugin and successfully loaded it into Maya. This already makes me a little happy.
#include <maya/MSimple.h>
#include <maya/MIOStream.h>
DeclareSimpleCommand( helloWorld, "Alias", "7.0");
MStatus helloWorld::doIt( const MArgList& )
{
cout << "Hello World\n";
return MS::kSuccess;
}
Here is the code. Yes, it's the tutorial code. So, I can load the plugin into Maya successfully...and I can execute the command "helloWorld" by simply typing it's name into the Maya command line, but I do not get any "Hello World" output. No output in the command line, command feedback line, or script editor, or popup.
Since there were no errors and since this is an official example, I expect it to work...and I'm still not convinced that it's NOT working yet...so somebody please tell me, where SHOULD I be seeing the output?
Thanks
EDIT: Ok, I figured it out. The output goes to the "output window" but doesn't open the output window if it's closed. So, my problem is solved. However, I am curious if there is an efficient way to simply open the output window after it has been closed aside from doing specific maya commands that open it as a side effect.
...so, I bought Microsoft Visual blagh blagh, and have compiled my first API plugin and successfully loaded it into Maya. This already makes me a little happy.
#include <maya/MSimple.h>
#include <maya/MIOStream.h>
DeclareSimpleCommand( helloWorld, "Alias", "7.0");
MStatus helloWorld::doIt( const MArgList& )
{
cout << "Hello World\n";
return MS::kSuccess;
}
Here is the code. Yes, it's the tutorial code. So, I can load the plugin into Maya successfully...and I can execute the command "helloWorld" by simply typing it's name into the Maya command line, but I do not get any "Hello World" output. No output in the command line, command feedback line, or script editor, or popup.
Since there were no errors and since this is an official example, I expect it to work...and I'm still not convinced that it's NOT working yet...so somebody please tell me, where SHOULD I be seeing the output?
Thanks
EDIT: Ok, I figured it out. The output goes to the "output window" but doesn't open the output window if it's closed. So, my problem is solved. However, I am curious if there is an efficient way to simply open the output window after it has been closed aside from doing specific maya commands that open it as a side effect.
