Notifications
Clear all

[Closed] Simplifying V-ray materials

Hi I have a big number of vray materials in my scene and I’m trying to strip them to the basics and keep only the diffuse texture. I managed to reset the reflection, refraction and remove the bump but I’m struggling with the diffuse as most materials have two color correction maps of a single bitmap plugged into a falloff map. So basically I’m trying to assign only the bitmap straight into the diffuse. Here is my sript so far:

for i in (getclassinstances vraymtl) do
(
		 
    i.reflection_glossiness = 1
    i.refraction_glossiness = 1
	i.texmap_reflection_on = false
	i.texmap_bump_on = false
	i.texmap_bump = null
	i.texmap_reflection = null
	i.reflection = black 
	
	
)

Any help will be greatly appreciated !

2 Replies

try this

mats = getclassinstances vraymtl
empty_mat = vraymtl()
attr_num =  getPropNames empty_mat
for i in #(#diffuse,#diffuse_roughness,#texmap_diffuse) do deleteItem attr_num (finditem attr_num i)
empty_attr = for i in attr_num collect getProperty empty_mat i
for m in mats do
	for i = 1 to attr_num.count do
		setProperty m attr_num[i] empty_attr[i]
for i = 1 to (getclassinstances falloff).count do
(
	falloff_mats =  for  m in refs.dependents (getclassinstances falloff)[1] where finditem mats m  > 0 collect  m
	if falloff_mats.count > 0 do for m in falloff_mats do m.texmap_diffuse =  m.texmap_diffuse.map1.map
)

You are the man! Works perfect! I knew I have to somehow iterate trough the maps but I would never figure it with my skills