Simple question - hyperShade command

377 views
Skip to first unread message

Aren Voorhees

unread,
Feb 19, 2014, 8:46:25 AM2/19/14
to python_in...@googlegroups.com
Hey all, forgive me for yet another noob question - 

I've been trying to find a way to create a list of an entire shading network.  I thought the easiest way to do so would be using hyperShade() with the ldn flag, like this:

import maya.cmds as cmds

shadingNetwork = cmds.hyperShade('blinn1', ldn=True)

print(shadingNetwork)


But this keeps returning 'None' even when there are textures attached to the material.  I actually found a work around using listHistory(), but I was still curious why the ldn flag was not working as I had expected.


Thanks!

Aren

Ævar Guðmundsson

unread,
Feb 19, 2014, 2:26:55 PM2/19/14
to python_in...@googlegroups.com
I might be wrong but I don't think the ldn flag accepts a Boolean...

Do you get the same result if you pass it a string filter? ( ,ldn="*" )

Justin Israel

unread,
Feb 19, 2014, 3:27:21 PM2/19/14
to python_in...@googlegroups.com
Ya, they take the name of a node, and also the hyperShade command doesn't use an argument. Just keyword params:

If you want the textures connected to the shader, then maybe you actually want the upstream nodes?

cmds.hyperShade(lun="blinn1")



On Thu, Feb 20, 2014 at 8:26 AM, Ævar Guðmundsson <aevar.gu...@gmail.com> wrote:
I might be wrong but I don't think the ldn flag accepts a Boolean...

  Do you get the same result if you pass it a string filter? ( ,ldn="*" )

--
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/98a178cf-88c9-43a8-a3c7-48b8622d6e5b%40googlegroups.com.

Aren Voorhees

unread,
Feb 19, 2014, 9:02:08 PM2/19/14
to python_in...@googlegroups.com
You're right - that'll teach me to pay more attention to the flags.  And you're correct Justin, I should have used the lun flag to get the rest of the network. 

Thank you both!


On Wednesday, February 19, 2014 2:27:21 PM UTC-6, Justin Israel wrote:
Ya, they take the name of a node, and also the hyperShade command doesn't use an argument. Just keyword params:

If you want the textures connected to the shader, then maybe you actually want the upstream nodes?

cmds.hyperShade(lun="blinn1")

On Thu, Feb 20, 2014 at 8:26 AM, Ævar Guðmundsson <aevar.gu...@gmail.com> wrote:
I might be wrong but I don't think the ldn flag accepts a Boolean...

  Do you get the same result if you pass it a string filter? ( ,ldn="*" )

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

Aren Voorhees

unread,
Feb 19, 2014, 9:17:22 PM2/19/14
to python_in...@googlegroups.com
Actually, one other question if I can - I'm wondering if anyone knows a way to tell what material slot a particular node is plugged into?  For example, if I have a file plugged into the 'Color' slot of a material, can I get that info listed out somehow?   

Justin Israel

unread,
Feb 19, 2014, 9:37:09 PM2/19/14
to python_in...@googlegroups.com
You probably want to look at listConnections with the plugs flag.


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/fe0bf811-2330-4021-bba5-1b090fb83628%40googlegroups.com.

Aren Voorhees

unread,
Feb 28, 2014, 9:44:40 PM2/28/14
to python_in...@googlegroups.com
Had a look and I think that'll get me what I need.  Thanks again Justin.


On Wednesday, February 19, 2014 8:37:09 PM UTC-6, Justin Israel wrote:
You probably want to look at listConnections with the plugs flag.
On Thu, Feb 20, 2014 at 3:17 PM, Aren Voorhees <are...@gmail.com> wrote:
Actually, one other question if I can - I'm wondering if anyone knows a way to tell what material slot a particular node is plugged into?  For example, if I have a file plugged into the 'Color' slot of a material, can I get that info listed out somehow?   


On Wednesday, February 19, 2014 8:02:08 PM UTC-6, Aren Voorhees wrote:
You're right - that'll teach me to pay more attention to the flags.  And you're correct Justin, I should have used the lun flag to get the rest of the network. 

Thank you both!

On Wednesday, February 19, 2014 2:27:21 PM UTC-6, Justin Israel wrote:
Ya, they take the name of a node, and also the hyperShade command doesn't use an argument. Just keyword params:

If you want the textures connected to the shader, then maybe you actually want the upstream nodes?

cmds.hyperShade(lun="blinn1")

On Thu, Feb 20, 2014 at 8:26 AM, Ævar Guðmundsson <aevar.gu...@gmail.com> wrote:
I might be wrong but I don't think the ldn flag accepts a Boolean...

  Do you get the same result if you pass it a string filter? ( ,ldn="*" )

--
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+unsubscribe@googlegroups.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 python_inside_maya+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages