本文整理汇总了C++中MFnMatrixAttribute::setDefault方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnMatrixAttribute::setDefault方法的具体用法?C++ MFnMatrixAttribute::setDefault怎么用?C++ MFnMatrixAttribute::setDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnMatrixAttribute
的用法示例。
在下文中一共展示了MFnMatrixAttribute::setDefault方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
//.........这里部分代码省略.........
outputZ = numFn.create("outputTranslateZ","otz",MFnNumericData::kDouble,0);
numFn.setStorable(true);
numFn.setKeyable(true);
addAttribute(outputZ);
output= compund.create("outputTranslate","ot");
compund.addChild(outputX);
compund.addChild(outputY);
compund.addChild(outputZ);
compund.setKeyable(false);
compund.setStorable(false);
compund.setWritable(false);
addAttribute(output);
//output = numFn.createPoint("outputTranslate","ot");
//numFn.setKeyable(false);
//numFn.setStorable(false);
//numFn.setWritable(false);
//addAttribute(output);
//This is the output rotate attribute
outputRotateX = numFn.create("outputRotateX","orx",MFnNumericData::kDouble,0);
numFn.setStorable(true);
numFn.setKeyable(true);
addAttribute(outputRotateX);
outputRotateY = numFn.create("outputRotateY","ory",MFnNumericData::kDouble,0);
numFn.setStorable(true);
numFn.setKeyable(true);
addAttribute(outputRotateY);
outputRotateZ = numFn.create("outputRotateZ","orz",MFnNumericData::kDouble,0);
numFn.setStorable(true);
numFn.setKeyable(true);
addAttribute(outputRotateZ);
outputRotate= compund.create("outputRotate","oro");
compund.addChild(outputRotateX);
compund.addChild(outputRotateY);
compund.addChild(outputRotateZ);
compund.setKeyable(false);
compund.setStorable(false);
compund.setWritable(false);
addAttribute(outputRotate);
//Those are all the matrix input
outputMatrix =matrixFn.create("outputMatrix","om");
matrixFn.setKeyable(false);
matrixFn.setStorable(false);
matrixFn.setWritable(false);
addAttribute(outputMatrix);
//offset matrix
offsetMatrix =matrixFn.create("offsetMatrix","ofm");
MMatrix defMatrix;
defMatrix.setToIdentity();
matrixFn.setDefault(defMatrix);
matrixFn.setKeyable(false);
matrixFn.setStorable(true);
matrixFn.setWritable(true);
addAttribute(offsetMatrix);
//all the attr affects
attributeAffects (recompute,output);
attributeAffects (inputPoint,output);
attributeAffects (inputNurbSurface,output);
attributeAffects (uValue,output);
attributeAffects (vValue,output);
attributeAffects (offsetMatrix,output);
attributeAffects (recompute,outputRotate);
attributeAffects (inputPoint,outputRotate);
attributeAffects (inputNurbSurface,outputRotate);
attributeAffects (uValue,outputRotate);
attributeAffects (vValue,outputRotate);
attributeAffects (offsetMatrix,outputRotate);
attributeAffects (recompute,outputMatrix);
attributeAffects (inputPoint,outputMatrix);
attributeAffects (inputNurbSurface,outputMatrix);
attributeAffects (uValue,outputMatrix);
attributeAffects (vValue,outputMatrix);
attributeAffects (offsetMatrix,outputMatrix);
return MS::kSuccess;
}
示例2: initialize
MStatus AimNode::initialize()
{
MStatus status;
MFnNumericAttribute nAttr;
MFnMatrixAttribute mAttr;
MFnUnitAttribute uAttr;
aDriverMatrix = mAttr.create("driverMatrix", "dvm");
mAttr.setStorable(true);
mAttr.setKeyable(true);
mAttr.setWritable(true);
addAttribute(aDriverMatrix);
aUpVectorMatrix = mAttr.create("upVectorMatrix", "uvm");
mAttr.setStorable(true);
mAttr.setKeyable(true);
mAttr.setWritable(true);
addAttribute(aUpVectorMatrix);
//translateX
aInputTranslateX = nAttr.create("translateX", "tx", MFnNumericData::kDouble, 0);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setWritable(true);
addAttribute(aInputTranslateX);
//translateY
aInputTranslateY = nAttr.create("translateY", "ty", MFnNumericData::kDouble, 0);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setWritable(true);
addAttribute(aInputTranslateY);
//translateZ
aInputTranslateZ = nAttr.create("translateZ", "tz", MFnNumericData::kDouble, 0);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setWritable(true);
addAttribute(aInputTranslateZ);
//translate
aInputTranslate = nAttr.create("translate", "t", aInputTranslateX, aInputTranslateY, aInputTranslateZ);
addAttribute(aInputTranslate);
//rotateX
aOutputRotateX = uAttr.create("rotateX", "rx", MFnUnitAttribute::kAngle, 0);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setWritable(true);
addAttribute(aOutputRotateX);
//rotateY
aOutputRotateY = uAttr.create("rotateY", "ry", MFnUnitAttribute::kAngle, 0);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setWritable(true);
addAttribute(aOutputRotateY);
//rotateZ
aOutputRotateZ = uAttr.create("rotateZ", "rz", MFnUnitAttribute::kAngle, 0);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setWritable(true);
addAttribute(aOutputRotateZ);
//rotate
aOutputRotate = nAttr.create("rotate", "ro", aOutputRotateX, aOutputRotateY, aOutputRotateZ);
addAttribute(aOutputRotate);
//parent inverse matrix
aParentInverseMatrix = mAttr.create("parentInverse", "parinv");
mAttr.setDefault(MMatrix::identity);
addAttribute(aParentInverseMatrix);
attributeAffects(aParentInverseMatrix, aOutputRotate);
attributeAffects(aDriverMatrix, aOutputRotate);
attributeAffects(aUpVectorMatrix, aOutputRotate);
attributeAffects(aInputTranslate, aOutputRotate);
return MS::kSuccess;
}