本文整理汇总了C++中MDGModifier::commandToExecute方法的典型用法代码示例。如果您正苦于以下问题:C++ MDGModifier::commandToExecute方法的具体用法?C++ MDGModifier::commandToExecute怎么用?C++ MDGModifier::commandToExecute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MDGModifier
的用法示例。
在下文中一共展示了MDGModifier::commandToExecute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteCurrentSelection
MStatus deleteCurrentSelection()
{
MStatus status;
MDGModifier modifier;
status = modifier.commandToExecute("\ndelete;\n");
status = modifier.doIt();
return status;
}
示例2: redoIt
MStatus setupRGBShaders::redoIt()
{
int numLayers = meshObjs.length() / 3;
if( numLayers == 0 && meshObjs.length() > 0 )
numLayers++;
if( meshObjs.length() % 3 > 0 && meshObjs.length() > 3 )
numLayers++;
for( int l = 0; l < numLayers; l++ ) {
MStatus stat;
MFnDependencyNode mrUserBufferFn( dgMod.createNode( "mentalrayUserBuffer", &stat ));
dgDoIt();
//MGlobal::executeCommand( MString( "connectAttr -f " ) + mrUserBufferFn.name() + ".message miDefaultOptions.frameBufferList[" + l + "]" );
dgMod.commandToExecute( MString( "connectAttr -f " ) + mrUserBufferFn.name() + ".message miDefaultOptions.frameBufferList[" + l + "]" );
dgDoIt();
mrUserBufferFn.findPlug( "dataType" ).setValue( 5 );
for( int i = 0; i < 3; i++ ) {
if(( l * 3 + i ) > (int)meshObjs.length() - 1 ) break;
MFnDependencyNode nkPassFn( dgMod.createNode( "nkPass" ));
dgDoIt();
MFnDependencyNode meshFn( meshObjs[ l * 3 + i ]);
dgMod.commandToExecute( MString( "sets -renderable true -noSurfaceShader true -empty -name " ) + nkPassFn.name() + "SG" );
dgDoIt();
dgMod.commandToExecute( MString( "connectAttr -f " ) + nkPassFn.name() + ".outValue " + nkPassFn.name() + "SG.miMaterialShader" );
dgDoIt();
dgMod.commandToExecute( MString( "sets -e -forceElement ") + nkPassFn.name() + "SG " + meshFn.name());
dgDoIt();
/*MGlobal::executeCommand( MString( "sets -renderable true -noSurfaceShader true -empty -name " ) + nkPassFn.name() + "SG" );
MGlobal::executeCommand( MString( "connectAttr -f " ) + nkPassFn.name() + ".outValue " + nkPassFn.name() + "SG.miMaterialShader" );
MGlobal::executeCommand( MString( "sets -e -forceElement ") + nkPassFn.name() + "SG " + meshFn.name());*/
nkPassFn.findPlug( "layerNumber" ).setValue( l );
if( i == 0 )
dgMod.commandToExecute( MString( "setAttr " ) + nkPassFn.name() + ".color -type double3 1 0 0" );
//MGlobal::executeCommand( MString( "setAttr " ) + nkPassFn.name() + ".color -type double3 1 0 0" );
if( i == 1 )
dgMod.commandToExecute( MString( "setAttr " ) + nkPassFn.name() + ".color -type double3 0 1 0" );
//MGlobal::executeCommand( MString( "setAttr " ) + nkPassFn.name() + ".color -type double3 0 1 0" );
if( i == 2 )
dgMod.commandToExecute( MString( "setAttr " ) + nkPassFn.name() + ".color -type double3 0 0 1" );
//MGlobal::executeCommand( MString( "setAttr " ) + nkPassFn.name() + ".color -type double3 0 0 1" );
dgDoIt();
}
}
for( unsigned int c = 0; c < camObjs.length(); c++ ) {
MFnDependencyNode mrOutputPass( dgMod.createNode( "mentalrayOutputPass" ));
dgDoIt();
MFnDependencyNode nkSaver( dgMod.createNode( "nkSaver" ));
dgDoIt();
dgMod.connect( nkSaver.findPlug( "outValue" ), mrOutputPass.findPlug( "outputShader" ));
dgDoIt();
MFnDependencyNode camFn( camObjs[c] );
//MGlobal::executeCommand( MString( "connectAttr -f " ) + mrOutputPass.name() + ".message " + camFn.name() + ".miOutputShaderList[0]" );
dgMod.commandToExecute( MString( "connectAttr -f " ) + mrOutputPass.name() + ".message " + camFn.name() + ".miOutputShaderList[0]" );
dgDoIt();
nkSaver.findPlug( "numLayers" ).setValue( numLayers );
nkSaver.findPlug( "camName" ).setValue( camFn.name() );
nkSaver.findPlug( "fileName" ).setValue( fileName );
nkSaver.findPlug( "folderPath" ).setValue( folderPath );
mrOutputPass.findPlug( "datatype" ).setValue( 5 );
}
setResult( "Shaders setup to Render" );
return MS::kSuccess;
}