Hey guys,

I'm getting some errors trying to go back and forth between MObject and
MDagPath objects - I feel like there's something I'm not understanding about
the way the Python API works.

I've pulled this out of context, but here's the idea:

import maya.cmds as MC
import maya.OpenMaya as OM
MC.sphere(name='mySphere')

sl = OM.MSelectionList()
sl.add('mySphere')
dagPath = OM.MDagPath()
sl.getDagPath(0, dagPath)


sl = OM.MSelectionList()
node = dagPath.node()
node.hasFn(OM.MFn.kDagNode)
print "Is the node null? %s" % node.isNull()
print "The type is %s" % node.apiTypeStr()
sl.add(node)
newDagPath = OM.MDagPath()
sl.getDagPath(0, newDagPath)

>From this I get:
# Error: (kFailure): NULL object returned

I'm confused :(  Any ideas?  Thanks!!

-- 
John Patrick
404-242-2675
[email protected]
http://www.canyourigit.com

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to