View Full Version : How to create a new shader with MEL?

11 November 2005, 04:34 AM
Ok, now someone has to know this...

I'm trying to create a new shader with MEL. I can do it, but it's just a hack using something output from "echo all commands", which doesn't seem like it's the correct command, plus it doesn't show up in the reference guide. What I've found so far, is this:

hyperShadePanelCreate "shader" lambert

...Which will create a new shader, however it won't return the name. I'm looking for something that will work like this:

string $newShader = `hyperShadePanelCreate "shader" lambert`;

...So that I can use the name of the shader that gets created later. Ideally, I'd imagine there has to be a command I can use to specify the material type, and give it a name of my own, any ideas on how to do this, or on how to have the command return the name of the newly created shader?


11 November 2005, 07:44 AM
string $myShader = `createNode lambert`;

setAttr ($myNode + ".color") 1 0 0;

11 November 2005, 02:49 PM

11 November 2005, 06:33 PM
Swwwwwwwwwwwwwwwwwwwww-eaaaatttttt! ...You guys rock!

CGTalk Moderation
11 November 2005, 06:33 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.