当前位置: 首页>>代码示例>>C++>>正文


C++ MDagPath::fullPathName方法代码示例

本文整理汇总了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();
	}
}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:29,代码来源:instancerListCmd.cpp

示例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
}
开发者ID:yaoyansi,项目名称:mymagicbox,代码行数:31,代码来源:testDeformer.cpp

示例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);
}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:57,代码来源:dagMessageCmd.cpp

示例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;
}
开发者ID:ahmidou,项目名称:aphid,代码行数:48,代码来源:HesperisPolygonalMeshIO.cpp

示例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;
}
开发者ID:JT-a,项目名称:USD,代码行数:28,代码来源:usdWriteJob.cpp

示例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 );
	}
}
开发者ID:cnpinto,项目名称:cortex,代码行数:26,代码来源:LiveScene.cpp

示例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)

}
开发者ID:maya2renderer,项目名称:maya2renderer,代码行数:60,代码来源:liqIPRNodeMessageCmd.cpp

示例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;
}
开发者ID:kkaushalp,项目名称:aphid,代码行数:28,代码来源:HesperisCurveIO.cpp

示例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;
}
开发者ID:maya2renderer,项目名称:maya2renderer,代码行数:37,代码来源:liqRibHT.cpp

示例10: getReferenceFilename

 // --------------------------------------
 MString ReferenceManager::getReferenceFilename ( const MDagPath& path )
 {
     MString command = MString("reference -q -f ") + path.fullPathName();
     MString filename;
     MGlobal::executeCommand(command, filename);
     return filename;
 }
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:8,代码来源:COLLADAMayaReferenceManager.cpp

示例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;
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:36,代码来源:vsSkinnerCmd.cpp

示例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;
}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:25,代码来源:exampleCameraSetViewCmd.cpp

示例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);
    }
开发者ID:cuigrey,项目名称:OpenCOLLADA,代码行数:9,代码来源:COLLADAMayaDocumentExporter.cpp

示例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);
}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:8,代码来源:CacheWriter.cpp

示例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 );
}
开发者ID:virtualritz,项目名称:liquidmaya,代码行数:8,代码来源:liqWriteArchive.cpp


注:本文中的MDagPath::fullPathName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。