Script To Delete/Off All Opacity Channel

I have a scene whee some of the materials have opacity map. The problem is the scene is too big for me to do it manually one by one.

Is there a script that can automate this?

Thanks in advance for any kind help

Comments

Comment viewing options

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

...

I used here VRay material as example
For standard (default) material use [Standardmaterial] class and ["opacityMap"] property
#1 mapped fn solution

mapped fn clearOpacityMax mats:(getclassinstances VRayMtl) = if mats.count != 0 do
(
	if mats.texmap_opacity != undefined do
		setProperty mats "texmap_opacity" undefined
)
clearOpacityMaps()

#2 simple fn solution

fn clearOpacityMaps =
(
	if (gci = getClassInstances VRayMtl).count != 0 do
	(
		for m in gci where m.texmap_opacity != undefined do
			setProperty m "texmap_opacity" undefined
	)
)
clearOpacityMaps()

barigazy

Comment viewing options

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