PDA

View Full Version : How do I convert shaders to surface?


Steve McRae
04-07-2005, 10:48 PM
I have searched highend and the forums - perhaps I am not searching for the proper terms.

I would like a script or a way to convert all of my shaders to individual surface shaders. Is there a way to easily accomplish this?

azshall
04-07-2005, 11:06 PM
I have searched highend and the forums - perhaps I am not searching for the proper terms.

I would like a script or a way to convert all of my shaders to individual surface shaders. Is there a way to easily accomplish this?

If you're meaning converting the shaders into file textures or baking the shaders to file textures, which is what I am assuming you're meaning, then you wuold do this.

load hypershade, select object(s) with shaders applied.

graph the materials on the object(s) in the hypershade.

select your first surface and the corresponding shader that applies to it.

once both are selected, go to the hypershade and go to EDIT -> CONVERT TO FILE TEXTURE

choose which options that apply and hit go ... mind you, the larger the file size, the longer the bake, as well.. the more intricate the network.. the longer the bake..

is this what you were lookin for?

az

Steve McRae
04-07-2005, 11:50 PM
thanks seth - no, I'm looking for a way to convert a large group of shaders to a different 'type' for compositing purposes.

Say if you had 100 shaders that were all blinns and you wanted to make them all 'lamberts' or 'surface shaders' and still keep 100 shaders.

Bonedaddy
04-08-2005, 12:32 AM
Can't you just render out the scene with an ambient light for that effect?

Steve McRae
04-08-2005, 01:24 AM
hi bonedaddy,

the surface shaders are for object mattes; having the ability to isolate particular objects quickly is what I am looking to do. The ability to convert to a lambert or any other material type would just be a nice bonus.

oodle
04-08-2005, 08:51 AM
why not apply shader to object u want and save it as different file?

Steve McRae
04-08-2005, 09:02 AM
hi oodle,

the problem is not in the ability to change the shader type, it is in changing about 100 of them all at once - it takes to long to do - there must be a better way than this . . .

jeremybirn
04-08-2005, 01:53 PM
there must be a better way than this . . .

One thing that's sometimes handy is to use a tripleswitch node, so that 100s of objects, each with their own texture mapping, can all use the same blinn shader. Then you could add a surface shader and assign that instead, but connected to the same tripleswitch, and that would all be done at once.

Another thing that's handy for renderpass set-up is to change the lighting instead of the shaders. For example, suppose you hid all of your lights, but made one big volume light emitting ambient, but no diffuse or specular, scaled up to include the whole scene. Suddenly, all your blinn shaders would render like surface shaders.

-jeremy

thematt
04-08-2005, 02:15 PM
do you want to keep the texture that is plug in the color slot of your original materail or the entire shader...because it's completly different.
You could use mel for that easily just need to know what exactly you're looking for.

cheers

Steve McRae
04-11-2005, 07:56 PM
jeremy - thanks, I'll take a look at that

thematt - it would be nice to simply change the 'type' of the shader and if that particular shader had the appropriate places for those maps, then it would keep them.

For instance, if I use the attribute editor to change the 'type' from a blinn to a lambert, the spec map dissapears but it keeps the color, bump etc. If I change from a blinn to a surface shader, everthing goes.

It would be nice to have a script that would change all selected shaders to a specified 'type'. I searched the forums and highend and could not comeup with anything similar to this unfortunately.

This would be handy also when importing models from another piece of software (modo specifically) where all materials come in as phongs.

thematt
04-11-2005, 08:50 PM
Ok now I see better where you come from..tomorow I'll try to write you quick mel to do that .
shouldn't be to complicated

cheers

Steve McRae
04-12-2005, 08:41 PM
thank you - that would be cool

CGTalk Moderation
04-12-2005, 08:41 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.