Setting A Lambert Material To New Polygon Primitive

Hi, I'm a little stuck on a program that im currently making. I'm fairly new to using MEL and want to create an custom object using a Polygon Primitive Sphere. I have managed to code the object so that it has the shape that I want but I am having trouble with setting the colour to the object. I'd really appreciate it if someone could give me a solution. All I want is a Lambert Material with RGB: 0.5 0.431883 0.232

Thanks

you know about the usual "basic guide to MEL scripting"?:

open Script Editor, Press "Edit" > Clear History, Press "Script" > Echo All Commands, execute your operation you want to melify, read the output and take the first operation that looks useful.:

This should lead you to:

CODE
shadingNode -asShader lambert;
for creating the shader. and:

CODE
setAttr "lambert2.color" -type double3 0.64102 0.64102 0.64102;
for changing the color at the shader.

I recognize you even don't need to echo all commands for this. But you need to set it if you want to obtain:
CODE
hyperShade -assign lambert2;
wich assigns the shader to the current selection.

QUOTE(ewerybody @ 04/26/06, 12:00 PM) [snapback]235471[/snapback]
CODE
hyperShade -assign lambert2;

or you can use the slightly more generic:

sets -e -forceElement shadingGroupName object1 object2....

the info icidentaly reads a few posts down allready, its been asked 3 times this week.

Excellent, that seems to have sorted it, thanks for your help

we should set up a FUQ (Frequently Uttered Questions) or just point to brian ewerts website. Where this also is handled in detail.

There is a faq on highend, just click maya -> FAQ's and your there (or this link). Feel free to add it there.

so these 5 are all until now?!?

humm... this definetely belongs there ... but I got no time now :[
But don't you think its going to be boring here if the mel-newbies already know everything? ;]
But ok seems that even you get bored telling the same shit over and over again.

NO that just the last editted ones. look at your left hand many more its subdivided into categories.