ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
fn clearOpacityMap selected: remove: =
(
local mats = #()if not selected then mats = getclassinstances standard else(if selecton.count == 0 then #()elsefor 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
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()
Comments
Just tried with Standard and no Worky
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.
...
Hey buddy. How are you :)
Here we go
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
bga
...
I used here VRay material as example
For standard (default) material use [Standardmaterial] class and ["opacityMap"] property
#1 mapped fn solution
#2 simple fn solution
bga