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 26-06-2003, 10:37 PM   #1
train_ucl
user title spammer
 
train_ucl's Avatar
 
Join Date: Jun 2003
Location: Germany
Posts: 195
Thanks: 0
Thanked 0 Times in 0 Posts
Default color attribute

Hello

as a total newb i got a newb question:

how do i have to write a color ?
i want to assign a color to my lambert material with a mel-script:

lamMAT_matrix.color = ;

i dont know how the mel script wants the color ...
thanks for help


-train~
train_ucl is offline   Reply With Quote
Old 26-06-2003, 11:19 PM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

It's a vector variable so you write it:
lamMAT_matrix.color = << r, g, b >>;

where r = red, g = green and blue ranging from 0 to 1.
Black would be << 0, 0, 0 >>, white would be << 1, 1, 1 >> and mid green would be << 0, 0.5, 0 >>. Get it?
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 27-06-2003, 09:47 AM   #3
train_ucl
user title spammer
 
train_ucl's Avatar
 
Join Date: Jun 2003
Location: Germany
Posts: 195
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HEllo! First, thanks for your help ...
i did it befor that way as well, because i found this expression for a vector in the maya help, but it tried it and maya gave me this answer (to the exact same line you wrote) :
"Error: Attributes must be of float, integer, or boolean types: color" ...
and thats what i don´t get ...the rest i am familiar with from photoshop.
do you have any idea why maya doesn´t accept that line ?

-train~
train_ucl is offline   Reply With Quote
Old 27-06-2003, 10:01 AM   #4
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Uh... I talked BS before :p
It's not a vector variable. It's a float3. You also (may) need to use the setAttr command:

setAttr lambert1.color 1 1 1;

Sorry, my bad...
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 27-06-2003, 06:31 PM   #5
mark_wilkins
Registered User
 
mark_wilkins's Avatar
 
Join Date: Jan 2003
Posts: 161
Thanks: 0
Thanked 1 Time in 1 Post
Default

In an expression, you set the R, G, and B like this:

lambert1.colorR = 0;
lambert1.colorG = 1;
lambert1.colorB = 0;

You can connect another float3 attribute to lambert1.color, which is a compound attribute that includes colorR, colorG, and colorB.

Look in the Node and Attribute Reference to see this stuff -- these attributes are listed on the page for the Lambert node.

-- Mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
www.melscripting.com
mark_wilkins is offline   Reply With Quote

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.