本文整理汇总了C++中MDagPath::fullPathName方法的典型用法代码示例。如果您正苦于以下问题:C++ MDagPath::fullPathName方法的具体用法?C++ MDagPath::fullPathName怎么用?C++ MDagPath::fullPathName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MDagPath
的用法示例。
在下文中一共展示了MDagPath::fullPathName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printAllInstancesUsingIterator
void printAllInstancesUsingIterator()
{
//
// Just use the MItInstancer iterator to enumerate all particles in
// all instancers in the scene.
//
MItInstancer it;
while( !it.isDone() )
{
MObject instancerNode = it.instancer();
MDagPath instancerPath = it.instancerPath();
MDagPath instancePath = it.path();
MMatrix instanceMatrix = it.matrix();
MString instancerNodeName = MFnDependencyNode(instancerNode).name();
MString instancerPathName = instancerPath.fullPathName();
MString instancePathName = instancePath.fullPathName();
MMatrix pathMatrix = instancePath.inclusiveMatrix();
MMatrix finalMatrixForPath = pathMatrix * instanceMatrix;
MPoint pos = MPoint::origin * finalMatrixForPath;
char str[512];
sprintf( str, "Instancer node %s, instancer path %s, instancing path %s at position (%lf,%lf,%lf)",
instancerNodeName.asChar(), instancerPathName.asChar(), instancePathName.asChar(), pos.x, pos.y, pos.z );
MGlobal::displayInfo( MString(str) );
it.next();
}
}
示例2: __debugMeshInfo
void TestDeformer::__debugMeshInfo(const char* msg, MObject &meshMobj)
{
#ifdef _DEBUG
MStatus status;
MFnMesh fnMesh(meshMobj, &status);
CHECK_MSTATUS(status);
__debug("%s(), fnMesh.fullPathName=%s", msg, fnMesh.fullPathName().asChar());
__debug("%s(), fnMesh.name=%s", msg, fnMesh.name().asChar());
MDagPath path; CHECK_MSTATUS(fnMesh.getPath(path));
__debug("%s(), path=%s", msg, path.fullPathName().asChar());
MDagPath dagpath = fnMesh.dagPath(&status); CHECK_MSTATUS(status);
__debug("%s(), dagpath=%s", msg, dagpath.fullPathName().asChar());
MFnDependencyNode fnDNode(meshMobj, &status); CHECK_MSTATUS(status);//
__debug("%s(), name=%s", msg, fnDNode.name().asChar());
MFnDagNode fnDagNode(meshMobj, &status);
CHECK_MSTATUS(status);//
MDagPath path2; CHECK_MSTATUS(fnDagNode.getPath(path2));//
__debug("%s(), path2=%s", msg, path2.fullPathName().asChar());
MDagPath dagpath2 = fnDagNode.dagPath(&status); CHECK_MSTATUS(status);//
__debug("%s(), dagpath2=%s", msg, dagpath2.fullPathName().asChar());
#endif
}
示例3: userDAGGenericCB
void userDAGGenericCB(MDagMessage::DagMessage msg, MDagPath &child,
MDagPath &parent, void *)
{
MString dagStr("DAG Changed - ");
switch (msg) {
case MDagMessage::kParentAdded:
dagStr += "Parent Added: ";
break;
case MDagMessage::kParentRemoved:
dagStr += "Parent Removed: ";
break;
case MDagMessage::kChildAdded:
dagStr += "Child Added: ";
break;
case MDagMessage::kChildRemoved:
dagStr += "Child Removed: ";
break;
case MDagMessage::kChildReordered:
dagStr += "Child Reordered: ";
break;
default:
dagStr += "Unknown Type: ";
break;
}
dagStr += "child = ";
dagStr += child.fullPathName();
dagStr += ", parent = ";
dagStr += parent.fullPathName();
// Check to see if the parent is the world object.
//
MStatus pStat;
parent.transform(&pStat);
if (MS::kInvalidParameter == pStat) {
dagStr += "(WORLD)";
}
// Install callbacks if node is not in the model.
// Callback is for node added to model.
bool incomplete = false;
if ( dagNotInModel( child ) ) {
installNodeAddedCallback( child );
incomplete = true;
}
if ( dagNotInModel( parent ) ) {
installNodeAddedCallback( parent);
incomplete = true;
}
// Warn user that dag path info may be
// incomplete
if (incomplete)
dagStr += "\t// May be incomplete!";
MGlobal::displayInfo(dagStr);
}
示例4: CreateMeshData
bool HesperisPolygonalMeshIO::CreateMeshData(APolygonalMesh * data, const MDagPath & path)
{
MGlobal::displayInfo(MString("todo poly mesh write ")+path.fullPathName());
MStatus stat;
MFnMesh fmesh(path.node(), &stat);
if(!stat) {
MGlobal::displayInfo(MString(" not a mesh ") + path.fullPathName());
return false;
}
unsigned np = fmesh.numVertices();
unsigned nf = fmesh.numPolygons();
unsigned ni = fmesh.numFaceVertices();
data->create(np, ni, nf);
Vector3F * pnts = data->points();
unsigned * inds = data->indices();
unsigned * cnts = data->faceCounts();
MPointArray ps;
MPoint wp;
MMatrix worldTm;
worldTm = GetWorldTransform(path);
fmesh.getPoints(ps, MSpace::kObject);
unsigned i = 0;
for(;i<np;i++) {
wp = ps[i] * worldTm;
pnts[i].set((float)wp.x, (float)wp.y, (float)wp.z);
}
unsigned j;
unsigned acc = 0;
MIntArray vertices;
MItMeshPolygon faceIt(path);
for(i=0; !faceIt.isDone(); faceIt.next(), i++) {
cnts[i] = faceIt.polygonVertexCount();
faceIt.getVertices(vertices);
for(j = 0; j < vertices.length(); j++) {
inds[acc] = vertices[j];
acc++;
}
}
data->computeFaceDrift();
return true;
}
示例5: needToTraverse
bool usdWriteJob::needToTraverse(const MDagPath& curDag)
{
MObject ob = curDag.node();
// NOTE: Already skipping all intermediate objects
// skip all intermediate nodes (and their children)
if (PxrUsdMayaUtil::isIntermediate(ob)) {
return false;
}
// skip nodes that aren't renderable (and their children)
if (mJobCtx.mArgs.excludeInvisible && !PxrUsdMayaUtil::isRenderable(ob)) {
return false;
}
if (!mJobCtx.mArgs.exportDefaultCameras && ob.hasFn(MFn::kTransform)) {
// Ignore transforms of default cameras
MString fullPathName = curDag.fullPathName();
if (fullPathName == "|persp" ||
fullPathName == "|top" ||
fullPathName == "|front" ||
fullPathName == "|side") {
return false;
}
}
return true;
}
示例6: getChildDags
void LiveScene::getChildDags( const MDagPath& dagPath, MDagPathArray& paths ) const
{
for( unsigned i=0; i < dagPath.childCount(); ++i )
{
MDagPath childPath = dagPath;
childPath.push( dagPath.child( i ) );
if( dagPath.length() == 0 )
{
// bizarrely, this iterates through things like the translate manipulator and
// the view cube too, so lets skip them so they don't show up:
if( childPath.node().hasFn( MFn::kManipulator3D ) )
{
continue;
}
// looks like it also gives us the ground plane, so again, lets skip that:
if( childPath.fullPathName() == "|groundPlane_transform" )
{
continue;
}
}
paths.append( childPath );
}
}
示例7: onOtherNode
void liqIPRNodeMessage::onOtherNode(const MString &node, std::vector<MString> &updateObjectName)
{
MStringArray descendents;
MString cmd("listRelatives -allDescendents "+node);
MGlobal::executeCommand(cmd, descendents);
for(int i=0; i<descendents.length(); ++i)
{
addUpdateObject(updateObjectName, descendents[i]);//record descendents[i]
MDagPath dagPath;
getDagPathByName(dagPath, descendents[i].asChar());
if( dagPath.node().hasFn(MFn::kTransform) )
{
onOtherNode(descendents[i], updateObjectName);//visit descendents[i]
}
else if( dagPath.node().hasFn(MFn::kMesh) )
{
std::vector<std::string> shaderPlugs;
liquid::RendererMgr::getInstancePtr()->
getRenderer()->getValidShaderPlugsInShadingGroup(shaderPlugs);
IfMErrorWarn(dagPath.extendToShape());//extend to shape
std::vector<std::string> shadingGroups;
getShadingGroups(dagPath.fullPathName(), shadingGroups);
for(std::size_t j=0; j<shadingGroups.size(); ++j)//for each shading group
{
MString shadingGroup(shadingGroups[j].c_str());
for(std::size_t k=0; k<shaderPlugs.size(); ++k)//for each shader plug
{
MString shaderPlug(shaderPlugs[k].c_str());
int isShaderPlugExist;
cmd = "attributeQuery -node \""+shadingGroup+"\" -ex \""+shaderPlug+"\"";
IfMErrorMsgWarn(MGlobal::executeCommand( cmd, isShaderPlugExist), cmd);
if( isShaderPlugExist )
{
//get the source shade node of $shadingGroup.$shaderPlug
MStringArray shaders;
cmd = "listConnections -s true -d false -plugs false (\""+shadingGroup+"\" + \"."+shaderPlug+"\")";
IfMErrorMsgWarn(MGlobal::executeCommand( cmd, shaders), cmd);
if( shaders.length() > 0 )//has source shader node
{
onShaderNode(shaders[0], updateObjectName);
}//if( shaders.length() > 0 )//has source shader node
}//if( isShaderPlugExist )
}//for each shader plug
}//for each shading group
}//kMesh
}//for(int i=0; i<descendents.length(); ++i)
}
示例8: CheckExistingCurves
bool HesperisCurveCreator::CheckExistingCurves(CurveGroup * geos, MObject &target)
{
MDagPath root;
MDagPath::getAPathTo(target, root);
std::map<std::string, MDagPath > existing;
ASearchHelper::AllTypedPaths(existing, root, MFn::kNurbsCurve);
const unsigned ne = existing.size();
if(ne < 1) return false;
if(ne != geos->numCurves()) return false;
unsigned n = 0;
std::map<std::string, MDagPath >::const_iterator it = existing.begin();
for(;it!=existing.end();++it) {
MFnNurbsCurve fcurve(it->second.node());
n += fcurve.numCVs();
}
if(n!=geos->numPoints()) {
AHelper::Info<MString>("existing curves nv don't match cached data ", root.fullPathName());
return false;
}
MGlobal::displayInfo(" existing curves matched");
return true;
}
示例9: find
/**
* Find the hash table entry for the given object.
*/
liqRibNodePtr liqRibHT::find( MString nodeName, MDagPath path, ObjectType objType
/*objType = MRT_Unknown*/ )
{
CM_TRACE_FUNC("liqRibHT::find("<<nodeName.asChar()<<","<<path.fullPathName().asChar()<<","<<objType<<")");
LIQDEBUGPRINTF( "-> finding node in hash table using object, %s\n", nodeName.asChar() );
liqRibNodePtr result;
ulong hc;
for( unsigned index( 0 ); index < RibHashVec.size(); index++ )
if( RibHashVec[ index ] == nodeName.asChar() && objTypeVec[ index ] == objType )
{
hc = index;
break;
}
LIQDEBUGPRINTF( "-> Done\n" );
RNMAP::iterator iter( RibNodeMap.find( hc ) );
while( ( iter != RibNodeMap.end() ) && ( (*iter).first == hc ) )
{
if( (*iter).second->path() == path )
{
result = (*iter).second;
iter = RibNodeMap.end();
}
else
iter++;
}
LIQDEBUGPRINTF( "-> finished finding node in hash table using object\n" );
return result;
}
示例10: getReferenceFilename
// --------------------------------------
MString ReferenceManager::getReferenceFilename ( const MDagPath& path )
{
MString command = MString("reference -q -f ") + path.fullPathName();
MString filename;
MGlobal::executeCommand(command, filename);
return filename;
}
示例11: DoLs
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
MStatus CVsSkinnerCmd::DoLs()
{
MSelectionList tmpList;
if ( m_undo.ArgDatabase().isFlagSet( kOptSelected ) )
{
MSelectionList skinnerNodes;
m_undo.ArgDatabase().getObjects( skinnerNodes );
GetSpecifiedSkinnerNodes( skinnerNodes, tmpList );
}
else
{
MDagPath eDagPath;
FindSkinnerNodesInHierarchy( eDagPath, tmpList );
}
const bool longPath( m_undo.ArgDatabase().isFlagSet( kOptLong ) );
MStringArray result;
MDagPath mDagPath;
for ( MItSelectionList sIt( tmpList ); !sIt.isDone(); sIt.next() )
{
if ( sIt.getDagPath( mDagPath ) )
{
result.append( longPath ? mDagPath.fullPathName() : mDagPath.partialPathName() );
}
}
setResult( result );
return MS::kSuccess;
}
示例12: testResults
MStatus exampleCameraSetViewCmd::testResults(MPx3dModelView &view)
{
MObject cstObj = MObject::kNullObj;
MStatus stat = view.getCameraSet(cstObj);
if (stat != MS::kSuccess)
return stat;
cout << "fCameraList.length() = " << fCameraList.length() << endl;
cout << "fCameraList = " << fCameraList << endl;
MFnCameraSet cstFn(cstObj);
unsigned int numLayers = cstFn.getNumLayers();
cout << "view.cameraSet.numLayers = " << numLayers << endl;
cout << "Cameras:" << endl;
for (unsigned int i=0; i<numLayers; i++)
{
MDagPath camPath;
cstFn.getLayerCamera(i, camPath);
camPath.extendToShape();
cout << " " << camPath.fullPathName() << endl;
}
return MS::kSuccess;
}
示例13: dagPathToColladaId
//---------------------------
String DocumentExporter::dagPathToColladaId(const MDagPath& dagPath, bool removeFirstNamespace)
{
// Make an unique COLLADA Id from a dagPath.
// We are free to use anything we want for Ids. For now use
// full path name to ensure id uniqueness. DagPath partial name can not be used
// because it can lead to issues when referencing nodes sharing the same name.
return mayaNameToColladaName(dagPath.fullPathName(), false, removeFirstNamespace);
}
示例14: addSampleFromMesh
bool CacheMeshSampler::addSampleFromMesh(MFnMesh& mesh)
{
MDagPath dagPath;
mesh.getPath(dagPath);
MString path = dagPath.fullPathName();
return fAttributeSet.updateAnimatedChannels(
fIsAnimated, AttributeSet(mesh, fNeedUVs, fUseBaseTessellation), path);
}
示例15: outputObjectName
void liqWriteArchive::outputObjectName(const MDagPath &objDagPath)
{
MString name = objDagPath.fullPathName();
RiArchiveRecord(RI_VERBATIM, "\n");
outputIndentation();
RtString ribname = const_cast< char* >( name.asChar() );
RiAttribute( "identifier", "name", &ribname, RI_NULL );
}