当前位置: 首页>>代码示例>>C++>>正文


C++ MFnUnitAttribute::setMin方法代码示例

本文整理汇总了C++中MFnUnitAttribute::setMin方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnUnitAttribute::setMin方法的具体用法?C++ MFnUnitAttribute::setMin怎么用?C++ MFnUnitAttribute::setMin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MFnUnitAttribute的用法示例。


在下文中一共展示了MFnUnitAttribute::setMin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
}
开发者ID:animformed,项目名称:complete-maya-programming-book-files,代码行数:27,代码来源:SwirlDeformer.cpp

示例2: initialize

MStatus BasicLocator::initialize()
{ 
MFnUnitAttribute unitFn;    
MFnNumericAttribute numFn;
MStatus stat;
    
xWidth = unitFn.create( "xWidth", "xw", MFnUnitAttribute::kDistance );
unitFn.setDefault( MDistance(1.0, MDistance::uiUnit()) );
unitFn.setMin( MDistance(0.0, MDistance::uiUnit()) );
unitFn.setKeyable( true );
stat = addAttribute( xWidth );
if (!stat) 
    {
	stat.perror( "Unable to add \"xWidth\" attribute" );
	return stat;
    } 

zWidth = unitFn.create( "zWidth", "zw", MFnUnitAttribute::kDistance );
unitFn.setDefault( MDistance(1.0, MDistance::uiUnit()) );
unitFn.setMin( MDistance(0.0, MDistance::uiUnit()) );
unitFn.setKeyable( true );
stat = addAttribute( zWidth );
if (!stat) 
    {
	stat.perror( "Unable to add \"zWidth\" attribute" );
	return stat;
    } 

dispType = numFn.create( "dispType", "att", MFnNumericData::kShort );
numFn.setDefault( 0);
numFn.setMin( 0 );
numFn.setMax( 2 );
numFn.setKeyable( true );
stat = addAttribute( dispType );
if (!stat) 
    {
	stat.perror( "Unable to add \"dispType\" attribute" );
	return stat;
    }

// Notify Maya that there is an associated manipulator for this particular type of node
MPxManipContainer::addToManipConnectTable( const_cast<MTypeId &>( typeId ) );

return MS::kSuccess;
}
开发者ID:animformed,项目名称:complete-maya-programming-book-files,代码行数:45,代码来源:BasicLocator.cpp

示例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;
}
开发者ID:JerryKon,项目名称:Maya-Training-Material,代码行数:21,代码来源:arrowLocatorNode.cpp

示例4: initialize

MStatus kgLocator::initialize()

{
	

	MFnUnitAttribute  unitFn;
	MStatus stat;
	
	//Let us inherit the attributes,
	//in case we need it
	MString parentClass("MPxLocatorNode");
	stat = inheritAttributesFrom( parentClass );
	
	//Create the height attribute
	height = unitFn.create( "height", "h", MFnUnitAttribute::kDistance );
	unitFn.setDefault( MDistance( 2.0,  MDistance::uiUnit() ) );
	unitFn.setMin( MDistance( 0.0,  MDistance::uiUnit() ) );	
	stat = addAttribute( height );
	if (!stat )
	{
		stat.perror( "Unable to add \"height\" attribute");
		return stat;
		
	}


	//generates points for drwing the locator
	getPoints( pts );
	
	
	// Notify Maya that there is an associated manipulator for this particular type of node
	MPxManipContainer::addToManipConnectTable( const_cast<MTypeId &>( id ) );
	
	return MS::kSuccess;
	
}
开发者ID:kgeorge,项目名称:kgeorge-lib,代码行数:36,代码来源:kgLocatorNode.cpp


注:本文中的MFnUnitAttribute::setMin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。