Create an MPxTransform node in Maya outliner in cpp?

Create an MPxTransform node in Maya outliner in cpp?

Anonymous
Not applicable
527 Views
1 Reply
Message 1 of 2

Create an MPxTransform node in Maya outliner in cpp?

Anonymous
Not applicable

In cpp, I am looking for the code to create an MPxTransform node in Maya with reference in the outliner. However my code does not add a transform node in the outliner. What am I missing from the code below ?

 

.h:

class myMPxTransformClass : public MPxTransform
{
public:
myMPxTransformClass();
virtual ~myMPxTransformClass() {};
};

 

.cpp:

myClass::myClass() // Entry point: This one is executed
{
myMPxTransformClass prox;
MPxTransformationMatrix *transformMtrx;
transformMtrx=prox.createTransformationMatrix();
// What is missing here to get the node registered in Maya ?
}

myMPxTransformClass::myMPxTransformClass() // This one is executed
{
MGlobal::displayInfo("MPx Initialized");
}

Thanks.

0 Likes
528 Views
1 Reply
Reply (1)
Message 2 of 2

cheng_xi_li
Autodesk Support
Autodesk Support

I can't find something fishy in your code, please make sure you have registered the plugin properly with registerTransform.

 

There is a sample(rockingTransform) in our devkit, you can reference it for more details.

0 Likes