【发布时间】:2015-08-11 12:47:12
【问题描述】:
在 cpp 中,我正在寻找在 Maya 中创建带有边界框的 MPxTransform 节点的代码。但是,我的代码既没有在大纲中添加变换节点,也没有创建边界框。我错过了什么?
.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 and bounding box displayed ?
}
myMPxTransformClass::myMPxTransformClass() // This one is executed
{
MGlobal::displayInfo("MPx Initialized");
}
bool myMPxTransformClass::isBounded() // This one is not called
{
MGlobal::displayInfo("isBounded returned");
return true;
}
MBoundingBox myMPxTransformClass::boundingBox() // This one is not called
{
MPoint p1,p2;
p1=MPoint(-1,-1,-1);
p2=MPoint(1,1,1);
MGlobal::displayInfo("Bounding box returned");
return MBoundingBox(p1,p2);
}
以及对应的.h文件
class myMPxTransformClass : public MPxTransform
{
public:
myMPxTransformClass();
virtual ~myMPxTransformClass() {};
protected:
virtual MBoundingBox boundingBox();
bool isBounded();
};
【问题讨论】:
标签: c++ transform nodes maya bounding-box