本文整理汇总了C++中MFnMatrixAttribute::setDisconnectBehavior方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnMatrixAttribute::setDisconnectBehavior方法的具体用法?C++ MFnMatrixAttribute::setDisconnectBehavior怎么用?C++ MFnMatrixAttribute::setDisconnectBehavior使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnMatrixAttribute
的用法示例。
在下文中一共展示了MFnMatrixAttribute::setDisconnectBehavior方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
// create attributes
MStatus probeDeformerARAPNode::initialize(){
MFnTypedAttribute tAttr;
MFnNumericAttribute nAttr;
MFnEnumAttribute eAttr;
MFnMatrixAttribute mAttr;
MRampAttribute rAttr;
// this attr will be dirtied when ARAP recomputation is needed
aARAP = nAttr.create( "arap", "arap", MFnNumericData::kBoolean, true );
nAttr.setStorable(false);
nAttr.setKeyable(false);
nAttr.setHidden(true);
addAttribute( aARAP );
// this attr will be dirtied when weight recomputation is needed
aComputeWeight = nAttr.create( "computeWeight", "computeWeight", MFnNumericData::kBoolean, true );
nAttr.setStorable(false);
nAttr.setKeyable(false);
nAttr.setHidden(true);
addAttribute( aComputeWeight );
aMatrix = mAttr.create("probeMatrix", "pm");
mAttr.setStorable(false);
mAttr.setHidden(true);
mAttr.setArray(true);
mAttr.setUsesArrayDataBuilder(true);
mAttr.setDisconnectBehavior(MFnMatrixAttribute::kDelete);
addAttribute(aMatrix);
attributeAffects( aMatrix, outputGeom );
aInitMatrix = mAttr.create("initProbeMatrix", "ipm");
mAttr.setHidden(true);
mAttr.setArray(true);
mAttr.setStorable(true);
mAttr.setUsesArrayDataBuilder(true);
addAttribute(aInitMatrix);
attributeAffects( aInitMatrix, outputGeom );
aBlendMode = eAttr.create( "blendMode", "bm", BM_SRL );
eAttr.addField( "expSO+expSym", BM_SRL );
eAttr.addField( "expSE+expSym", BM_SSE );
eAttr.addField( "logmatrix3", BM_LOG3 );
eAttr.addField( "logmatrix4", BM_LOG4 );
eAttr.addField( "quat+linear", BM_SQL );
eAttr.addField( "linear", BM_AFF );
eAttr.addField( "off", BM_OFF );
eAttr.setStorable(true);
eAttr.setKeyable(false);
addAttribute( aBlendMode );
attributeAffects( aBlendMode, outputGeom );
aRotationConsistency = nAttr.create( "rotationConsistency", "rc", MFnNumericData::kBoolean, false );
nAttr.setKeyable(false);
nAttr.setStorable(true);
addAttribute( aRotationConsistency );
attributeAffects( aRotationConsistency, outputGeom );
aFrechetSum = nAttr.create( "frechetSum", "fs", MFnNumericData::kBoolean, false );
nAttr.setKeyable(false);
nAttr.setStorable(true);
addAttribute( aFrechetSum );
attributeAffects( aFrechetSum, outputGeom );
aNormaliseWeight = eAttr.create( "normaliseWeight", "nw", NM_LINEAR );
eAttr.addField( "NONE", NM_NONE );
eAttr.addField( "Linear", NM_LINEAR );
eAttr.addField( "Softmax", NM_SOFTMAX );
eAttr.setStorable(true);
addAttribute( aNormaliseWeight );
attributeAffects( aNormaliseWeight, outputGeom );
attributeAffects( aNormaliseWeight, aComputeWeight );
aWeightMode = eAttr.create( "weightMode", "wtm", WM_HARMONIC_COTAN );
eAttr.addField( "inverse", WM_INV_DISTANCE );
eAttr.addField( "cut-off", WM_CUTOFF_DISTANCE );
eAttr.addField( "draw", WM_DRAW );
// eAttr.addField( "harmonic-arap", WM_HARMONIC_ARAP);
eAttr.addField( "harmonic-cotan", WM_HARMONIC_COTAN);
eAttr.setStorable(true);
eAttr.setKeyable(false);
addAttribute( aWeightMode );
attributeAffects( aWeightMode, outputGeom );
attributeAffects( aWeightMode, aComputeWeight );
aConstraintMode = eAttr.create( "constraintMode", "ctm", CONSTRAINT_CLOSEST );
eAttr.addField( "neighbour", CONSTRAINT_NEIGHBOUR);
eAttr.addField( "closestFace", CONSTRAINT_CLOSEST );
eAttr.setStorable(true);
eAttr.setKeyable(false);
addAttribute( aConstraintMode );
attributeAffects( aConstraintMode, outputGeom );
attributeAffects( aConstraintMode, aARAP);
aTetMode = eAttr.create( "tetMode", "tm", TM_FACE );
eAttr.addField( "face", TM_FACE );
eAttr.addField( "edge", TM_EDGE );
eAttr.addField( "vertex", TM_VERTEX );
eAttr.addField( "vface", TM_VFACE );
eAttr.setStorable(true);
//.........这里部分代码省略.........
示例2: initialize
//.........这里部分代码省略.........
matAttr.setStorable(false);
matAttr.setWritable(true);
matAttr.setConnectable(true);
addAttribute(acameraspace);
ahapeture = numFn.create( "horizontalFilmAperture", "hfa", MFnNumericData::kDouble, 1.0 );
numFn.setStorable(false);
numFn.setConnectable(true);
addAttribute( ahapeture );
avapeture = numFn.create( "verticalFilmAperture", "vfa", MFnNumericData::kDouble, 1.0 );
numFn.setStorable(false);
numFn.setConnectable(true);
addAttribute( avapeture );
afocallength = numFn.create( "focalLength", "fl", MFnNumericData::kDouble );
numFn.setStorable(false);
numFn.setConnectable(true);
addAttribute( afocallength );
aconvertPercentage = numFn.create( "convertPercentage", "cvp", MFnNumericData::kDouble );
numFn.setStorable(false);
numFn.setConnectable(true);
numFn.setDefault(1.0);
numFn.setMax(1.0);
numFn.setMin(0.01);
addAttribute(aconvertPercentage);
agroundMesh = typedAttrFn.create("groundMesh", "grdm", MFnMeshData::kMesh);
typedAttrFn.setStorable(false);
typedAttrFn.setWritable(true);
typedAttrFn.setConnectable(true);
typedAttrFn.setArray(true);
typedAttrFn.setDisconnectBehavior(MFnAttribute::kDelete);
addAttribute( agroundMesh );
attributeAffects(agroundMesh, outValue);
agroundSpace = matAttr.create("groundSpace", "grdsp", MFnMatrixAttribute::kDouble);
matAttr.setStorable(false);
matAttr.setWritable(true);
matAttr.setConnectable(true);
matAttr.setArray(true);
matAttr.setDisconnectBehavior(MFnAttribute::kDelete);
addAttribute( agroundSpace );
attributeAffects(agroundSpace, outValue);
MPointArray defaultPntArray;
MFnPointArrayData pntArrayDataFn;
pntArrayDataFn.create( defaultPntArray );
aplantTransformCache = typedAttrFn.create( "transformCachePlant",
"tmcpl",
MFnData::kPointArray,
pntArrayDataFn.object(),
&stat );
typedAttrFn.setStorable(true);
addAttribute(aplantTransformCache);
MIntArray defaultIntArray;
MFnIntArrayData intArrayDataFn;
intArrayDataFn.create( defaultIntArray );
aplantIdCache = typedAttrFn.create( "idCachePlant",
"idcpl",
MFnData::kIntArray,
intArrayDataFn.object(),
&stat );
示例3: initialize
MStatus SargassoNode::initialize()
{
MFnNumericAttribute nAttr;
MStatus status;
MFnTypedAttribute typedAttr;
MFnMatrixAttribute pimAttr;
aconstraintParentInverseMatrix = pimAttr.create( "constraintParentInvMat", "cpim", MFnMatrixAttribute::kDouble, &status );
pimAttr.setArray(true);
pimAttr.setStorable(false);
pimAttr.setDisconnectBehavior(MFnAttribute::kDelete);
status = addAttribute(aconstraintParentInverseMatrix);
if (!status) { status.perror("addAttribute parent inverse matrix"); return status;}
MFnNumericAttribute numAttr;
constraintTranslateX = numAttr.create( "constraintTranslateX", "ctx", MFnNumericData::kDouble, 0.0, &status );
if(!status) {
MGlobal::displayInfo("failed to create attrib constraintTranslateX");
return status;
}
constraintTranslateY = numAttr.create( "constraintTranslateY", "cty", MFnNumericData::kDouble, 0.0, &status );
if(!status) {
MGlobal::displayInfo("failed to create attrib constraintTranslateY");
return status;
}
constraintTranslateZ = numAttr.create( "constraintTranslateZ", "ctz", MFnNumericData::kDouble, 0.0, &status );
if(!status) {
MGlobal::displayInfo("failed to create attrib constraintTranslateY");
return status;
}
MFnUnitAttribute angleAttr;
constraintRotateX = angleAttr.create( "constraintRotateX", "crx", MFnUnitAttribute::kAngle , 0.0, &status );
if(!status) {
MGlobal::displayInfo("failed to create attrib constraintRotateX");
return status;
}
constraintRotateY = angleAttr.create( "constraintRotateY", "cry", MFnUnitAttribute::kAngle , 0.0, &status );
if(!status) {
MGlobal::displayInfo("failed to create attrib constraintRotateY");
return status;
}
constraintRotateZ = angleAttr.create( "constraintRotateZ", "crz", MFnUnitAttribute::kAngle , 0.0, &status );
if(!status) {
MGlobal::displayInfo("failed to create attrib constraintRotateY");
return status;
}
{ // Compound target(geometry,weight): array, delete on disconnect
MFnCompoundAttribute compoundAttr;
compoundOutput = compoundAttr.create( "outValue", "otv",&status );
if (!status) { status.perror("compoundAttr.create"); return status;}
status = compoundAttr.addChild( constraintTranslateX );
if (!status) { status.perror("compoundAttr.addChild tx"); return status;}
status = compoundAttr.addChild( constraintTranslateY );
if (!status) { status.perror("compoundAttr.addChild ty"); return status;}
status = compoundAttr.addChild( constraintTranslateZ );
if (!status) { status.perror("compoundAttr.addChild tz"); return status;}
compoundAttr.addChild( constraintRotateX );
compoundAttr.addChild( constraintRotateY );
compoundAttr.addChild( constraintRotateZ );
compoundAttr.setArray( true );
//status = compoundAttr.setDisconnectBehavior(MFnAttribute::kDelete);
//if (!status) { status.perror("typedAttrKeyable.setDisconnectBehavior:cgeom"); return status;}
}
status = addAttribute( compoundOutput );
if (!status) { status.perror("addAttribute"); return status;}
MPointArray defaultPntArray;
MFnPointArrayData pntArrayDataFn;
pntArrayDataFn.create( defaultPntArray );
atargetRestP = typedAttr.create( "targetRestP", "tgrp", MFnData::kPointArray, pntArrayDataFn.object());
typedAttr.setStorable(true);
addAttribute(atargetRestP);
MIntArray defaultIntArray;
MFnIntArrayData intArrayDataFn;
intArrayDataFn.create( defaultIntArray );
atargetTri = typedAttr.create( "targetTriangle", "tgtri", MFnData::kIntArray, intArrayDataFn.object());
typedAttr.setStorable(true);
addAttribute(atargetTri);
atargetBind = typedAttr.create( "targetBindId", "tgbdi", MFnData::kIntArray, intArrayDataFn.object());
typedAttr.setStorable(true);
addAttribute(atargetBind);
aobjTri = typedAttr.create( "objectTriId", "obti", MFnData::kIntArray, intArrayDataFn.object());
typedAttr.setStorable(true);
addAttribute(aobjTri);
atargetNv = numAttr.create( "targetNumV", "tgnv", MFnNumericData::kInt, 0, &status );
//.........这里部分代码省略.........