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
  08 August 2012
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.
 
  08 August 2012
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.
 
  08 August 2012
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.
 
  08 August 2012
listConnections() on an object with give you the connections to the shading groups as well. Using the sets() command you can change these connections.
 
  08 August 2012
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')]
 
  08 August 2012
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
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 01:31 PM.


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