本文整理汇总了C++中MFnDependencyNode::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnDependencyNode::setName方法的具体用法?C++ MFnDependencyNode::setName怎么用?C++ MFnDependencyNode::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnDependencyNode
的用法示例。
在下文中一共展示了MFnDependencyNode::setName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: extractFaces_Func
bool tm_polyExtract::extractFaces_Func( MSelectionList &selectionList, MStringArray &node_names)
{
MStatus status;
MObject meshObj;
status = selectionList.getDependNode( 0, meshObj);
if(!status){MGlobal::displayError("tm_polyExtract::extractFaces_Func: Can't find object !");return false;}
MFnMesh meshFn( meshObj, &status);
if(!status){MGlobal::displayError("tm_polyExtract::extractFaces_Func: Non mesh object founded !");return false;}
MDagPath meshDagPath_first, meshDagPath;
selectionList.getDagPath( 0, meshDagPath_first);
MObject multiFaceComponent;
MIntArray inputFacesArray;
inputFacesArray.clear();
inputFacesArray.setSizeIncrement( 4096);
MFnComponentListData compListFn;
compListFn.create();
for (MItSelectionList faceComponentIter(selectionList, MFn::kMeshPolygonComponent); !faceComponentIter.isDone(); faceComponentIter.next())
{
faceComponentIter.getDagPath(meshDagPath, multiFaceComponent);
if(!(meshDagPath_first == meshDagPath))
{
MGlobal::displayError("tm_polyExtract::extractFaces_Func: Different meshes faces founded !");
return false;
}
if (!multiFaceComponent.isNull())
{
for (MItMeshPolygon faceIter(meshDagPath, multiFaceComponent); !faceIter.isDone(); faceIter.next())
{
int faceIndex = faceIter.index();
#ifdef _DEBUG
infoMStr += faceIndex;
infoMStr += " ";
#endif
inputFacesArray.append( faceIndex);
compListFn.add( multiFaceComponent );
}
}
}
if( inputFacesArray.length() == 0)
{
MGlobal::displayError("tm_polyExtract::extractFaces_Func: No faces founded !");
return false;
}
#ifdef _DEBUG
MGlobal::displayInfo( infoMStr);
#endif
meshFn.setObject( meshDagPath_first);
meshObj = meshFn.object();
// MDagModifier dagModifier;
MFnDagNode meshDagNodeFn;
MFnDependencyNode depNodeFn;
meshDagNodeFn.setObject( meshDagPath_first);
MString meshName = meshDagNodeFn.name();
MObject outMesh_attrObject = meshDagNodeFn.attribute( "outMesh");
// ----------------------------------- duplicate shape
MObject duplicated_meshObjectA;
MObject duplicated_meshObjectB;
MObject inMesh_attrObjectA;
MObject inMesh_attrObjectB;
/*
MStringArray commandResult;
MSelectionList selList;
MGlobal::executeCommand( "duplicate " + meshDagNodeFn.name(), commandResult, 1, 1);
selList.add( commandResult[0]);
selList.getDependNode( 0, duplicated_meshObjectA);
meshDagNodeFn.setObject( duplicated_meshObjectA);
meshDagNodeFn.setName( meshName + "_tA");
duplicated_meshObjectA = meshDagNodeFn.child(0);
meshDagNodeFn.setObject( duplicated_meshObjectA);
meshDagNodeFn.setName( meshName + "_sA");
inMesh_attrObjectA = meshDagNodeFn.attribute( "inMesh");
meshDagNodeFn.setObject( meshDagPath_first);
selList.clear();
MGlobal::executeCommand( "duplicate " + meshDagNodeFn.name(), commandResult, 1, 1);
selList.add( commandResult[0]);
selList.getDependNode( 0, duplicated_meshObjectB);
meshDagNodeFn.setObject( duplicated_meshObjectB);
meshDagNodeFn.setName( meshName + "_tB");
duplicated_meshObjectB = meshDagNodeFn.child(0);
meshDagNodeFn.setObject( duplicated_meshObjectB);
meshDagNodeFn.setName( meshName + "_sB");
inMesh_attrObjectB = meshDagNodeFn.attribute( "inMesh");
*/
duplicated_meshObjectA = meshDagNodeFn.duplicate();
meshDagNodeFn.setObject( duplicated_meshObjectA);
meshDagNodeFn.setName( meshName + "_tA");
duplicated_meshObjectA = meshDagNodeFn.child(0);
meshDagNodeFn.setObject( duplicated_meshObjectA);
meshDagNodeFn.setName( meshName + "_sA");
inMesh_attrObjectA = meshDagNodeFn.attribute( "inMesh");
meshDagNodeFn.setObject( meshDagPath_first);
//.........这里部分代码省略.........