本文整理汇总了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;
}
示例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 );
}
}
示例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;
}
示例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;
}