---------------------------------------------------------------------------------- --MaterialID Dashboard --(C) Sam O'Hare, Uniform Communications Ltd, Jan 2006 --Last edited 10/01/06 --Email sam@pixelpollen.com --Version 0.1 --Current Functionality --Shortcut board of material IDs to assign. --Assign random material IDs to selected faces. -- --Revision History: --28/01/05 - Inital script. --08/05/05 - Updated to have an interface, work on non-sequential numbers. --10/01/06 - Updated to include dashboard. Renamed. ---------------------------------------------------------------------------------- macroScript MatIDDashboard category:"Dusk" tooltip:"Material ID Dashboard" icon:#("Uniform",7) ( --Variables-- -- Function fn Apply_Material matID = ( if classof $ == Editable_Poly then ( faces = polyop.getFaceSelection $ if faces != undefined then for i in faces do ( polyop.setFaceMatID $ i matID ) ) ) --Interface-- rollout MID "MatID Dash" ( button b01 "1" width:20 across:4 button b02 "2" width:20 button b03 "3" width:20 button b04 "4" width:20 button b05 "5" width:20 across:4 button b06 "6" width:20 button b07 "7" width:20 button b08 "8" width:20 button b09 "9" width:20 across:4 button b10 "10" width:20 offset:[4,0] button b11 "11" width:20 offset:[4,0] button b12 "12" width:20 offset:[4,0] button b13 "13" width:20 across:4 offset:[4,0] button b14 "14" width:20 offset:[4,0] button b15 "15" width:20 offset:[4,0] button b16 "16" width:20 offset:[4,0] on b01 pressed do Apply_Material 1 on b02 pressed do Apply_Material 2 on b03 pressed do Apply_Material 3 on b04 pressed do Apply_Material 4 on b05 pressed do Apply_Material 5 on b06 pressed do Apply_Material 6 on b07 pressed do Apply_Material 7 on b08 pressed do Apply_Material 8 on b09 pressed do Apply_Material 9 on b10 pressed do Apply_Material 10 on b11 pressed do Apply_Material 11 on b12 pressed do Apply_Material 12 on b13 pressed do Apply_Material 13 on b14 pressed do Apply_Material 14 on b15 pressed do Apply_Material 15 on b16 pressed do Apply_Material 16 edittext IDs "" width:70 across:2 offset:[0,0] button selected "R" offset:[11,0] height:17 -- button all "All" on selected pressed do ( if classof $ == Editable_Poly then ( faces = polyop.getFaceSelection $ if faces != undefined then ( matIDs_text = filterstring IDs.text "," matIDs = for i in matIDs_text collect i as integer for i in faces do ( rand = random 1 matIDs.count polyop.setFaceMatID $ i matIDs[rand] ) ) ) ) ) createdialog MID 130 135 50 50 )