Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Maya Basics & Newbie Lounge (https://simplymaya.com/forum/forumdisplay.php?f=31)
-   -   selecting faces that are assigned by a shaader through mel (https://simplymaya.com/forum/showthread.php?t=34655)

junkyBob 23-11-2010 04:55 PM

selecting faces that are assigned by a shaader through mel
 
Hi
It has been awile since Iast visited, but I have question. I know it is possible to select the faces of an object that are assigned to a shader group in the hypershade window, but how do you do it in MEL? I tried looking at the script window, but it writes this....

select -cl; select -r polySurface.f[5:9]

which does not help me, because in my script it does not know which faces should be selected. My script is based on knowing the name of the assigned shader. Also, I tried googling it and found one person, on a different forum, and he mentioned to use hyperShade -smn (name of shader). I tried doing that and nothing happens.

Does anybody else have an idea how this is done?

bullet1968 24-11-2010 02:40 AM

I know NOTHING about MEL mate but I tried this...made a simple cube and assigned different colours to the faces...and experimented whilst watching the script window and came up with this...and it worked....dunno why you want to use the script editor though mate??


select -r pCube1 lambert4SG;

so I assume pCube1 is the model and then I just typed in lambert4SG and it highlighted those relavent colours...hope this helps

cheers bullet

AlexSudnikov 27-10-2014 12:03 PM

Hey thanks for the tip guys ,

Just ran into the same problem , i guess hypershade -objects(-o) will do the trick !


All times are GMT. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018