本文整理汇总了C++中MFnMatrixAttribute::setStorable方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnMatrixAttribute::setStorable方法的具体用法?C++ MFnMatrixAttribute::setStorable怎么用?C++ MFnMatrixAttribute::setStorable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnMatrixAttribute
的用法示例。
在下文中一共展示了MFnMatrixAttribute::setStorable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
MStatus transRotateCombineMatrix::initialize()
{
MStatus status;
MFnMatrixAttribute mAttr;
aOutputMatrix = mAttr.create( "outputMatrix", "om" );
mAttr.setStorable( false );
status = addAttribute( aOutputMatrix );
CHECK_MSTATUS_AND_RETURN_IT( status );
aOutputInverseMatrix = mAttr.create( "outputInverseMatrix", "oim" );
mAttr.setStorable( false );
status = addAttribute( aOutputInverseMatrix );
CHECK_MSTATUS_AND_RETURN_IT( status );
aInputTransMatrix = mAttr.create( "inputTransMatrix", "itm" );
mAttr.setStorable( true );
status = addAttribute( aInputTransMatrix );
CHECK_MSTATUS_AND_RETURN_IT( status );
status = attributeAffects( aInputTransMatrix, aOutputMatrix );
status = attributeAffects( aInputTransMatrix, aOutputInverseMatrix );
aInputRotateMatrix = mAttr.create( "inputRotateMatrix", "irm" );
mAttr.setStorable( true );
status = addAttribute( aInputRotateMatrix );
CHECK_MSTATUS_AND_RETURN_IT( status );
status = attributeAffects( aInputRotateMatrix, aOutputMatrix );
status = attributeAffects( aInputRotateMatrix, aOutputInverseMatrix );
CHECK_MSTATUS_AND_RETURN_IT( status );
return MS::kSuccess;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: initialize
MStatus sgLockAngleMatrix::initialize()
{
MStatus status;
MFnMatrixAttribute mAttr;
MFnNumericAttribute nAttr;
MFnEnumAttribute eAttr;
aBaseMatrix = mAttr.create( "baseMatrix", "baseMatrix" );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aBaseMatrix ) );
aInputMatrix = mAttr.create( "inputMatrix", "inputMatrix" );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputMatrix ) );
aAngleAxis = eAttr.create( "angleAxis", "angleAxis" );
eAttr.addField( " X", 0 );eAttr.addField( " Y", 1 );eAttr.addField( " Z", 2 );
eAttr.addField( "-X", 3 );eAttr.addField( "-Y", 4 );eAttr.addField( "-Z", 5 );
eAttr.setStorable( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aAngleAxis ) );
aInputAngle = nAttr.create( "inputAngle", "inputAngle", MFnNumericData::kDouble, 45 );
nAttr.setStorable( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputAngle ) );
aOutputMatrix = mAttr.create( "outputMatrix", "outputMatrix" );
mAttr.setStorable( false );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aOutputMatrix ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aBaseMatrix, aOutputMatrix ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputMatrix, aOutputMatrix ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aAngleAxis, aOutputMatrix ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputAngle, aOutputMatrix ) );
return MS::kSuccess;
}
示例6: initialize
MStatus SwirlDeformer::initialize()
{
MFnMatrixAttribute mAttr;
deformSpace = mAttr.create( "deformSpace", "dSp" );
mAttr.setStorable( false );
MFnUnitAttribute unitFn;
startDist = unitFn.create( "startDist", "sd", MFnUnitAttribute::kDistance );
unitFn.setDefault( MDistance( 0.0, MDistance::uiUnit() ) );
unitFn.setMin( MDistance( 0.0, MDistance::uiUnit() ) );
unitFn.setKeyable( true );
endDist = unitFn.create( "endDist", "ed", MFnUnitAttribute::kDistance );
unitFn.setDefault( MDistance( 3.0, MDistance::uiUnit() ) );
unitFn.setMin( MDistance( 0.0, MDistance::uiUnit() ) );
unitFn.setKeyable( true );
addAttribute( deformSpace );
addAttribute( startDist );
addAttribute( endDist );
attributeAffects( deformSpace, outputGeom );
attributeAffects( startDist, outputGeom );
attributeAffects( endDist, outputGeom );
return MS::kSuccess;
}
示例7: 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;
}
示例8: initialize
MStatus offset::initialize()
{
// local attribute initialization
MFnMatrixAttribute mAttr;
offsetMatrix=mAttr.create( "locateMatrix", "lm");
mAttr.setStorable(false);
mAttr.setConnectable(true);
// deformation attributes
addAttribute( offsetMatrix);
attributeAffects( offset::offsetMatrix, offset::outputGeom );
return MStatus::kSuccess;
}
示例9: 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;
}
示例10: initialize
MStatus matrixFromPolygon::initialize()
{
MStatus status;
MFnNumericAttribute nAttr;
MFnMatrixAttribute mAttr;
MFnTypedAttribute tAttr;
aOutputMatrix = mAttr.create( "outputMatrix", "outputMatrix" );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aOutputMatrix ) );
aInputMesh = tAttr.create( "inputMesh", "inputMesh", MFnData::kMesh );
tAttr.setStorable( true );
tAttr.setCached( false );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputMesh ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputMesh, aOutputMatrix ) );
aInputMeshMatrix = mAttr.create( "inputMeshMatrix", "inputMeshMatrix" );
mAttr.setStorable( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputMeshMatrix ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputMeshMatrix, aOutputMatrix ) );
aPolygonIndex = nAttr.create( "polygonIndex", "polygonIndex", MFnNumericData::kInt, 0 );
nAttr.setStorable( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aPolygonIndex ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aPolygonIndex, aOutputMatrix ) );
aU = nAttr.create( "u", "u", MFnNumericData::kDouble, 0.5 );
nAttr.setStorable( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aU ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aU, aOutputMatrix ) );
aV = nAttr.create( "v", "v", MFnNumericData::kDouble, 0.5 );
nAttr.setStorable( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aV ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aV, aOutputMatrix ) );
return MS::kSuccess;
}
示例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;
}
示例12: 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 );
//.........这里部分代码省略.........
示例13: 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);
//.........这里部分代码省略.........
示例14: 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;
}
示例15: initialize
// initializes attribute information
// call by MAYA when this plug-in was loded.
//
MStatus anisotropicShaderNode::initialize()
{
MFnNumericAttribute nAttr;
MFnLightDataAttribute lAttr;
MFnMatrixAttribute mAttr;
aMatrixOToW = mAttr.create( "matrixObjectToWorld", "mow",
MFnMatrixAttribute::kFloat );
CHECK_MSTATUS( mAttr.setStorable( false ) );
CHECK_MSTATUS( mAttr.setHidden( true ) );
aMatrixWToC = mAttr.create( "matrixWorldToEye", "mwc",
MFnMatrixAttribute::kFloat );
CHECK_MSTATUS( mAttr.setStorable( false ) );
CHECK_MSTATUS( mAttr.setHidden( true ) );
aDiffuseReflectivity = nAttr.create( "diffuseReflectivity", "drfl",
MFnNumericData::kFloat);
MAKE_INPUT(nAttr);
CHECK_MSTATUS( nAttr.setDefault(0.8f) );
CHECK_MSTATUS( nAttr.setMin(0.0f) );
CHECK_MSTATUS( nAttr.setMax(1.0f) );
aColor = nAttr.createColor( "color", "c" );
MAKE_INPUT(nAttr);
CHECK_MSTATUS( nAttr.setDefault(0.0f, 0.58824f, 0.644f) );
aNormalCamera = nAttr.createPoint( "normalCamera", "n" );
MAKE_INPUT(nAttr);
CHECK_MSTATUS( nAttr.setHidden(true) );
aLightDirection = nAttr.createPoint( "lightDirection", "ld");
CHECK_MSTATUS ( nAttr.setStorable(false) );
CHECK_MSTATUS ( nAttr.setHidden(true) );
CHECK_MSTATUS ( nAttr.setReadable(true) );
CHECK_MSTATUS ( nAttr.setWritable(false) );
aLightIntensity = nAttr.createColor( "lightIntensity", "li" );
CHECK_MSTATUS ( nAttr.setStorable(false) );
CHECK_MSTATUS ( nAttr.setHidden(true) );
CHECK_MSTATUS ( nAttr.setReadable(true) );
CHECK_MSTATUS ( nAttr.setWritable(false) );
aLightAmbient = nAttr.create( "lightAmbient", "la",
MFnNumericData::kBoolean);
CHECK_MSTATUS ( nAttr.setStorable(false) );
CHECK_MSTATUS ( nAttr.setHidden(true) );
CHECK_MSTATUS ( nAttr.setReadable(true) );
CHECK_MSTATUS ( nAttr.setWritable(false) );
aLightDiffuse = nAttr.create( "lightDiffuse", "ldf",
MFnNumericData::kBoolean);
CHECK_MSTATUS ( nAttr.setStorable(false) );
CHECK_MSTATUS ( nAttr.setHidden(true) );
CHECK_MSTATUS ( nAttr.setReadable(true) );
CHECK_MSTATUS ( nAttr.setWritable(false) );
aLightSpecular = nAttr.create( "lightSpecular", "ls",
MFnNumericData::kBoolean);
CHECK_MSTATUS ( nAttr.setStorable(false) );
CHECK_MSTATUS ( nAttr.setHidden(true) );
CHECK_MSTATUS ( nAttr.setReadable(true) );
CHECK_MSTATUS ( nAttr.setWritable(false) );
aLightShadowFraction = nAttr.create( "lightShadowFraction", "lsf",
MFnNumericData::kFloat);
CHECK_MSTATUS ( nAttr.setStorable(false) );
CHECK_MSTATUS ( nAttr.setHidden(true) );
CHECK_MSTATUS ( nAttr.setReadable(true) );
CHECK_MSTATUS ( nAttr.setWritable(false) );
aPreShadowIntensity = nAttr.create( "preShadowIntensity", "psi",
MFnNumericData::kFloat);
CHECK_MSTATUS ( nAttr.setStorable(false) );
CHECK_MSTATUS ( nAttr.setHidden(true) );
CHECK_MSTATUS ( nAttr.setReadable(true) );
CHECK_MSTATUS ( nAttr.setWritable(false) );
aLightBlindData = nAttr.createAddr( "lightBlindData", "lbld");
CHECK_MSTATUS ( nAttr.setStorable(false) );
CHECK_MSTATUS ( nAttr.setHidden(true) );
CHECK_MSTATUS ( nAttr.setReadable(true) );
CHECK_MSTATUS ( nAttr.setWritable(false) );
aLightData = lAttr.create( "lightDataArray", "ltd",
aLightDirection,
aLightIntensity,
aLightAmbient,
aLightDiffuse,
aLightSpecular,
aLightShadowFraction,
aPreShadowIntensity,
aLightBlindData);
CHECK_MSTATUS( lAttr.setArray(true) );
CHECK_MSTATUS( lAttr.setStorable(false) );
CHECK_MSTATUS( lAttr.setHidden(true) );
//.........这里部分代码省略.........