本文整理汇总了C++中MFnEnumAttribute::setChannelBox方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnEnumAttribute::setChannelBox方法的具体用法?C++ MFnEnumAttribute::setChannelBox怎么用?C++ MFnEnumAttribute::setChannelBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnEnumAttribute
的用法示例。
在下文中一共展示了MFnEnumAttribute::setChannelBox方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
MStatus retargetLocator::initialize()
{
MFnNumericAttribute nAttr;
MFnMatrixAttribute mAttr;
MFnEnumAttribute eAttr;
MFnUnitAttribute uAttr;
MFnCompoundAttribute cAttr;
MFnTypedAttribute tAttr;
aOutput = nAttr.create( "output", "output", MFnNumericData::kDouble );
nAttr.setStorable( false );
CHECK_MSTATUS( addAttribute( aOutput ) );
aDiscMatrix = mAttr.create( "discMatrix", "discMatrix" );
mAttr.setStorable( true );
CHECK_MSTATUS( addAttribute( aDiscMatrix ) );
CHECK_MSTATUS( attributeAffects( aDiscMatrix, aOutput ) );
aDiscAxis = eAttr.create( "discAxis", "discAxis", 0 );
eAttr.addField( "X", 0 );
eAttr.addField( "Y", 1 );
eAttr.addField( "Z", 2 );
eAttr.setStorable( true );
eAttr.setChannelBox( true );
eAttr.setReadable( true );
CHECK_MSTATUS( addAttribute( aDiscAxis ) );
CHECK_MSTATUS( attributeAffects( aDiscAxis, aOutput ) );
aDiscDivision = nAttr.create( "discDivision", "discDivision", MFnNumericData::kInt, 32 );
nAttr.setMin( 1 );
nAttr.setMax( 32 );
nAttr.setStorable( true );
nAttr.setChannelBox( true );
CHECK_MSTATUS( addAttribute( aDiscDivision ) );
CHECK_MSTATUS( attributeAffects( aDiscDivision, aOutput ) );
aDiscAngle = uAttr.create( "discAngle", "discAngle", MFnUnitAttribute::kAngle, 0.0 );
uAttr.setStorable( true );
uAttr.setChannelBox( true );
CHECK_MSTATUS( addAttribute( aDiscAngle ) );
CHECK_MSTATUS( attributeAffects( aDiscAngle, aOutput ) );
aDiscOffsetX = nAttr.create( "discOffsetX", "discOffsetX", MFnNumericData::kDouble, 0.0 );
aDiscOffsetY = nAttr.create( "discOffsetY", "discOffsetY", MFnNumericData::kDouble, 0.0 );
aDiscOffsetZ = nAttr.create( "discOffsetZ", "discOffsetZ", MFnNumericData::kDouble, 0.0 );
aDiscOffset = nAttr.create( "discOffset", "discOffset", aDiscOffsetX, aDiscOffsetY, aDiscOffsetZ );
uAttr.setStorable( true );
uAttr.setChannelBox( true );
CHECK_MSTATUS( addAttribute( aDiscOffset ) );
CHECK_MSTATUS( attributeAffects( aDiscOffset, aOutput ) );
aDiscSizeX = nAttr.create( "discSizeX", "discSizeX", MFnNumericData::kDouble, 1.0 );
aDiscSizeY = nAttr.create( "discSizeY", "discSizeY", MFnNumericData::kDouble, 1.0 );
aDiscSizeZ = nAttr.create( "discSizeZ", "discSizeZ", MFnNumericData::kDouble, 1.0 );
aDiscSize = nAttr.create( "discSize", "discSize", aDiscSizeX, aDiscSizeY, aDiscSizeZ );
uAttr.setStorable( true );
uAttr.setChannelBox( true );
CHECK_MSTATUS( addAttribute( aDiscSize ) );
CHECK_MSTATUS( attributeAffects( aDiscSize, aOutput ) );
aDiscActiveColor = nAttr.createColor( "discActiveColor", "discActiveColor" );
nAttr.setStorable( true );
nAttr.setUsedAsColor(true);
nAttr.setDefault(1.0f, 1.0f, 1.0f);
CHECK_MSTATUS( addAttribute( aDiscActiveColor ) );
CHECK_MSTATUS( attributeAffects( aDiscActiveColor, aOutput ) );
aDiscLeadColor = nAttr.createColor( "discLeadColor", "discLeadColor" );
nAttr.setStorable( true );
nAttr.setUsedAsColor(true);
nAttr.setDefault(.263f, 1.0f, .639f);
CHECK_MSTATUS( addAttribute( aDiscLeadColor ) );
CHECK_MSTATUS( attributeAffects( aDiscLeadColor, aOutput ) );
aDiscDefaultColor = nAttr.createColor( "discDefaultColor", "discDefaultColor" );
nAttr.setStorable( true );
nAttr.setUsedAsColor(true);
nAttr.setDefault(.0f, .016f, .376f);
CHECK_MSTATUS( addAttribute( aDiscDefaultColor ) );
CHECK_MSTATUS( attributeAffects( aDiscDefaultColor, aOutput ) );
aDiscFillAlpha = nAttr.create( "discFillAlpha", "discFillAlpha", MFnNumericData::kFloat, 0.1f );
nAttr.setStorable( true );
nAttr.setMin( 0.0f );
nAttr.setMax( 1.0f );
CHECK_MSTATUS( addAttribute( aDiscFillAlpha ) );
CHECK_MSTATUS( attributeAffects( aDiscFillAlpha, aOutput ) );
aDiscLineAlpha = nAttr.create( "discLineAlpha", "discLineAlpha", MFnNumericData::kFloat, 1.0f );
nAttr.setStorable( true );
nAttr.setMin( 0.0f );
nAttr.setMax( 1.0f );
CHECK_MSTATUS( addAttribute( aDiscLineAlpha ) );
CHECK_MSTATUS( attributeAffects( aDiscLineAlpha, aOutput ) );
//.........这里部分代码省略.........
示例2: initialize
// Attributes initialisation
MStatus DA_GridGenerator::initialize()
{
MStatus stat;
MFnCompoundAttribute cAttr;
MFnNumericAttribute nAttr;
MFnEnumAttribute eAttr;
MFnTypedAttribute tAttr;
//
// Controls
//
aWidth = nAttr.create("width", "w", MFnNumericData::kDouble, 1.0);
nAttr.setMin(0.001);
nAttr.setChannelBox(true);
nAttr.setKeyable(true);
stat = addAttribute(aWidth);
CHECK_MSTATUS(stat);
aHeight = nAttr.create("height", "h", MFnNumericData::kDouble, 1.0);
nAttr.setMin(0.001);
nAttr.setChannelBox(true);
nAttr.setKeyable(true);
stat = addAttribute(aHeight);
CHECK_MSTATUS(stat);
aResolutionX = nAttr.create("resolutionX", "resx", MFnNumericData::kInt, 10);
nAttr.setMin(2);
nAttr.setChannelBox(true);
nAttr.setKeyable(true);
aResolutionY = nAttr.create("resolutionY", "resy", MFnNumericData::kInt, 10);
nAttr.setMin(2);
nAttr.setChannelBox(true);
nAttr.setKeyable(true);
aResolution = cAttr.create("resolution", "res");
stat = cAttr.addChild(aResolutionX);
CHECK_MSTATUS(stat);
stat = cAttr.addChild(aResolutionY);
CHECK_MSTATUS(stat);
stat = addAttribute(aResolution);
CHECK_MSTATUS(stat);
aPattern = eAttr.create("pattern","pat",0);
eAttr.addField(DA_GridGeneratorPatterns::NONE, 0);
eAttr.addField(DA_GridGeneratorPatterns::BRICK_U, 1);
eAttr.addField(DA_GridGeneratorPatterns::BRICK_V, 2);
eAttr.setChannelBox(true);
eAttr.setKeyable(true);
stat = addAttribute(aPattern);
CHECK_MSTATUS(stat);
//
// Outputs
//
aOutDynamicArray = tAttr.create("outDynamicArray", "oda", MFnData::kDynArrayAttrs);
tAttr.setWritable(false); // Just output
stat = addAttribute(aOutDynamicArray);
CHECK_MSTATUS(stat);
//
// Attributes affects
//
attributeAffects(aWidth, aOutDynamicArray);
attributeAffects(aHeight, aOutDynamicArray);
attributeAffects(aResolutionX, aOutDynamicArray);
attributeAffects(aResolutionY, aOutDynamicArray);
attributeAffects(aPattern, aOutDynamicArray);
// Done
return stat;
}