I'm trying to get a loop to run through the faces I've selected but it runs true all the faces of the model.. what am i doing wrong.
try (closeRolloutFloater MainFloater) catch()
fn Makeplaner ev nodes =
(
for n in nodes where isKindOf (obj = getAnimByHandle n) Editable_Poly do (
if planer ==true then
(
obj.EditablePoly.ConvertSelection #Vertex #Face
Mplaner = obj.GetSelection #Face
For i = 1 to Mplaner.count do
(
obj.EditablePoly.SetSelection #Face #{i}
obj.EditablePoly.makePlanar #Face
)
Mplaner = undefined
Polymodel = undefined
gc light:true
rerun() --call fn rerun
)
)
)
Fn rerun =
(
if planer == true then
(
Polymodel = NodeEventCallback mouseUp:true delay:5000 geometryChanged:Makeplaner
)
)
Rollout Menu01 "PPLANER"
(
checkbutton two "Check" pos:[2,6] width:80 height:20
on two changed state do
(
if state ==true then
(
global planer = true
rerun()
)
else
(
global planer = false
)
)
)
MainFloater = NewRolloutFloater "" 178 55
addRollout Menu01 MainFloater