本文整理汇总了C++中MFnTypedAttribute类的典型用法代码示例。如果您正苦于以下问题:C++ MFnTypedAttribute类的具体用法?C++ MFnTypedAttribute怎么用?C++ MFnTypedAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MFnTypedAttribute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
MStatus blindDataMesh::initialize()
{
MFnTypedAttribute typedAttr;
MStatus returnStatus;
blindDataMesh::outputMesh = typedAttr.create( "outputMesh", "out",
MFnData::kMesh, &returnStatus );
McheckErr(returnStatus, "ERROR creating blindDataMesh output attribute\n");
typedAttr.setStorable(false);
returnStatus = addAttribute(blindDataMesh::outputMesh);
McheckErr(returnStatus, "ERROR adding outputMesh attribute\n");
MFnNumericAttribute numAttr;
blindDataMesh::seed = numAttr.create( "randomSeed", "seed",
MFnNumericData::kLong, 0, &returnStatus );
McheckErr(returnStatus, "ERROR creating blindDataMesh input attribute\n");
returnStatus = addAttribute(blindDataMesh::seed);
McheckErr(returnStatus, "ERROR adding input attribute\n");
returnStatus = attributeAffects(blindDataMesh::seed,
blindDataMesh::outputMesh);
McheckErr(returnStatus, "ERROR in attributeAffects\n");
return MS::kSuccess;
}
示例2: initialize
MStatus fullLoft::initialize()
{
MStatus stat;
MFnTypedAttribute typedAttr;
inputCurve=typedAttr.create( "inputCurve", "in",
MFnNurbsCurveData::kNurbsCurve,
&stat );
PERRORfail("initialize create input attribute");
stat = typedAttr.setArray( true );
PERRORfail("initialize set input attribute array");
outputSurface=typedAttr.create( "outputSurface", "out",
MFnNurbsSurfaceData::kNurbsSurface,
&stat );
PERRORfail("initialize create output attribute");
stat = typedAttr.setStorable( false );
PERRORfail("initialize set output attribute storable");
stat = addAttribute( inputCurve );
PERRORfail("addAttribute(inputCurve)");
stat = addAttribute( outputSurface );
PERRORfail("addAttribute(outputSurface)");
stat = attributeAffects( inputCurve, outputSurface );
PERRORfail("attributeAffects(inputCurve, outputSurface)");
return MS::kSuccess;
}
示例3: _LogFunctionCall
MStatus btSPHMgrNode::initialize()
{
_LogFunctionCall("btSPHMgrNode::initialize()");
MStatus status;
MFnUnitAttribute uAttr;
MFnNumericAttribute nAttr;
MFnTypedAttribute tAttr;
i_particleShape = nAttr.create(particleShape, ps, MFnNumericData::kInt, 0, &status);
IfMErrorWarn(status);
IfMErrorWarn(addAttribute(i_particleShape));
i_particlePPAttr = nAttr.create(particlePPAttr, pppa, MFnNumericData::kInt, 0, &status);
IfMErrorWarn(status);
IfMErrorWarn(addAttribute(i_particlePPAttr));
i_particleCount = nAttr.create( particleCount, pc, MFnNumericData::kInt, 300,&status);
IfMErrorWarn(status);
IfMErrorWarn(addAttribute( i_particleCount ));
i_obstacleAABB = tAttr.create(obstacleBox, obox, MFnData::kMesh, MObject::kNullObj, &status);
IfMErrorWarn(status);
IfMErrorWarn(addAttribute(i_obstacleAABB));
i_initAABB = tAttr.create(initBox, ibox, MFnData::kMesh, MObject::kNullObj, &status);
IfMErrorWarn(status);
IfMErrorWarn(addAttribute(i_initAABB));
return MS::kSuccess;
}
示例4: initialize
MStatus PushDeformer::initialize()
{
MStatus status;
MFnNumericAttribute nAttr;
MFnTypedAttribute tAttr;
//add bulge attribute which affects the output geom
aAmount = nAttr.create("amount", "amt", MFnNumericData::kDouble, 0.0);
nAttr.setKeyable(true);
addAttribute(aAmount);
aStressMap = tAttr.create("aStressMap", "stMap", MFnData::kDoubleArray);
tAttr.setKeyable(true);
tAttr.setWritable(true);
tAttr.setStorable(true);
addAttribute(aStressMap);
aUseStress = nAttr.create("useStress", "useStress", MFnNumericData::kBoolean, 0);
nAttr.setKeyable(true);
nAttr.setStorable(true);
addAttribute(aUseStress);
aMultiThreadingType = nAttr.create("multiThreadingType", "multiThreadingType", MFnNumericData::kInt, 0);
nAttr.setKeyable(true);
addAttribute(aMultiThreadingType);
attributeAffects(aAmount, outputGeom);
attributeAffects(aStressMap, outputGeom);
attributeAffects(aUseStress, outputGeom);
attributeAffects(aMultiThreadingType, outputGeom);
// make paintable deformer
MGlobal::executeCommand("makePaintable -attrType multiFloat -sm deformer pushDeformer weights");
return MS::kSuccess;
}
示例5: initialize
MStatus sgBulgeDeformer::initialize()
{
MStatus status;
MFnNumericAttribute nAttr;
MFnTypedAttribute tAttr;
MFnMatrixAttribute mAttr;
MFnCompoundAttribute cAttr;
aBulgeWeight = nAttr.create(nameBulgeWeight, nameBulgeWeight, MFnNumericData::kFloat, 1.0);
nAttr.setStorable(false);
nAttr.setKeyable(true);
addAttribute(aBulgeWeight);
aBulgeRadius = nAttr.create(nameBulgeRadius, nameBulgeRadius, MFnNumericData::kDouble, 0);
nAttr.setMin(0);
nAttr.setStorable(false);
nAttr.setKeyable(true);
addAttribute(aBulgeRadius);
aBulgeInputs = cAttr.create(nameBulgeInputs, nameBulgeInputs);
aMatrix = mAttr.create(nameMatrix, nameMatrix);
aMesh = tAttr.create(nameMesh, nameMesh, MFnData::kMesh );
cAttr.addChild(aMatrix);
cAttr.addChild(aMesh);
cAttr.setArray(true);
addAttribute(aBulgeInputs);
attributeAffects(aBulgeWeight, outputGeom);
attributeAffects(aBulgeRadius, outputGeom);
attributeAffects(aBulgeInputs, outputGeom);
return status;
}
示例6: inheritAttributesFrom
MStatus SceneShape::initialize()
{
MStatus s = inheritAttributesFrom( "ieSceneShapeInterface" );
MFnTypedAttribute tAttr;
// will need to check for sceneFile extensions
aSceneFilePlug = tAttr.create( "file", "scf", MFnData::kString, &s );
assert( s );
s = addAttribute( aSceneFilePlug );
assert( s );
aSceneRootPlug = tAttr.create( "root", "scr", MFnData::kString, MFnStringData().create( "/" ), &s );
assert( s );
s = addAttribute( aSceneRootPlug );
assert( s );
attributeAffects( aSceneFilePlug, aTransform );
attributeAffects( aSceneFilePlug, aBound );
attributeAffects( aSceneFilePlug, aOutputObjects );
attributeAffects( aSceneFilePlug, aAttributes );
attributeAffects( aSceneRootPlug, aTransform );
attributeAffects( aSceneRootPlug, aBound );
attributeAffects( aSceneRootPlug, aOutputObjects );
attributeAffects( aSceneRootPlug, aAttributes );
return s;
}
示例7: initialize
//
// DESCRIPTION:
MStatus OSLNode::initialize()
{
MFnNumericAttribute nAttr;
MFnTypedAttribute tAttr;
MFnGenericAttribute gAttr;
MFnEnumAttribute eAttr;
MFnMessageAttribute mAttr;
MStatus status;
color = nAttr.createColor("color", "color");
MAKE_INPUT(nAttr);
CHECK_MSTATUS(addAttribute( color ));
script = tAttr.create("script", "script", MFnNumericData::kString);
MAKE_INPUT(tAttr);
CHECK_MSTATUS(addAttribute( script ));
outColor = nAttr.createColor("outColor", "outColor");
MAKE_OUTPUT(nAttr);
CHECK_MSTATUS(addAttribute( outColor ));
//---------------------------- automatically created attributes start ------------------------------------
//---------------------------- automatically created attributes end ------------------------------------
attributeAffects(color, outColor);
attributeAffects(script, outColor);
return MS::kSuccess;
}
示例8: initialize
MStatus ClothSimMayaPlugin::initialize()
{
MFnUnitAttribute unitAttr;
MFnTypedAttribute typedAttr;
MStatus returnStatus;
g_aTime = unitAttr.create("time", "tm", MFnUnitAttribute::kTime, 0.0, &returnStatus);
McheckErr(returnStatus, "ERROR creating time attribute\n");
g_aOutputMesh = typedAttr.create("outputMesh", "out", MFnData::kMesh, &returnStatus);
McheckErr(returnStatus, "ERROR creating output attribute\n");
typedAttr.setStorable(false);
returnStatus = addAttribute(g_aTime);
McheckErr(returnStatus, "ERROR adding time attribute\n");
returnStatus = addAttribute(g_aOutputMesh);
McheckErr(returnStatus, "ERROR adding outputMesh attribute\n");
returnStatus = attributeAffects(g_aTime, g_aOutputMesh);
McheckErr(returnStatus, "ERROR in attributeAffects\n");
return MS::kSuccess;
}
示例9: initialize
MStatus blendCurve::initialize()
{
MStatus status;
MFnNumericAttribute nAttr;
MFnTypedAttribute tAttr;
MFnCompoundAttribute cAttr;
aInputs = cAttr.create( "inputs", "inputs" );
aInputCurve = tAttr.create( "inputCurve", "inputCurve", MFnData::kNurbsCurve );
tAttr.setStorable( false );
aWeight = nAttr.create( "weight", "weight", MFnNumericData::kFloat, 1.0 );
nAttr.setMin( 0.0 );
nAttr.setMax( 1.0 );
nAttr.setKeyable( true );
aBlendPosition = nAttr.create( "blendPosition", "blendPosition", MFnNumericData::kFloat, 1.0 );
nAttr.setMin( 0.0 );
nAttr.setMax( 1.0 );
nAttr.setKeyable( true );
aBlendArea = nAttr.create( "blendArea", "blendArea", MFnNumericData::kFloat, 0.5 );
nAttr.setMin( 0.0 );
nAttr.setMax( 1.0 );
nAttr.setKeyable( true );
cAttr.addChild( aInputCurve );
cAttr.addChild( aWeight );
cAttr.addChild( aBlendPosition );
cAttr.addChild( aBlendArea );
cAttr.setArray( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputs ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputs, outputGeom ) );
return MS::kSuccess;
}
示例10: initialize
//------------------------------------------------------------------------------
//
MStatus AdskPrepareRenderGlobals::initialize()
{
MStatus stat;
MFnStringData stringFn;
MObject emptyStr = stringFn.create( &stat );
MObject* attrib[3];
attrib[0] = &aRepName;
attrib[1] = &aRepLabel;
attrib[2] = &aRepType;
const char* longName[] = {"repName", "repLabel", "repType"};
const char* shortName[] = {"rna", "rla", "rty"};
MFnTypedAttribute stringAttrFn;
for (int i = 0; i < 3; i++)
{
*attrib[i] = stringAttrFn.create(longName[i], shortName[i], MFnData::kString, emptyStr);
stat = MPxNode::addAttribute(*attrib[i]);
CHECK_MSTATUS_AND_RETURN_IT(stat);
}
MFnNumericAttribute boolAttrFn;
aUseRegEx = boolAttrFn.create("useRegExp", "urx", MFnNumericData::kBoolean, 0);
stat = MPxNode::addAttribute(aUseRegEx);
CHECK_MSTATUS_AND_RETURN_IT(stat);
return stat;
}
示例11: initialize
MStatus sgBLocator_fromGeo::initialize()
{
MStatus status;
MFnNumericAttribute nAttr;
MFnTypedAttribute tAttr;
aOutputValue = nAttr.create( "outputValue", "outputValue", MFnNumericData::kInt, 1.0 );
nAttr.setStorable( false );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aOutputValue ) );
CHECK_MSTATUS_AND_RETURN_IT( status );
aInputCurve = tAttr.create( "inputCurve", "inputCurve", MFnData::kNurbsCurve );
tAttr.setStorable( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aInputCurve ) );
aLineWidth = nAttr.create( "lineWidth", "lineWidth", MFnNumericData::kInt, 1 );
nAttr.setMin( 1 );
nAttr.setKeyable( true );
nAttr.setStorable( true );
CHECK_MSTATUS_AND_RETURN_IT( addAttribute( aLineWidth ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aInputCurve, aOutputValue ) );
CHECK_MSTATUS_AND_RETURN_IT( attributeAffects( aLineWidth, aOutputValue ) );
return MS::kSuccess;
}
示例12: initialize
MStatus mapBlendShape::initialize()
{
MStatus status;
MFnNumericAttribute nAttr;
MFnTypedAttribute tAttr;
aBlendMesh = tAttr.create("blendMesh", "blendMesh", MFnData::kMesh);
addAttribute(aBlendMesh);
aBlendMap = nAttr.createColor("blendMap", "blendMap");
addAttribute(aBlendMap);
aUseBlendMap = nAttr.create("useBlendMap", "useBlendMap", MFnNumericData::kBoolean);
nAttr.setDefault(true);
addAttribute(aUseBlendMap);
aBlendMapMultiplier = nAttr.create("blendMapMultiplier", "blendMapMultiplier", MFnNumericData::kFloat);
nAttr.setDefault(1.0);
nAttr.setMin(0.0);
addAttribute(aBlendMapMultiplier);
attributeAffects(aBlendMesh, outputGeom);
attributeAffects(aBlendMap, outputGeom);
attributeAffects(aUseBlendMap, outputGeom);
attributeAffects(aBlendMapMultiplier, outputGeom);
MGlobal::executeCommand( "makePaintable -attrType multiFloat -sm deformer blendNode weights;" );
return MS::kSuccess;
}
示例13: initialize
MStatus animCube::initialize()
{
MFnUnitAttribute unitAttr;
MFnTypedAttribute typedAttr;
MStatus returnStatus;
animCube::time = unitAttr.create( "time", "tm",
MFnUnitAttribute::kTime,
0.0, &returnStatus );
McheckErr(returnStatus, "ERROR creating animCube time attribute\n");
animCube::outputMesh = typedAttr.create( "outputMesh", "out",
MFnData::kMesh,
&returnStatus );
McheckErr(returnStatus, "ERROR creating animCube output attribute\n");
typedAttr.setStorable(false);
returnStatus = addAttribute(animCube::time);
McheckErr(returnStatus, "ERROR adding time attribute\n");
returnStatus = addAttribute(animCube::outputMesh);
McheckErr(returnStatus, "ERROR adding outputMesh attribute\n");
returnStatus = attributeAffects(animCube::time,
animCube::outputMesh);
McheckErr(returnStatus, "ERROR in attributeAffects\n");
return MS::kSuccess;
}
示例14: 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;
}
示例15: initialize
// maya plugin initialization
MStatus CageDeformerNode::initialize()
{
MFnTypedAttribute tAttr;
MFnNumericAttribute nAttr;
MFnEnumAttribute eAttr;
aCageMesh = tAttr.create( "cageMesh", "cm", MFnData::kMesh );
addAttribute( aCageMesh );
attributeAffects( aCageMesh, outputGeom );
aCageMode = eAttr.create( "cageMode", "cgm", 10 );
eAttr.addField( "vertex", 0 );
eAttr.addField( "vertexNormalized", 1 );
eAttr.addField( "vertex avg. normal", 5 );
eAttr.addField( "vertex avg. normal normalized", 6 );
eAttr.addField( "face", 10 );
eAttr.addField( "faceSymmetrized", 11 );
// eAttr.addField( "init", 99 );
addAttribute( aCageMode );
attributeAffects( aCageMode, outputGeom );
aConstraintMode = eAttr.create( "constraintMode", "constraint", 0 );
eAttr.addField( "none", 0 );
eAttr.addField( "allFaces", 1 );
addAttribute( aConstraintMode );
attributeAffects( aConstraintMode, outputGeom );
aConstraintWeight = nAttr.create("constraintWeight", "cw", MFnNumericData::kDouble, 1.0);
nAttr.setStorable(true);
addAttribute( aConstraintWeight );
attributeAffects( aConstraintWeight, outputGeom );
aBlendMode = eAttr.create( "blendMode", "bm", 0 );
eAttr.addField( "polarexp", 0 );
eAttr.addField( "polarexpSE", 1 );
eAttr.addField( "logmatrix3", 2 );
eAttr.addField( "logmatrix4", 3 );
eAttr.addField( "quaternion", 5 );
eAttr.addField( "linear", 10 );
eAttr.addField( "off", 99 );
addAttribute( aBlendMode );
attributeAffects( aBlendMode, outputGeom );
aRotationConsistency = nAttr.create( "rotationConsistency", "rc", MFnNumericData::kBoolean, 0 );
nAttr.setStorable(true);
addAttribute( aRotationConsistency );
attributeAffects( aRotationConsistency, outputGeom );
aFrechetSum = nAttr.create( "frechetSum", "fs", MFnNumericData::kBoolean, 0 );
nAttr.setStorable(true);
addAttribute( aFrechetSum );
attributeAffects( aFrechetSum, outputGeom );
return MS::kSuccess;
}