PDA

View Full Version : [C++] Get MDagPath or MObject from dag path as tring


lechoo
11-28-2012, 08:55 AM
Hi,
I'd like to get object or it's dagpath object having only dag path as string, for example "|pCube|pCubeShape". Is it possible without going through whole tree? I'm looking for single function like GetDagPath(MString).

regards

Mark-J
11-28-2012, 11:46 AM
node='|pCube|pCubeShape'

import maya.OpenMaya as api
MObj=api.MObject()
selList=api.MSelectionList()
selList.add(node)
selList.getDependNode(0,MObj)

That'll get you the MObject if that's what you're after?

lechoo
11-28-2012, 02:54 PM
Thanks Mark! Thats exactly what I need.

CGTalk Moderation
11-28-2012, 02:54 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.