本文整理汇总了C++中MFnUnitAttribute::setCached方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnUnitAttribute::setCached方法的具体用法?C++ MFnUnitAttribute::setCached怎么用?C++ MFnUnitAttribute::setCached使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnUnitAttribute
的用法示例。
在下文中一共展示了MFnUnitAttribute::setCached方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
//
// Initialize the node
//
MStatus jhMeshBlur::initialize()
{
// attribute types
MFnUnitAttribute unitAttr;
MFnNumericAttribute nAttr;
MFnTypedAttribute tAttr;
aOldMeshData = tAttr.create("oldMesh","om",MFnData::kPointArray);
tAttr.setArray(true);
tAttr.setHidden(true);
tAttr.setIndexMatters(true);
// create the attributes
aStrength = nAttr.create( "Strength", "str", MFnNumericData::kFloat,1.0);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setMax(1.0);
nAttr.setMin(0.0);
aTreshhold = nAttr.create( "Treshold", "tres", MFnNumericData::kFloat,0.0);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setMin(0.0);
aShapeFactor = nAttr.create( "ShapeFactor", "shapef", MFnNumericData::kFloat,0.5);
nAttr.setStorable(true);
nAttr.setKeyable(true);
nAttr.setMax(1.0);
nAttr.setMin(0.0);
aTweakBlur = nAttr.create( "TweakBlur", "tweak", MFnNumericData::kBoolean,false);
nAttr.setKeyable(false);
nAttr.setChannelBox(true);
aQuadInterp = nAttr.create( "QuadInterpolation", "qi", MFnNumericData::kBoolean,true);
nAttr.setKeyable(false);
nAttr.setChannelBox(true);
aInterpPower = nAttr.create( "InterpolationPower", "interp", MFnNumericData::kDouble, 0.75);
nAttr.setKeyable(true);
nAttr.setMax(1.0);
nAttr.setMin(0.0);
aTime = unitAttr.create( "time", "tm", MFnUnitAttribute::kTime, 1.0 );
unitAttr.setStorable(true);
unitAttr.setCached(true);
unitAttr.setReadable(true);
unitAttr.setWritable(true);
unitAttr.setAffectsAppearance(true);
unitAttr.setAffectsWorldSpace(true);
// Make the attributes visible to the user
addAttribute( aStrength);
addAttribute( aTreshhold);
addAttribute( aTime);
addAttribute( aTweakBlur);
addAttribute( aQuadInterp);
addAttribute( aInterpPower);
addAttribute( aOldMeshData);
// Make sure when an attribute changes, the node updates
attributeAffects( aTime, outputGeom );
attributeAffects( aStrength, outputGeom );
attributeAffects( aTreshhold, outputGeom );
attributeAffects( aQuadInterp, outputGeom );
attributeAffects( aInterpPower, outputGeom );
// Not implented yet, but make the weights paintable :)
MGlobal::executeCommand("makePaintable -attrType multiFloat -sm deformer jhMeshBlur weights;");
return MStatus::kSuccess;
}