macroScript UVW_fix category:"anas" toolTip:"fixes UVW for channels not = 1" ( for o in selection do ( if superclassof o == geometryclass then ( if o.material != undefined then ( if ( classof o.material == Standardmaterial ) then ( if o.material.diffusemap != undefined then ( Mapch = o.material.diffusemap.coords.mapchannel if mapch == 1 then ( print "ok" ) else ( addmodifier o (Unwrap_UVW ()) ui:on o.modifiers[#unwrap_uvw].unwrap.setMapChannel mapch for j in selection do (maxOps.CollapseNodeTo j 1 off ) ) ) else print "no diffuse map applied" ) else if ( classof o.material == multimaterial ) then ( submat = o.material.materiallist for i in submat do ( if classof i == standardmaterial then ( if i.diffusemap != undefined then ( Mapch = i.diffusemap.coords.mapchannel if mapch == 1 then ( print "ok" ) else ( addmodifier o (Unwrap_UVW ()) ui:on o.modifiers[#unwrap_uvw].unwrap.setMapChannel mapch for j in selection do (maxOps.CollapseNodeTo j 1 off ) ) ) else print "no diffuse map applied" ) else print "unsupported material " ) ) else print "unsupported material " ) else print "no material applied" ) else Print "non geometry node" ) )