query shader name

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 08 August 2012   #1
query shader name

How to get shader name as return value. I want to switch texture on shaders . For that purpose I require the name of applied shader (ie. lambard1 ) as return so that I can use that name to switch texture.
 
Old 08 August 2012   #2
Depends if it's selected, or you just want to iterate all shaders, or you want to iterate the shaders that are connected to some object.
 
Old 08 August 2012   #3
I just want to select one object and change it's texture with a button click.

Last edited by sanlight : 08 August 2012 at 05:16 PM.
 
Old 08 August 2012   #4
 
Old 08 August 2012   #5
listConnections() on an object with give you the connections to the shading groups as well. Using the sets() command you can change these connections.
 
Old 08 August 2012   #6
Code:
import maya.cmds as mc shaders = [mc.listConnections(x + '.surfaceShader')[0] for x in mc.listConnections(mc.ls(sl=True, dag=True, s=True), type='shadingEngine')]
 
Old 08 August 2012   #7
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:08 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.