try (destroyDialog CHANGE_MAP_PROPERTIES) catch (0) rollout CHANGE_MAP_PROPERTIES "CHANGE MAP PROPERTIES" ( group "BITMAP PROPERTIES" ( button ui_changeMaterialProp "CHANGE PROPERTIES" width:120 height:50 ) group "MATE COLOR " ( colorPicker ColPick_Fr "ColorPicker" width:100 height:25 color:(color 18 255 0) align:#center button ui_assignColor "ASSIGN COLOR" width:120 height:50 button ui_changeToMatte "CHANGE TO mi_MATTE" width:120 height:50 ) progressBar pb_pcache "Cache Progress" on ui_changeMaterialProp pressed do with undo on ( ( cantidad = selection as array valor= 0 for i in (Selection as Array) where ((superClassOf i) == GeometryClass) do ( local theMaterial = i.material if ((classOf theMaterial) == Standard and theMaterial.opacityMap != undefined and theMaterial.diffuseMap != undefined) then ( theMaterial.selfIllumAmount = 100 showTextureMap theMaterial true theMaterial.diffuseMap.alphaSource = 2 theMaterial.diffuseMap.coords.blur = 0.01 theMaterial.opacityMap.preMultAlpha = false valor= valor+1 pb_pcache.value= 100 *valor/cantidad.count ) else if ((classOf theMaterial) == MultiMaterial) then ( for theSubMat in theMaterial.materialList where theSubMat != undefined and ((classOf theSubMat ) == Standard and theSubMat.opacityMap != undefined and theSubMat.diffuseMap != undefined) do ( theSubMat.selfIllumAmount = 100 showTextureMap theSubMat true theSubMat.diffuseMap.alphaSource = 2 theSubMat.diffuseMap.coords.blur = 0.01 theSubMat.opacityMap.preMultAlpha = false valor= valor+1 pb_pcache.value= 100 *valor/cantidad.count ) ) ) ) ) on ui_assignColor pressed do with undo on ( ( cantidad = selection as array valor=0 for i in (Selection as Array) where ((superClassOf i) == GeometryClass) do ( local theMaterial_2 = i.material if ((classOf theMaterial_2) == Standard /*or theMaterial_2.opacityMap != undefined or theMaterial_2.diffuseMap != undefined*/) then ( theMaterial_2.selfIllumAmount = 100 theMaterial_2.diffuseMapEnable = off theMaterial_2.Diffuse = ColPick_Fr.color theMaterial_2.ambient = ColPick_Fr.color valor= valor+1 pb_pcache.value= 100 *valor/cantidad.count ) else if ((classOf theMaterial_2) == MultiMaterial) then ( for theSubMat in theMaterial_2.materialList where theSubMat != undefined and ((classOf theSubMat) == Standard and theSubMat.opacityMap != undefined ) do ( theSubMat.selfIllumAmount = 100 theSubMat.diffuseMapEnable = off theSubMat.Diffuse = ColPick_Fr.color theSubMat.ambient = ColPick_Fr.color valor= valor+1 pb_pcache.value= 100 *valor/cantidad.count ) ) ) ) ) on ui_changeToMatte pressed do with undo on ( ( cantidad = selection as array valor=0 --for i in (Selection as Array) where ((superClassOf i) == GeometryClass) do for i = 1 to (Selection as Array).count where ((superClassOf selection[i]) == GeometryClass) do ( local theMaterial_3 = selection[i].material if ((classOf theMaterial_3) == Standard /*or theMaterial_2.opacityMap != undefined or theMaterial_2.diffuseMap != undefined*/) then ( opacidad = theMaterial_3.opacityMap materialNuevo = Matte_shadow_reflection__mi() materialNuevo.opacity_shader = opacidad selection[i].material = materialNuevo valor= valor+1 pb_pcache.value= 100 *valor/cantidad.count ) else if ((classOf theMaterial_3) == MultiMaterial) then ( for o= 1 to theMaterial_3.materialList.count where theMaterial_3.materialList[o] != undefined and ((classOf theMaterial_3.materialList[o]) == Standard and theMaterial_3.materialList[o].opacityMap != undefined ) do ( --print theMaterial_3.materialList[o] opacidad = theMaterial_3.materialList[o].opacityMap materialNuevo = Matte_shadow_reflection__mi() materialNuevo.opacity_shader = opacidad materialNuevo.catch_shadows = off materialNuevo.ao_on = off theMaterial_3.materialList[o]= materialNuevo valor= valor+1 pb_pcache.value= 100 *valor/cantidad.count ) ) ) ) ) ) CreateDialog CHANGE_MAP_PROPERTIES