PDA

View Full Version : looking for mesh density by color script


Stefan-Morrell
08-14-2009, 04:20 AM
hey guys..some time ago I saw a script posted here that would color your scene models according to the polycount,with heavy meshes being a dark red & lighter meshes being orange..does anyone recall this script or happen to know where I could find it

thanks
Stefan

cyfer
08-14-2009, 09:14 PM
I don't recall this script but try this


try(destroyDialog PolyCountColor) catch()

rollout PolyCountColor "PolyColor" width:130
(
group "Low"
(
label lbl1 "UpTo" across:2 align:#left
spinner spn1 "" width:70 range:[1,1000,100] type:#integer scale:1 across:2 align:#Right
colorPicker cp1 "" color:[0,255,0] across:1 align:#Center enabled:false

)

group "Mid"
(
label lbl2 "UpTo" across:2 align:#left
spinner spn2 "" width:70 range:[100,5000,1000] type:#integer scale:1 across:2 align:#Right
colorPicker cp2 "" color:[0,0,255] across:1 align:#Center enabled:false
)

group "High"
(
label lbl3 "UpTo OR More Than" align:#Center
spinner spn3 "" Width:(PolyCountColor.width - 20) range:[1000,1000000000,10000] type:#integer scale:1 align:#Center
colorPicker cp3 "" color:[255,0,0] across:1 align:#Center enabled:false

)

Button Btn "ColoRize" Width:(PolyCountColor.width - 20) align:#Center


fn Colorize =
(
for i in objects where superclassof i == GeometryClass do
(
(polyCount = getPolygonCount i)

if (classof i == Editable_Poly or classof i ==PolyMeshObject)
then (FaceCount = polyCount[1]*2)
else (FaceCount = polyCount[1])

case of
(
(FaceCount <= spn1.value):
(
col = (FaceCount /Spn1.Value as float)
i.wireColor = [0,-col*230 ,0]
)

(FaceCount <= spn2.value and FaceCount > spn1.value):
(
col = (FaceCount /Spn2.Value as float)
i.wireColor = [0, 0,-col*230]
)

(FaceCount <= spn3.value and FaceCount > spn2.value):
(
col = (FaceCount /Spn3.Value as float)
i.wireColor = [-col*230, 0,-0]
)

(FaceCount > spn3.value and FaceCount > spn2.value): (i.WireColor = [25,0,0])
)
)

)

on Btn pressed do Colorize()
on spn1 changed val do Colorize()
on spn2 changed val do Colorize()
on spn3 changed val do Colorize()
)


createdialog PolyCountColor style:#( #style_toolwindow, #style_sysmenu)

Stefan-Morrell
08-15-2009, 03:44 AM
awesome,thats exactly what I was after..thank you very much for posting!
:bowdown:

cyfer
08-15-2009, 12:20 PM
No prob. if something comes up ..please post again in this thread

btw , great environments & characters 5/5

CGTalk Moderation
08-15-2009, 12:20 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.