Monday, February 2, 2009

[Maya] Note 1

Function to create a sphere data:

MObject MFnSphereData::create
(
double
rad = 1,

MStatus *
ReturnStatus = NULL

)

 

C:\Program Files\Autodesk\Maya2009\docs\Maya2009\en_US\index.html

 

Notice:

When you use MString in your code, do remember to include the header file "<maya/MString.h>". Moreover, in C++, you must not use following format:

MString cmd;

cmd="sphere -r "+radius;

Instead, using:

MString cmd;

cmd="sphere -r ";

cmd+=radius;

As MString class has provide the operator +=, in this way it will work correctly. Or, using the first format, the "+" won't work well. And usually, it cause the cmd string to be "".

No comments:

Post a Comment