本文整理汇总了C++中MItDag::partialPathName方法的典型用法代码示例。如果您正苦于以下问题:C++ MItDag::partialPathName方法的具体用法?C++ MItDag::partialPathName怎么用?C++ MItDag::partialPathName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MItDag
的用法示例。
在下文中一共展示了MItDag::partialPathName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExportMayaNodes
void MayaMeshExporter::ExportMayaNodes(MItDag& dag_iterator)
{
int start_frame = static_cast<int>(MAnimControl::minTime().as(MTime::kNTSCField));
int end_frame = static_cast<int>(MAnimControl::maxTime().as(MTime::kNTSCField));
int num_frames = end_frame - start_frame + 1;
meshml_obj_.NumFrames(num_frames);
MAnimControl::setCurrentTime(MTime(start_frame, MTime::kNTSCField));
for (MItDependencyNodes dn(MFn::kSkinClusterFilter); !dn.isDone(); dn.next())
{
MStatus status = MS::kSuccess;
MObject object = dn.item();
shared_ptr<MFnSkinCluster> skin_cluster = MakeSharedPtr<MFnSkinCluster>(object, &status);
std::vector<MObject> objs;
unsigned int num_geometries = skin_cluster->numOutputConnections();
for (unsigned int i = 0; i < num_geometries; ++ i)
{
unsigned int index = skin_cluster->indexForOutputConnection(i);
objs.push_back(skin_cluster->outputShapeAtIndex(index));
}
if (num_geometries > 0)
{
skin_clusters_.push_back(std::make_pair(skin_cluster, objs));
}
MDagPathArray influence_paths;
int num_influence_objs = skin_cluster->influenceObjects(influence_paths, &status);
MDagPath joint_path, root_path;
for (int i = 0; i < num_influence_objs; ++ i)
{
joint_path = influence_paths[i];
if (joint_path.hasFn(MFn::kJoint))
{
// Try to retrieve the root path
root_path = joint_path;
while (joint_path.length() > 0)
{
joint_path.pop();
if (joint_path.hasFn(MFn::kJoint) && (joint_path.length() > 0))
{
root_path = joint_path;
}
}
if (root_path.hasFn(MFn::kJoint))
{
MFnIkJoint fn_joint(root_path);
// Don't work on existing joints
KLAYGE_AUTO(iter, joint_to_id_.find(fn_joint.fullPathName().asChar()));
if (iter == joint_to_id_.end())
{
this->ExportJoint(NULL, fn_joint, root_path);
}
}
}
}
}
MDagPath dag_path;
for (; !dag_iterator.isDone(); dag_iterator.next())
{
MStatus status = dag_iterator.getPath(dag_path);
if (!status)
{
std::cout << "Fail to get DAG path." << std::endl;
continue;
}
MString obj_name = dag_iterator.partialPathName();
switch (dag_path.apiType())
{
case MFn::kTransform:
{
/*MFnTransform fnTransform(dagPath, &status);
if (status == MS::kSuccess)
{
MFloatMatrix matrix = fnTransform.transformation().asMatrix();
// TODO: how to handle transformations?
}
else
std::cout << "Fail to initialize transform node." << std::endl;*/
}
break;
case MFn::kMesh:
{
MFnMesh fn_mesh(dag_path, &status);
if (MS::kSuccess == status)
{
if (!fn_mesh.isIntermediateObject())
{
this->ExportMesh(obj_name, fn_mesh, dag_path);
}
else
{
//.........这里部分代码省略.........