本文整理汇总了C++中MFnUnitAttribute::setReadable方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnUnitAttribute::setReadable方法的具体用法?C++ MFnUnitAttribute::setReadable怎么用?C++ MFnUnitAttribute::setReadable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnUnitAttribute
的用法示例。
在下文中一共展示了MFnUnitAttribute::setReadable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
MStatus arrowLocator::initialize()
{
//Here we create a new attribute type that handles units: angle, distance or time
MFnUnitAttribute uAttr;
windDirection = uAttr.create("windDirection", "wd", MFnUnitAttribute::kAngle, 0.0);
uAttr.setStorable(true);
uAttr.setWritable(true);
uAttr.setReadable(true);
uAttr.setKeyable(true);
uAttr.setDefault(MAngle(0.0, MAngle::kDegrees));
addAttribute(windDirection);
//- TODO: To make connection between your custom node and your custom
//- TODO: manipulator node, you need to name your custom manipulator
//- TODO: after your custom node type name, also in your custom node's initialize()
//- TODO: function, you need to call MPxManipContainer::addToManipConnectTable().
//- TODO: This method adds the user defined node as an entry in the manipConnectTable
//- TODO: so that when this node is selected the user can use the show manip tool to
//- TODO: get the user defined manipulator associated with this node.
//...
return MS::kSuccess;
}
示例2: initialize
MStatus simpleEvaluationNode::initialize()
{
MFnNumericAttribute nAttr;
MFnUnitAttribute uAttr;
MStatus status;
input = nAttr.create( "input", "in", MFnNumericData::kFloat, 2.0 );
nAttr.setStorable(true);
aTimeInput = uAttr.create( "inputTime", "itm", MFnUnitAttribute::kTime, 0.0 );
uAttr.setWritable(true);
uAttr.setStorable(true);
uAttr.setReadable(true);
uAttr.setKeyable(true);
output = nAttr.create( "output", "out", MFnNumericData::kFloat, 0.0 );
nAttr.setWritable(false);
nAttr.setStorable(false);
status = addAttribute( input );
if (!status) { status.perror("addAttribute"); return status;}
status = addAttribute( aTimeInput );
if (!status) { status.perror("addAttribute"); return status;}
status = addAttribute( output );
if (!status) { status.perror("addAttribute"); return status;}
status = attributeAffects( input, output );
if (!status) { status.perror("attributeAffects"); return status;}
status = attributeAffects( aTimeInput, output );
if (!status) { status.perror("attributeAffects"); return status;}
return MS::kSuccess;
}
示例3:
//- The initialize method is called to create and initialize all of the
//- attributes and attribute dependencies for this node type. This is
//- only called once when the node type is registered with Maya.
//- Return Values: MS::kSuccess / MS::kFailure
//-
/*static*/ MStatus arrowLocator::initialize()
{
//- Here we create a new attribute type that handles units: angle, distance or time
MFnUnitAttribute uAttr;
windDirection = uAttr.create("windDirection", "wd", MFnUnitAttribute::kAngle, 0.0);
uAttr.setStorable(true);
uAttr.setWritable(true);
uAttr.setReadable(true);
uAttr.setKeyable(true);
uAttr.setMin(0.0);
uAttr.setMax(2*PI);
uAttr.setDefault(MAngle(0.0, MAngle::kRadians));
addAttribute(windDirection);
return MS::kSuccess;
}
示例4:
//- The initialize method is called to create and initialize all of the
//- attributes and attribute dependencies for this node type. This is
//- only called once when the node type is registered with Maya.
//- Return Values: MS::kSuccess / MS::kFailure
//-
/*static*/ MStatus arrowLocator::initialize()
{
//- Here we create a new attribute type that handles units: angle, distance or time
MFnUnitAttribute uAttr;
//- TODO: Create a angle attribute with long name "windDirection" and short name "wd"
windDirection = //...
uAttr.setStorable(true);
uAttr.setWritable(true);
uAttr.setReadable(true);
uAttr.setKeyable(true);
//- TODO: Set the min and max value this attribute can have 0, 2PI
//...
//...
uAttr.setDefault(MAngle(0.0, MAngle::kRadians));
addAttribute(windDirection);
return MS::kSuccess;
}
示例5: 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;
}