本文整理汇总了C++中MFnDagNode::fullPathName方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnDagNode::fullPathName方法的具体用法?C++ MFnDagNode::fullPathName怎么用?C++ MFnDagNode::fullPathName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnDagNode
的用法示例。
在下文中一共展示了MFnDagNode::fullPathName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createSceneGraph
void Exporter::createSceneGraph(MFnDagNode& path, int parentIndex)
{
Node output;
std::vector<std::string> pathparts;
output.name = path.fullPathName().asChar();
splitStringToVector(output.name, pathparts, "|");
output.name = pathparts[pathparts.size() - 1];
if (!strcmp(output.name.c_str(), "persp"))
return;
else if (!strcmp(output.name.c_str(), "top"))
return;
else if (!strcmp(output.name.c_str(), "side"))
return;
else if (!strcmp(output.name.c_str(), "front"))
return;
output.parent = parentIndex;
output.transform = path.transformationMatrix().matrix;
scene_.sceneGraph.push_back(output);
int children = path.childCount();
int parent = scene_.sceneGraph.size() - 1;
for (int i = 0; i < children; i++)
{
cout << path.child(i).apiTypeStr() << endl;
if (!strcmp(path.child(i).apiTypeStr(), "kMesh")){
scene_.sceneGraph[parent].type = 1;
MFnMesh mesh(path.child(i));
MDagPath dag_path;
MItDag dag_iter(MItDag::kBreadthFirst, MFn::kMesh);
int y = 0;
while (!dag_iter.isDone())
{
if (dag_iter.getPath(dag_path))
{
MFnDagNode dag_node = dag_path.node();
if (!dag_node.isIntermediateObject())
{
if (!strcmp(mesh.partialPathName().asChar(), dag_node.partialPathName().asChar()))
scene_.sceneGraph[parent].mesh = y;
y++;
}
}
dag_iter.next();
}
}
// else if (!strcmp(path.child(i).apiTypeStr(), "kCamera")); kan l�gga till fler typer h�r
else
createSceneGraph(MFnDagNode(path.child(i)), parent);
}
}
示例2: setArrayPlugSize
//---------------------------------------------------
void DagHelper::setArrayPlugSize ( MPlug& plug, uint size )
{
if ( plug.node().isNull() ) return;
#if MAYA_API_VERSION >= 800
MStatus status = plug.setNumElements ( size );
CHECK_STAT ( status );
#else
MObject node = plug.node();
MString plugPath = plug.info();
if ( node.hasFn ( MFn::kDagNode ) )
{
MFnDagNode dagFn ( node );
int dot = plugPath.index ( '.' );
plugPath = dagFn.fullPathName() + plugPath.substring ( dot, plugPath.length() );
}
MString command = MString ( "setAttr -s " ) + size + " \"" + plugPath + "\";";
MGlobal::executeCommand ( command );
#endif // MAYA 8.00+
}