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


C++ MFnNumericData::object方法代码示例

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


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

示例1: setZeroTweaks

//############################################### tima:
bool polyModifierCmd::setZeroTweaks()
{
	MFnNumericData numDataFn;
	MObject nullVector;
	MFnDependencyNode depNodeFn;

	numDataFn.create( MFnNumericData::k3Float );
	numDataFn.setData( 0, 0, 0 );
	nullVector = numDataFn.object();

	MObject object = fDagPath.node();
	depNodeFn.setObject( object);
	MPlug meshTweakPlug = depNodeFn.findPlug( "pnts" );
	MPlug tweak;

	unsigned numTweaks = fTweakIndexArray.length();

	if( !meshTweakPlug.isNull() )
	{
		for( unsigned i = 0; i < numTweaks; i++ )
		{
			tweak = meshTweakPlug.elementByLogicalIndex( fTweakIndexArray[i] );
			tweak.setValue( nullVector );
		}
	}
	
	return true;
}
开发者ID:AlbertR,项目名称:cgru170,代码行数:29,代码来源:polyModifierCmd.cpp

示例2: depTmpFn

// --------------------------------------------------------------------------------------------
void		polyModifierCmd::deleteTweaks()
// --------------------------------------------------------------------------------------------
{
		
	
	// Now, set the tweak values on the meshNode(s) to zero (History dependent)
		//
		MStatus stat;
		MFnNumericData numDataFn;
		MObject nullVector;

		// Create a NULL vector (0,0,0) using MFnNumericData to pass into the plug
		//

		MFnDependencyNode depTmpFn(fDagPath.node(),&stat);
		//stat.perror("");

		MPlug meshTweakPlug = depTmpFn.findPlug("pnts");

		numDataFn.create( MFnNumericData::k3Float );
		numDataFn.setData( 0, 0, 0 );
		nullVector = numDataFn.object();
		unsigned numTweaks = meshTweakPlug.numElements();
		MPlug tweak;
		for(unsigned  i = 0; i < numTweaks; i++ )
		{
			// Access using logical indices since they are the only plugs guaranteed
			// to hold tweak data.
			//
			tweak = meshTweakPlug.elementByPhysicalIndex(i);
			tweak.setValue( nullVector );
		}

}
开发者ID:Byron,项目名称:bsuite,代码行数:35,代码来源:polyModifierCmd.cpp

示例3:

MStatus polyModifierCmd::getFloat3asMObject( MFloatVector value, MObject& object )
{
	// Convert the float value into an MObject
	//
	MFnNumericData numDataFn;
	numDataFn.create( MFnNumericData::k3Float );
	numDataFn.setData( value[0], value[1], value[2] );
	object = numDataFn.object();
	return MS::kSuccess;
}
开发者ID:AlbertR,项目名称:cgru170,代码行数:10,代码来源:polyModifierCmd.cpp

示例4: processTweaks


//.........这里部分代码省略.........
		int dstOffset = 0;
		
		
		//Progress initialisieren
		progressBar progress("Processing Tweaks", numTweaks);
		

		for( i = 0; i < numTweaks; i++ )
		{
			// Apply tweak data
			//
			tweak = polyTweakPlug.elementByLogicalIndex( fTweakIndexArray[i] );
			tweak.setValue( tweakDataArray[i] );

			// ASSERT: Element plug should be compound!
			//
			MStatusAssert( (tweak.isCompound()),
						   "tweak.isCompound() -- Element plug, 'tweak', is not compound" );

			unsigned numChildren = tweak.numChildren();
			for( j = 0; j < numChildren; j++ )
			{
				tweakChild = tweak.child(j);

				// Apply tweak source connection data
				//
				if( 0 < tweakSrcConnectionCountArray[i*numChildren + j] )
				{
					for( k = 0;
						 k < (unsigned) tweakSrcConnectionCountArray[i*numChildren + j];
						 k++ )
					{
						fDGModifier.connect( tweakChild,
											 tweakSrcConnectionPlugArray[srcOffset] );
						srcOffset++;
					}
				}
						
				// Apply tweak destination connection data
				//
				if( 0 < tweakDstConnectionCountArray[i*numChildren + j] )
				{
					fDGModifier.connect( tweakDstConnectionPlugArray[dstOffset],
										 tweakChild );
					dstOffset++;
				}
			}

			if(i%50 == 0)
			{	
				progress.set(i);
			}
		}

		


		// Now, set the tweak values on the meshNode(s) to zero (History dependent)
		//
		MFnNumericData numDataFn;
		MObject nullVector;

		// Create a NULL vector (0,0,0) using MFnNumericData to pass into the plug
		//
		numDataFn.create( MFnNumericData::k3Float );
		numDataFn.setData( 0, 0, 0 );
		nullVector = numDataFn.object();

		for( i = 0; i < numTweaks; i++ )
		{
			// Access using logical indices since they are the only plugs guaranteed
			// to hold tweak data.
			//
			tweak = meshTweakPlug.elementByLogicalIndex( fTweakIndexArray[i] );
			tweak.setValue( nullVector );
		}

		// Only have to clear the tweaks off the duplicate mesh if we do not have history
		// and we want history.
		//
		if( !fHasHistory && fHasRecordHistory )
		{
			depNodeFn.setObject( data.upstreamNodeShape );
			upstreamTweakPlug = depNodeFn.findPlug( "pnts" );

			if( !upstreamTweakPlug.isNull() )
			{
				for( i = 0; i < numTweaks; i++ )
				{
					tweak = meshTweakPlug.elementByLogicalIndex( fTweakIndexArray[i] );
					tweak.setValue( nullVector );
				}
			}
		}
	}
	else
		fHasTweaks = false;

	return status;
}
开发者ID:Byron,项目名称:bsuite,代码行数:101,代码来源:polyModifierCmd.cpp


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