Page 1 of 1

MEL question: how to get name of material's color channel

Posted: Mon Oct 08, 2007 11:50 am
by deadalvs
hello world !

again a maya/MEL-question

if i have a material called myMaterial which has a texture applied to it, plugged in the color channel, for example checker1 or file33.

how do i get the node name of the texture channel as a string when only the material's name is known?

* * *

thanks !

Posted: Mon Oct 08, 2007 12:15 pm
by deadalvs
HA !
i guess i found it myself now ...

example for a material called lambert1 :

defaultNavigation -defaultTraversal -destination "lambert1.color";
// result: checker1

Posted: Mon Oct 08, 2007 3:06 pm
by Mihnea Balta
If you want to get just the node name:
Code: Select all
listConnections -source true lambert1.color;
// Result: checker1 // 
If you want the plug that's connected to the color attribute:
Code: Select all
connectionInfo -sourceFromDestination lambert1.color;
// Result: checker1.outColor // 

Posted: Mon Oct 08, 2007 3:22 pm
by deadalvs
aah, thanks for that !

Mihnea, You're the man !

Posted: Mon Oct 08, 2007 3:45 pm
by deadalvs
hey Mihnea...

what kind of education did You make ? especially in MEL ?

learning by doing or with professional schools ?