maya.cmds doesnt return anything... Im not sure about using pymel though
On Thursday, 19 December 2013 02:34:33 UTC+8, Eric Thivierge wrote:
>
> Hey all,
>
> Been lurking here for a long time but just now picking up some Maya
> programming for some rigging tools here at work. I've been a long time
> Softimage user and am used to the OM they have there so it's a bit of an
> uphill battle trying to make heads or tails of some of the stuff in
> OpenMaya.
>
> Is this the simplest way to get to the shape node after it's created from
> the transform node?
>
> # Sample Python
> import maya.OpenMaya as om
>
> dagModifier = om.MDagModifier()
>
> locator = dagModifier.createNode('transform')
> dagModifier.renameNode(locator, "myLocator")
> dagModifier.createNode('locator', locator) # create locator shape under
> transform
> dagModifier.doIt()
>
> locatorDagPath = om.MDagPath()
> locatorDag = om.MFnDagNode(locator)
> locatorDag.getPath(locatorDagPath)
> locatorDagPath.extendToShape()
>
> shapeDag = om.MFnDagNode()
> shapeDag.setObject(locatorDagPath.node())
> shapeNode = om.MObject()
> shapeNode = locatorDagPath.node()
>
> dagModifier.renameNode(shapeNode, "myLocatorShape")
> dagModifier.doIt()
>
> --------------------------------------------
> Eric Thivierge
> http://www.ethivierge.com
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/e1f03eb5-e0fa-459f-9b9a-40ef6181b644%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.