Unable to graph out connections in Hypershade

367 views
Skip to first unread message

likage

unread,
Jul 18, 2014, 6:58:42 AM7/18/14
to python_in...@googlegroups.com
I am trying to graph out the selected object shader and it will displays its input and output connections.
While it works, the display of input and output connections is not working, unless I have to open up my script editor and re-run the command again.

I am testing it with a simple scene, where I create a polyCube and attach it with a blinn. So basically the idea is that it will pops up the hypershade and graph out the connections in the work area of hypershade

Any ideas?


import maya.cmds as cmds
import maya.mel as mm

cmds
.select("pCube1")
   

shapeSel
= cmds.ls(dag=1,o=1,s=1,sl=1)
shadingGrp
= cmds.listConnections(shapeSel,type='shadingEngine')
shader
= cmds.ls(cmds.listConnections(shadingGrp),materials=1)

cmds
.HypershadeWindow()
cmds
.select(shader)

# This command needs to be manually run
mm
.eval('hyperShadePanelGraphCommand("hyperShadePanel1","showUpAndDownstream");')


Additionally, can I also ask if it is possible to 'tear out' the window of the work area or the material tab?

Marcus Ottosson

unread,
Jul 18, 2014, 7:21:14 AM7/18/14
to python_in...@googlegroups.com
I suspect you're looking at the graph of the transform, as opposed to the shape node. Try "pCubeShape1" instead and see if that works better.

As for tearing out, you can hide the top and left part of the hypershade to make it into a workarea-only. Alternatively you've got the Node Editor which is essentially just that.


--
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/dd36abfa-c165-4e57-a1cc-46ff7466d692%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

likage

unread,
Jul 21, 2014, 11:39:58 PM7/21/14
to python_in...@googlegroups.com
Hi Marcus,

Thanks for getting back to me.
I'm afraid you may have got me wrong. I am trying to map out the shader node in Hypershade work-area, depending on the user's object selection.

As such, in my code, I am grabbing the shader that was assigned from the shapeNode of the selection. As the code executes and opens up the hypershade window, with the shader highlighted / selected, it is unable to execute the next line of code - mm.eval('hyperShadePanelGraphCommand("hyperShadePanel1","showUpAndDownstream");')

I did tried what you mentioned, still it is not showing me any results.


As for the latter part of the question, I am creating a custom window UI, and hence I would like to know if it is possible for me to 'tear-it-off' without executing the actual main hypershade UI.
I apologize that I did not make it clear


On Friday, July 18, 2014 7:21:14 PM UTC+8, Marcus Ottosson wrote:
I suspect you're looking at the graph of the transform, as opposed to the shape node. Try "pCubeShape1" instead and see if that works better.

As for tearing out, you can hide the top and left part of the hypershade to make it into a workarea-only. Alternatively you've got the Node Editor which is essentially just that.
On 18 July 2014 11:58, likage <dissid...@gmail.com> wrote:
I am trying to graph out the selected object shader and it will displays its input and output connections.
While it works, the display of input and output connections is not working, unless I have to open up my script editor and re-run the command again.

I am testing it with a simple scene, where I create a polyCube and attach it with a blinn. So basically the idea is that it will pops up the hypershade and graph out the connections in the work area of hypershade

Any ideas?


import maya.cmds as cmds
import maya.mel as mm

cmds
.select("pCube1")
   

shapeSel
= cmds.ls(dag=1,o=1,s=1,sl=1)
shadingGrp
= cmds.listConnections(shapeSel,type='shadingEngine')
shader
= cmds.ls(cmds.listConnections(shadingGrp),materials=1)

cmds
.HypershadeWindow()
cmds
.select(shader)

# This command needs to be manually run
mm
.eval('hyperShadePanelGraphCommand("hyperShadePanel1","showUpAndDownstream");')


Additionally, can I also ask if it is possible to 'tear out' the window of the work area or the material tab?

--
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.



--
Marcus Ottosson
konstr...@gmail.com

Reply all
Reply to author
Forward
0 new messages