PDA

View Full Version : random select splines?


PsychoSilence
02-24-2006, 10:03 AM
Hy community,

i have a scene with about 2.500 renderable splines. now i want to select only like 30% of them. is there an easy way to do so? or do i have to select them one by one in the selection floater :( ?

regards and thanks in advance

Psycho

j-man
02-24-2006, 10:14 AM
with a script?


-- Randomly select n number of objects from selection
-- this number tells the script the fraction of object to keep selected, ie .1=10%, .75=3/4

amt=.33

-- script starts here.
a=selection as array
d=#()
i=1
while i< a.count/4 do
(
r=(random 1 a.count)
if (finditem d a[r])==0 then append d a[r]
i+=1
)
select d




J.

soulburn3d
02-24-2006, 05:08 PM
Check out selectionRandomizer at...

http://www.neilblevins.com/soulburnscripts/soulburnscripts.htm

- Neil

CGTalk Moderation
02-24-2006, 05:08 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.