View Full Version : Global values of diffuse and self illumination
02-05-2006, 09:30 AM
I need to change all diffuse and self illumination values to white on all my materials. At the same time all the opacity maps on all materials has to remain the same.
Can anyone lead me to the script to do it?
02-05-2006, 09:34 AM
i hope this will do the trick:
-- loop through scene materials (sceneMaterials is a global variable
-- that contains all applied materials in the scene)
for m in sceneMaterials do
-- some materials (multi/sub-object mats for example)
-- don't have the properties we're trying to set,
-- a simple way to avoid the error this would cause
-- is using the try()catch() expression
--set the properties
m.diffuseColor = color 255 255 255
m.useSelfIllumColor = false
m.selfIllumAmount = 100
02-05-2006, 09:45 AM
Thanx so much Aearon!
It works but has only one problem. Can you add to the script the function to disable diffuse map also. Right now it turns diffuse color to white but leaves the texture to the diffuse slot. Is it possible to disable map (to NONE) in diffuse slot?
02-05-2006, 12:07 PM
sure, just add "m.diffuseMapEnable = false" to the script
by the way you can check this kind of stuff like this:
meditmatrials is a global var containing all material editor mats
to get the material in the first slot do this:
myMat = meditMaterials
now to get all the properties for this material (like the diffuseMapEnable above) type this:
02-05-2006, 03:02 PM
The script works just great!! The reason I needed this is because to make fake zdepth channel for dof. Max zdepth channel doesn't count with opacity maps.
Is it possible to make this script as a render element? :) Also it should include environment|fog (exponential, min 0%, max 100%).
Here is an example also:
02-05-2006, 05:22 PM
sorry Heiki, haven't played much with render-related scripting, but what you could do is setup the fog effect using a script as well, and also turn off a bunch of options you don't need for this pass, for example lights and shadows among others
this can definitely be fully automated
02-05-2006, 05:22 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.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.