本文整理汇总了C++中MFnMatrixAttribute::setArray方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnMatrixAttribute::setArray方法的具体用法?C++ MFnMatrixAttribute::setArray怎么用?C++ MFnMatrixAttribute::setArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnMatrixAttribute
的用法示例。
在下文中一共展示了MFnMatrixAttribute::setArray方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
MStatus VolumePushCollider::initialize()
{
MFnNumericAttribute nAttr;
MFnMatrixAttribute mAttr;
// inCollider
aInCollider = mAttr.create("inCollider", "col");
mAttr.setArray(true);
CHECK_MSTATUS(addAttribute(aInCollider));
// inVolume
aInVolume = mAttr.create("inVolume", "vol");
mAttr.setArray(true);
CHECK_MSTATUS(addAttribute(aInVolume));
// output
aOutput = nAttr.create("output", "out", MFnNumericData::kDouble, 0.0);
nAttr.setArray(true);
nAttr.setReadable(true);
nAttr.setWritable(true);
nAttr.setHidden(true);
CHECK_MSTATUS(addAttribute(aOutput));
attributeAffects(aInCollider, aOutput);
attributeAffects(aInVolume, aOutput);
return MS::kSuccess;
}
示例2: initialize
MStatus clusterControledCurve::initialize()
{
MStatus status;
MFnNumericAttribute nAttr;
MFnMatrixAttribute mAttr;
MFnTypedAttribute tAttr;
MFnCompoundAttribute cAttr;
aInputCurve = tAttr.create( "inputCurve", "inputCurve", MFnData::kNurbsCurve );
tAttr.setStorable( true );
CHECK_MSTATUS( addAttribute( aInputCurve ) );
aInputCurveMatrix = mAttr.create( "inputCurveMatrix", "inputCurveMatrix" );
mAttr.setStorable( true );
CHECK_MSTATUS( addAttribute( aInputCurveMatrix ) );
aDumyMatrix = mAttr.create( "dumyMatrix", "dumyMatrix" );
mAttr.setStorable( true );
CHECK_MSTATUS( addAttribute( aDumyMatrix ) );
aBindPreMatrix = mAttr.create( "bindPreMatrix", "bindPreMatrix" );
mAttr.setStorable( true );
mAttr.setArray( true );
nAttr.setUsesArrayDataBuilder( true );
CHECK_MSTATUS( addAttribute( aBindPreMatrix ) );
aMatrix = mAttr.create( "matrix", "matrix" );
mAttr.setStorable( true );
mAttr.setArray( true );
CHECK_MSTATUS( addAttribute( aMatrix ) );
aWeightList = cAttr.create( "weightList", "weightList" );
aWeights = nAttr.create( "weights", "weights", MFnNumericData::kFloat, 0.0 );
nAttr.setArray( true );
nAttr.setUsesArrayDataBuilder( true );
cAttr.addChild( aWeights );
cAttr.setArray( true );
cAttr.setStorable( true );
CHECK_MSTATUS( addAttribute( aWeightList ) );
aUpdate = nAttr.create( "update", "update", MFnNumericData::kBoolean, false );
nAttr.setStorable( true );
CHECK_MSTATUS( addAttribute( aUpdate ) );
aOutputCurve = tAttr.create( "outputCurve", "outputCurve", MFnData::kNurbsCurve );
CHECK_MSTATUS( addAttribute( aOutputCurve ) );
CHECK_MSTATUS( attributeAffects( aInputCurve, aOutputCurve ) );
CHECK_MSTATUS( attributeAffects( aInputCurveMatrix, aOutputCurve ) );
CHECK_MSTATUS( attributeAffects( aDumyMatrix, aOutputCurve ) );
CHECK_MSTATUS( attributeAffects( aBindPreMatrix, aOutputCurve ) );
CHECK_MSTATUS( attributeAffects( aMatrix, aOutputCurve ) );
CHECK_MSTATUS( attributeAffects( aWeightList, aOutputCurve ) );
CHECK_MSTATUS( attributeAffects( aUpdate, aOutputCurve ) );
return MS::kSuccess;
}
示例3: initialize
MStatus inverseSkinCluster::initialize()
{
MStatus status;
MFnNumericAttribute nAttr;
MFnMatrixAttribute mAttr;
MFnMessageAttribute msgAttr;
MFnTypedAttribute tAttr;
aInMesh = tAttr.create( "inMesh", "inMesh", MFnData::kMesh );
tAttr.setStorable( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInMesh ) );
aGeomMatrix = mAttr.create( "geomMatrix", "geomMatrix" );
tAttr.setCached( false );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aGeomMatrix ) );
aMatrix = mAttr.create( "matrix", "matrix" );
mAttr.setArray( true );
mAttr.setStorable( true );
mAttr.setUsesArrayDataBuilder( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aMatrix ) );
aBindPreMatrix = mAttr.create( "bindPreMatrix", "bindPreMatrix" );
mAttr.setArray( true );
mAttr.setStorable( true );
mAttr.setUsesArrayDataBuilder( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aBindPreMatrix ) );
aUpdateMatrix = nAttr.create( "updateMatrix", "updateMatrix", MFnNumericData::kBoolean, false );
nAttr.setStorable( false );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aUpdateMatrix ) );
aTargetSkinCluster = msgAttr.create( "targetSkinCluster", "targetSkinCluster" );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aTargetSkinCluster ) );
aUpdateWeightList = nAttr.create( "updateWeightList", "updateWeightList", MFnNumericData::kBoolean, false );
nAttr.setStorable( false );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aUpdateWeightList ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInMesh, outputGeom ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aGeomMatrix, outputGeom ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aMatrix, outputGeom ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aBindPreMatrix, outputGeom ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aUpdateMatrix, outputGeom ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aUpdateWeightList, outputGeom ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aTargetSkinCluster, outputGeom ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aMatrix, outputGeom ) );
return MS::kSuccess;
}
示例4: initialize
MStatus BCIViz::initialize()
{
MFnNumericAttribute numFn;
MFnMatrixAttribute matAttr;
MStatus stat;
ainput = matAttr.create( "input", "in", MFnMatrixAttribute::kDouble );
matAttr.setStorable(false);
matAttr.setWritable(true);
matAttr.setConnectable(true);
addAttribute(ainput);
atargets = matAttr.create( "target", "tgt", MFnMatrixAttribute::kDouble );
matAttr.setStorable(false);
matAttr.setWritable(true);
matAttr.setArray(true);
matAttr.setConnectable(true);
addAttribute(atargets);
outValue = numFn.create( "outValue", "ov", MFnNumericData::kDouble );
numFn.setStorable(false);
numFn.setWritable(false);
numFn.setReadable(true);
numFn.setArray(true);
numFn.setUsesArrayDataBuilder( true );
addAttribute(outValue);
attributeAffects(ainput, outValue);
attributeAffects(atargets, outValue);
return MS::kSuccess;
}
示例5: initialize
// INIT =========================================
MStatus gear_curveCns::initialize()
{
MFnMatrixAttribute mAttr;
MStatus stat;
// INPUTS
inputs = mAttr.create( "inputs", "inputs" );
mAttr.setStorable(true);
mAttr.setReadable(false);
mAttr.setIndexMatters(false);
mAttr.setArray(true);
stat = addAttribute( inputs );
if (!stat) {stat.perror("addAttribute"); return stat;}
// CONNECTIONS
stat = attributeAffects( inputs, outputGeom );
if (!stat) { stat.perror("attributeAffects"); return stat;}
return MS::kSuccess;
}
示例6: initialize
MStatus MG_curve::initialize()
{
//This is the curve degree attribute
MFnNumericAttribute numFn;
degree = numFn.create("degree","d",MFnNumericData::kInt,3);
numFn.setMin(1);
addAttribute(degree);
//Those are all the matrix input
MFnMatrixAttribute matrixFn;
inputMatrix =matrixFn.create("inputMatrix","im");
matrixFn.setArray(true);
matrixFn.setStorable(true);
addAttribute(inputMatrix);
//This is the curve's matrix used to compensate curve translate
transformMatrix =matrixFn.create("transformMatrix","tm");
matrixFn.setStorable(true);
addAttribute(transformMatrix);
//This is the curve output attribute
MFnTypedAttribute typedFn;
output = typedFn.create("output","o",MFnData::kNurbsCurve);
typedFn.setStorable(false);
typedFn.setWritable(false);
addAttribute(output);
attributeAffects(degree,output);
attributeAffects(inputMatrix,output);
attributeAffects(transformMatrix,output);
return MS::kSuccess;
}
示例7: initialize
MStatus n_tentacle::initialize()
{
MFnNumericAttribute numericAttr;
MFnMatrixAttribute matrixAttr;
MFnTypedAttribute typedAttr;
MFnUnitAttribute unitAttribute;
MFnEnumAttribute enumAttr;
MStatus stat;
stretch = numericAttr.create("stretch", "st", MFnNumericData::kDouble, 0.0);
numericAttr.setMin(0.0);
numericAttr.setMax(1.0);
globalScale = numericAttr.create("globalScale", "gs", MFnNumericData::kDouble, 1.0);
numericAttr.setMin(0.00001);
numericAttr.setMax(10.0);
iniLength = numericAttr.create("iniLength", "iln", MFnNumericData::kDouble, 0.01);
parameter = numericAttr.create("parameter", "prm", MFnNumericData::kDouble, 0.0);
numericAttr.setArray(true);
blendRot = numericAttr.create("blendRot", "blr", MFnNumericData::kDouble, 0.0);
numericAttr.setArray(true);
interval = numericAttr.create("interval", "itv", MFnNumericData::kInt, 0);
numericAttr.setArray(true);
matrix = matrixAttr.create("matrix", "mtx");
matrixAttr.setArray(true);
matrixAttr.setHidden(true);
curve = typedAttr.create("curve", "crv", MFnData::kNurbsCurve);
outTranslate = numericAttr.create("outTranslate", "ot", MFnNumericData::k3Double);
numericAttr.setArray(true);
numericAttr.setHidden(true);
numericAttr.setUsesArrayDataBuilder(true);
numericAttr.setHidden(true);
outRotateX = unitAttribute.create("outRotateX", "orx", MFnUnitAttribute::kAngle);
outRotateY = unitAttribute.create("outRotateY", "ory", MFnUnitAttribute::kAngle);
outRotateZ = unitAttribute.create("outRotateZ", "orz", MFnUnitAttribute::kAngle);
outRotate = numericAttr.create("outRotate", "or",outRotateX, outRotateY, outRotateZ);
numericAttr.setArray(true);
numericAttr.setHidden(true);
numericAttr.setUsesArrayDataBuilder(true);
numericAttr.setHidden(true);
tangentAxis = enumAttr.create("tangentAxis", "tga", 1);
enumAttr.addField("X", 0);
enumAttr.addField("Y", 1);
enumAttr.addField("Z", 2);
enumAttr.addField("negativeX", 3);
enumAttr.addField("negativeY", 4);
enumAttr.addField("negativeZ", 5);
// Add the attributes we have created to the node
//
stat = addAttribute( parameter );
if (!stat) { stat.perror("addAttribute"); return stat;}
stat = addAttribute( blendRot );
if (!stat) { stat.perror("addAttribute"); return stat;}
stat = addAttribute( interval );
if (!stat) { stat.perror("addAttribute"); return stat;}
stat = addAttribute( stretch );
if (!stat) { stat.perror("addAttribute"); return stat;}
stat = addAttribute( globalScale );
if (!stat) { stat.perror("addAttribute"); return stat;}
stat = addAttribute( iniLength );
if (!stat) { stat.perror("addAttribute"); return stat;}
stat = addAttribute( matrix );
if (!stat) { stat.perror("addAttribute"); return stat;}
stat = addAttribute( curve );
if (!stat) { stat.perror("addAttribute"); return stat;}
stat = addAttribute( outTranslate );
if (!stat) { stat.perror("addAttribute"); return stat;}
stat = addAttribute( outRotate );
if (!stat) { stat.perror("addAttribute"); return stat;}
stat = addAttribute( tangentAxis );
if (!stat) { stat.perror("addAttribute"); return stat;}
attributeAffects( parameter, outTranslate );
attributeAffects( blendRot, outTranslate );
attributeAffects( interval, outTranslate );
attributeAffects( stretch, outTranslate );
attributeAffects( globalScale, outTranslate );
attributeAffects( iniLength, outTranslate );
attributeAffects( matrix, outTranslate );
attributeAffects( curve, outTranslate );
attributeAffects( tangentAxis, outTranslate );
attributeAffects( parameter, outRotate );
attributeAffects( blendRot, outRotate );
attributeAffects( interval, outRotate );
attributeAffects( stretch, outRotate );
attributeAffects( globalScale, outRotate );
//.........这里部分代码省略.........
示例8: initialize
//.........这里部分代码省略.........
outReplacePP = typedAttrFn.create( "outReplace", "orpl",
MFnData::kDoubleArray, dArrayDataFn.object(),
&stat );
if(stat != MS::kSuccess) {
MGlobal::displayWarning("failed create outReplace");
}
typedAttrFn.setStorable(false);
stat = addAttribute(outReplacePP);
if(stat != MS::kSuccess) {
MGlobal::displayWarning("failed add outReplace");
}
outValue = numFn.create( "outValue", "ov", MFnNumericData::kFloat );
numFn.setStorable(false);
numFn.setWritable(false);
addAttribute(outValue);
outValue1 = numFn.create( "outValue1", "ov1", MFnNumericData::kFloat );
numFn.setStorable(false);
numFn.setWritable(false);
addAttribute(outValue1);
MFnTypedAttribute stringAttr;
acachename = stringAttr.create( "cachePath", "cp", MFnData::kString );
stringAttr.setStorable(true);
addAttribute( acachename );
astandinNames = stringAttr.create( "standinNames", "sdn", MFnData::kString );
stringAttr.setStorable(true);
stringAttr.setArray(true);
addAttribute(astandinNames);
MFnMatrixAttribute matAttr;
acameraspace = matAttr.create( "cameraSpace", "cspc", MFnMatrixAttribute::kDouble );
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);
示例9: 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);
//.........这里部分代码省略.........
示例10: 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 );
//.........这里部分代码省略.........
示例11: initialize
// INIT =========================================
MStatus gear_rollSplineKine::initialize()
{
MFnMatrixAttribute mAttr;
MFnNumericAttribute nAttr;
MStatus stat;
// Inputs Matrices
ctlParent = mAttr.create( "ctlParent", "ctlp", MFnMatrixAttribute::kDouble );
mAttr.setStorable(true);
mAttr.setReadable(false);
mAttr.setIndexMatters(false);
mAttr.setArray(true);
addAttribute( ctlParent );
inputs = mAttr.create( "inputs", "in", MFnMatrixAttribute::kDouble );
mAttr.setStorable(true);
mAttr.setReadable(false);
mAttr.setIndexMatters(false);
mAttr.setArray(true);
addAttribute( inputs );
inputsRoll = nAttr.create ( "inputsRoll", "inr", MFnNumericData::kFloat, 0.0 );
nAttr.setArray(true);
nAttr.setStorable(true);
addAttribute ( inputsRoll );
outputParent = mAttr.create( "outputParent", "outp" );
mAttr.setStorable(true);
mAttr.setKeyable(true);
mAttr.setConnectable(true);
stat = addAttribute( outputParent );
if (!stat) {stat.perror("addAttribute"); return stat;}
// Inputs Sliders
u = nAttr.create("u", "u", MFnNumericData::kFloat, 0.0);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setMin(0);
nAttr.setMax(1);
stat = addAttribute( u );
if (!stat) {stat.perror("addAttribute"); return stat;}
resample = nAttr.create("resample", "re", MFnNumericData::kBoolean, false);
nAttr.setStorable(true);
nAttr.setKeyable(true);
stat = addAttribute( resample );
if (!stat) {stat.perror("addAttribute"); return stat;}
subdiv = nAttr.create("subdiv", "sd", MFnNumericData::kShort, 10);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setMin(3);
stat = addAttribute( subdiv );
if (!stat) {stat.perror("addAttribute"); return stat;}
absolute = nAttr.create("absolute", "abs", MFnNumericData::kBoolean, false);
nAttr.setStorable(true);
nAttr.setKeyable(true);
stat = addAttribute( absolute );
if (!stat) {stat.perror("addAttribute"); return stat;}
// Outputs
output = mAttr.create( "output", "out" );
mAttr.setStorable(false);
mAttr.setKeyable(false);
mAttr.setConnectable(true);
stat = addAttribute( output );
if (!stat) {stat.perror("addAttribute"); return stat;}
// Connections
stat = attributeAffects ( ctlParent, output );
if (!stat) {stat.perror("attributeAffects"); return stat;}
stat = attributeAffects ( inputs, output );
if (!stat) {stat.perror("attributeAffects"); return stat;}
stat = attributeAffects ( inputsRoll, output );
if (!stat) {stat.perror("attributeAffects"); return stat;}
stat = attributeAffects ( outputParent, output );
if (!stat) {stat.perror("attributeAffects"); return stat;}
stat = attributeAffects ( u, output );
if (!stat) {stat.perror("attributeAffects"); return stat;}
stat = attributeAffects ( resample, output );
if (!stat) {stat.perror("attributeAffects"); return stat;}
stat = attributeAffects ( subdiv, output );
if (!stat) {stat.perror("attributeAffects"); return stat;}
stat = attributeAffects ( absolute, output );
if (!stat) {stat.perror("attributeAffects"); return stat;}
return MS::kSuccess;
}