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
Forum topic · Scripts Wanted
By ariff_13 · 2013-07-16
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
Just tried with Standard and no Worky
asymptote · 2017-12-27
Hey Barigazy...I'm baaaa-aaack. :)
Can't get this to work with standard mats. Listener reports OK not nothing happens in the scene.
mapped fn clearOpacityMax mats:(getclassinstances Standardmaterial) = if mats.count != 0 do
(
if opacityMap != undefined do
setProperty mats "opacityMap" undefined
)
clearOpacityMaps()
Basically I'm trying to reverse what this script did:
http://www.scriptspot.com/forums/3ds-max/scripts-wanted/diffuse-alpha-ch…
I ideally I would like it to work on scene or selected....is this possible ?
Max 2016 btw.
barigazy · 2018-01-11
Hey buddy. How are you :)
Here we go
fn clearOpacityMap selected: remove: =
(
local mats = #()
if not selected then mats = getclassinstances standard else
(
if selecton.count == 0 then #() else
for o in selection where o.mat != undefined and iskindOf o.mat Standard do join mats (getclassinstances standard target:o.mat)
)
if mats.count > 0 do
(
for m in mats where m.opacityMap != undefined do
(
if remove then m.opacityMap = undefined else m.opacityMapEnable = off
)
)
)
Now you have two solutions ei. options:
selected:on -- works on selected object materials
selected:off -- works on all materials
remove:on -- removes all opacity maps from slot
remove:off -- disable all opacity maps
clearOpacityMap selected:off remove:off -- disable all opacity maps
barigazy · 2013-07-16
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()