# Access shader nodes with mel

**URL:** https://forum.highend3d.com/t/access-shader-nodes-with-mel/4217
**Category:** Maya
**Tags:** mel
**Created:** [August 12, 2004, 8:59pm UTC](https://forum.highend3d.com/t/access-shader-nodes-with-mel/4217 "2004-08-12T20:59:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nyquist](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/n/f1d935/32.png) [@nyquist](https://forum.highend3d.com/u/nyquist)
#### Post date: [August 12, 2004, 8:59pm UTC](https://forum.highend3d.com/t/access-shader-nodes-with-mel/4217/1 "2004-08-12T20:59:56Z")

</div>

suppose i have 50 shaders(blinn) assigned to 50 objects,now if i want to change the diffuse values for all the surfaceShaders with mel, i guess i need to access the surface shader Closest i got was with -listConnections -type "shadingEngine" pSphereShape1;  
but this returns the shading group.what i want it to return is the blinn node so i can access the diffuse attribute i need to change.Please help.  
PS: if i get this answer i guess i will also be able to duplicate a shader say 10 times thru mel and then assign it to various objects.am i right.  
Anxiously waiting!  
Thanks in advance!!!

---

<div class="post-metadata">

### Author: ![dbiggs](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@dbiggs](https://forum.highend3d.com/u/dbiggs)
#### Post date: [August 12, 2004, 10:04pm UTC](https://forum.highend3d.com/t/access-shader-nodes-with-mel/4217/2 "2004-08-12T22:04:55Z")

</div>

Check out [http://www.ewertb.com/maya/mel/](http://www.ewertb.com/maya/mel/)  
Brian has some great Mel help there for this kind of thing.

Also you said you want to change all shader diffuse values, will this do what you want?  
for($blinn in `ls -type "blinn"`){  
 setAttr ($blinn+".diffuse") 0.666;  
}

---

<div class="post-metadata">

### Author: ![nyquist](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/n/f1d935/32.png) [@nyquist](https://forum.highend3d.com/u/nyquist)
#### Post date: [August 12, 2004, 11:40pm UTC](https://forum.highend3d.com/t/access-shader-nodes-with-mel/4217/3 "2004-08-12T23:40:39Z")

</div>

Thanks a million friend.I am going thru brian's pages just now.i'll try to find my answer there.If i still have a problem i'll be posting here again.  
PS :i feel like a fool ,while you guys are so cool !!(haha)  
thanks once again.
