macroScript TextureArea category:"MonsterBlues" buttontext:"Texture Area" tooltip:"Texture Area" ( global TextureAreaTool if TextureAreaTool != undefined do ( closerolloutfloater TextureAreaTool ) TextureAreaTool = newrolloutfloater "Texture Area" 190 235 rollout TAreaAbout "About" ( label info1 "Texture Area Tool" align:#center label info2 "By martinez" align:#center hyperlink martinez "http://www.juantwo.com" align:#center label info3 "For Poop" align:#center hyperlink poop "http://www.poopinmymouth.com" align:#center ) -- End About Rollout rollout TareaDialog "Texture Area" ( button Evaluate "Evaluate Selection" group "Material ID's to Evaluate :" ( edittext matids "New Id :" listbox matlist items:#("1") height:5 button removeid "Remove ID" ) on matids entered newid do ( try ( id = execute(matids.text) ) catch () if id != undefined and id > 0 then ( append matlist.items newid matlist.items = matlist.items matids.text = "" ) else matids.text = "" ) on removeid pressed do ( try ( deleteItem matlist.items matlist.selection ) catch ( messageBox "Select and ID to remove." ) matlist.items = matlist.items ) on Evaluate pressed do ( local A = undefined local B = undefined local C = undefined local f = undefined local g = undefined local v = undefined local w = undefined if $ != undefined and matlist.items[1] != undefined then ( with redraw off ( max modify mode AddModifier $ (Edit_Mesh ()) AddModifier $ (Unwrap_UVW ()) uv = modpanel.getcurrentobject() local TArea = 0 for f = 1 to $.numfaces do ( faceid = getFaceMatID $ f if findItem matlist.items (faceid as string) != 0 do ( V1 = uv.getVertexIndexFromFace f 1 V2 = uv.getVertexIndexFromFace f 2 V3 = uv.getVertexIndexFromFace f 3 A = uv.getVertexPosition 0 V1 B = uv.getVertexPosition 0 V2 C = uv.getVertexPosition 0 V3 f = B.x - C.x g = A.y - C.y v = A.x - C.x w = B.y - C.y Area = (f*g/2) - (v*w/2) if Area <= 0 do Area = Area*-1 Tarea += Area ) ) DeleteModifier $ 1 DeleteModifier $ 1 Percent = Tarea*100 message = "You are using " + (Percent as string) + "% of your texture space." Messagebox message title:"Texture Area" ) -- End With Redraw off ) else ( messageBox "Please select a model and add Material ID's to check." ) -- End If ) -- End Evaluate pressed ) -- End Texture Area Rollout addRollout TareaDialog TextureAreaTool addRollout TAreaAbout TextureAreaTool rolledUp:true )