Hi All man :)
I have create this script: (Create a plane with more subdivision and select it)
try (destroydialog t) catch()
Percentage = 100.0 ---define the initial percentage
rollout t "Test"
(
spinner sp "Rate = " range:[0,100,100] type:#integer
button b "Go!"
on sp changed val do Percentage = val
on b pressed do
(
obj = $ ---the object selected
converttopoly obj ---convert the object in editpoly
getFaces = obj.numfaces --get the number of the face
---Calculate the number of face to selected by specified percentage
numFaces = (Percentage / 100.0 * getFaces) as integer
---create a array for all faces by specified percentage value
numFaces_array = #()
for o=1 to numFaces do
(
append numFaces_array o
)
subobjectLevel = 4
polyop.setFaceSelection obj numFaces_array --select the face
print numFaces
----
update obj
)
)
createdialog t
As you can see, the script determines a percentage of a known number of faces that are selected consecutively (1,2,3, etc.)on the subdivision plane.
How do random known number of faces across the whole subdivision plane?
Some days I feel, but I can not understand...
Thanks in advance :)
By Michele71 · 2011-02-07
Anubis · 2011-02-07