Material Property adjustment to Entire Scene

Hello - I want to be able to change values such as below to the entire scene. I use VRay materials. It would be nice if it can do it for every types of materials.

1- texmap diffuse filtering to the entire scene. There are three options.

Pyramidal .texmap_diffuse.filtering = 0
Summed Area .texmap_diffuse.filtering = 1
None .texmap_diffuse.filtering = 2

2- Change blur of ONLY diffuse maps to value I set.

.texmap_diffuse.coords.blur = (value i set)

3- Change Gamma on the map to value i define.

tmap.bitmap.inputGamma

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

...

You can use similar method that I described in previous thread.

bga

xathletic01x's picture

link

No problem do you have link to the previous thread? Thanks

barigazy's picture
xathletic01x's picture

Here is where I am at

I was able to create it until this point but now i am stuck :).

1- I want to be able to change spinner value for blur and RGBlevel have decimal point. "example .001"

2- Filtering to be able to look at what i have selected in process on. scene material or selected objects. Filtering also doesn't work on multimaterials.

Hope you can help. Thanks

try(destroyDialog ::dtrRoll)catch()
rollout Dproperty "Diffuse Property" width:162 height:300
(
	local VAR
	label lbl "Process on:" pos:[10,10] width:56 height:13
	label lbl8 "Filtering:" pos:[10,126] width:56 height:13
	radiobuttons rb "" pos:[8,25] width:104 height:32 labels:#("Scene Material", "Selected Objects") columns:1
	radiobuttons filt "" pos:[10,140] width:89 height:48 labels:#("Pyramidal", "Summed Area", "None") columns:1
	spinner spn "Tex Blur Value" pos:[10,75] width:111 height:16 range:[-1,10,0.01] type:#integer fieldwidth:30
	spinner spnrgbl "RGB Level Value" pos:[19,229] width:111 height:16 range:[0,1,0.7] type:#integer fieldwidth:30
	button btnblur "Blur Value" pos:[10,95] width:124 height:18
	button btnfilt "filtering" pos:[8,192] width:124 height:21
	button btnrgbl "RGB Level Value" pos:[10,251] width:124 height:18
 
 
 
fn ProcessBlur m =
	(
		if isKindOf m VRayMtl then if m.texmap_diffuse != null do m.texmap_diffuse.coords.blur = spn.value
			else if isKindOf m Multimaterial then m.material1.texmap_diffuse.coords.blur = spn.value 
	)
 
 
fn ProcessRGBlevel m =
	(
		if isKindOf m VRayMtl then if m.texmap_diffuse != null do m.texmap_diffuse.output.rgb_level = spnrgbl.value
			else if isKindOf m Multimaterial then m.material1.texmap_diffuse.output.rgb_level = spnrgbl.value
	)
 
 
 
 
on btnblur pressed do
	(
		with undo off with redraw off
		(
			case rb.state of 
			(
				1: for m in scenematerials do ProcessBlur m
				2: for o = 1 to selection.count where selection[o].material != null do ProcessBlur selection[o].material
 
			)
		)
	)
 
on btnrgbl pressed do
	(
		with undo off with redraw off
		(
			case rb.state of 
			(
				1: for m in scenematerials do ProcessRGBlevel m
				2: for o = 1 to selection.count where selection[o].material != null do ProcessRGBlevel selection[o].material
 
			)
		)
	)
 
	on btnfilt pressed do
	(
		with undo off with redraw off
		(
			case filt.state of 
			(
				1: for m in scenematerials do m.texmap_diffuse.filtering = 0
				2: for m in scenematerials do m.texmap_diffuse.filtering = 1
				3: for m in scenematerials do m.texmap_diffuse.filtering = 2
 
			)
		)
	)
 
 
)
createDialog dproperty 140 300 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
barigazy's picture

...

#1. Type of your spinners for "Blur" and "RGBVal" need to be "float" (not "integer")
type:#float

#2. In previous thread I give U an answer for Multimaterial problem

bga

barigazy's picture

...

Let say U have two spinners (if U not assigne "type" argument spinner will be float type)

spinner spn_blur "Blur" range:[-1e3,1e3,1]
spinner spn_rgbLevel "RgbLevel" range:[-1e3,1e3,1]

Then U can use recursive function (I also added suport for other material types)

fn process m type: blurVal: rgbVal: = 
(
	if isKindOf m VRayMtl and m.texmap_diffuse != undefined then
	(
		case type of
		(
			#blur: m.texmap_diffuse.coords.blur = blurVal
			#RGBLevel: m.texmap_diffuse.coords.blur = rgbVal
		)
	)
	else if (isKindOf m Multimaterial or isKindOf m CompositeMaterial) then (for sm in m.materialList where isKindOf sm material do process m)
	else if isKindOf m VRay2SidedMtl then (process m.frontmtl ; process m.backmtl)
	else if isKindOf m VRayBlendMtl then (process m.baseMtl ; for i = 1 to 9 do process m.coatMtl[i])
	else if isKindOf m VrayOverrideMtl then (for i in 1 to getNumSubMtls m do process (getSubMtl m i))
	else if isKindOf m VrayMtlWrapper then (process m.baseMtl)
	else if isKindOf m Blend then (process m.MAP1 ; process m.MAP2)
)

Type argument can be #blur or #RGBLevel

process obj.mat type:#blur blurVal:spn_blur.value rgbVal:spn_rgbLevel
--or
process obj.mat type:#RGBLevel blurVal:spn_blur.value rgbVal:spn_rgbLevel

bga

xathletic01x's picture

Thank you

float type worked! fn I am struggling with but i think i'll have to keep working on it. I'll look into it more in detail. Thank you for sharing knowledge!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.