import maya.OpenMaya as api sel = api.MSelectionList() sel.add( 'pPlaneShape1' ) obj = api.MDagPath() sel.getDagPath(0, obj )
dgNode = api.MFnDagNode(obj)
aliasList = api.MPlug()aliasList = dgNode.findPlug( "worldMesh" )
worldP = api.MPlug()worldP = aliasList[0]
# The plug is found!print worldP.name()
# Ok lets convert it to a dagpath!ob = api.MObject()ob = worldP.asMObject()
mfDgN = api.MFnDagNode(worldP.node())
pa = api.MDagPath()
mfDgN.getPath(pa)print pa.fullPathName()
# Nope!
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/85465a8e-2517-4fff-b891-24438d8c9522%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
Does this work for you?
# Via the API
import maya.OpenMaya as api
sel = api.MSelectionList()
sel.add( 'pPlaneShape1' )
obj = api.MDagPath()
sel.getDagPath(0
, obj ) dgNode = api.MFnDagNode(obj) aliasList = dgNode.findPlug( "worldMesh" ) worldP = aliasList[0] print worldP.name() mfDgN = api.MFnDagNode(worldP.node()) print mfDgN.fullPathName() destPlugs = api.MPlugArray() worldP.connectedTo(destPlugs, False, True) destPlug = destPlugs[0] mfDgN.setObject(destPlug.node()) print mfDgN.fullPathName()
# Via cmds import maya.cmds as cmds cmds.ls(cmds.listConnections("pPlaneShape1.worldMesh[0]", sh=True), l=True)
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/85465a8e-2517-4fff-b891-24438d8c9522%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9a734e78-fadd-42fa-888c-b52be36929c4%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/85465a8e-2517-4fff-b891-24438d8c9522%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 python_inside_maya+unsub...@googlegroups.com.
Welcome!
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/85465a8e-2517-4fff-b891-24438d8c9522%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9a734e78-fadd-42fa-888c-b52be36929c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/40969e04-455c-4bf4-a2c7-82c1e6862c31%40googlegroups.com.