Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 16-12-2006, 05:59 AM   #1
caligraphics
Registered User
 
caligraphics's Avatar
 
Join Date: Mar 2003
Location: Billund, Denmark
Posts: 992
Thanks: 0
Thanked 0 Times in 0 Posts
Default Anyone who can do this little MEL ?

I am in the need of changing a bunch of shaders and turn the Ambient color = 0,0,0 and the translucency = 0

can anyone do that for me ?
__________________
Carsten Lind
Senior 3D Artist,
Maya Software Manager & Maya Instructor
LEGO Systems A/S
caligraphics is offline   Reply With Quote
Old 16-12-2006, 06:29 AM   #2
enhzflep
Subscriber
 
enhzflep's Avatar
 
Join Date: Oct 2006
Location: Melbourne
Posts: 313
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can't work out a way to quickly do it with MEL, but the first question that springs to mind is how are you going to select the materials that you want to change?

If they al had a similar name i.e blinn1, blinn2, blinn3 etc then a MEL would be great; just type in the string to search for and then apply the modifications to all shaders whose names contain that string..

If however, you were going to pick them all in the hypershade then you could just open up the channel box and change all materials in 6 very short steps. I'm not able to think of a situation that would warrant all the extra coding just to save a few simple steps, here's my way:

(1) Select Materials in hypershade
(2) Open channel box
(3) Drag-select the 3 Ambient fields to the right of the name
(4) Enter 0
(5) Select Translucence
(6) Enter 0

Then you're done.. one material or 2 hundred, the only difference is the time taken to select them in the Hypershade, steps 2 to six are identical for 1 or 200 shaders.


hope it's helpfull
Simon
enhzflep is offline   Reply With Quote
Old 16-12-2006, 06:34 AM   #3
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Select your shaders in the hypershade and run this:
Code:
{
	string $sSel[] = `ls -sl`;
	string $sItem;
	
	for($sItem in $sSel)
	{
		if(objExists($sItem + ".ambientColorR"))
		{
			setAttr($sItem + ".ambientColorR") 0;
			setAttr($sItem + ".ambientColorG") 0;
			setAttr($sItem + ".ambientColorB") 0;
		}
		if(objExists($sItem + ".translucence"))
		{
			setAttr($sItem + ".translucence") 0;
		}
	}
}
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 16-12-2006, 07:14 AM   #4
caligraphics
Registered User
 
caligraphics's Avatar
 
Join Date: Mar 2003
Location: Billund, Denmark
Posts: 992
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a ton !!! I wish I could do MEL, would make lots of stuff easier!!
__________________
Carsten Lind
Senior 3D Artist,
Maya Software Manager & Maya Instructor
LEGO Systems A/S
caligraphics is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
MEL headache! happymat27 Members Lounge 5 05-12-2010 09:43 AM
MEL headache!! happymat27 Mel Scripts & Programming 1 03-12-2010 04:41 PM

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.