0
$\begingroup$

I converted a particle system to "real" objects.

I got thousand of them... I would like to be able to select every nth object.

I've seen it is possible to select items with a pattern, but is it possible to select every n item ?

Thanks.

$\endgroup$
0

1 Answer 1

1
$\begingroup$

Hoorray

I made my first Blender python script, and it works ! See here.

"""
nthObjectSelector by gordielachance
This will reduce your current selection of object to nth objects.
https://gist.github.com/gordielachance/ba32a3087f8d327bfdeb9d0ea7fb4935
"""
import bpy

#SETUP
nth = 3 #Specify your nth value here !

#list of selected objects
list_all = bpy.context.selected_objects

#start by unselecting everything
for obj in list_all:
    obj.select = False

#now only select nth
list_reduced = list_all[::nth]

for obj in list_reduced:
    obj.select = True

#debug
print("nthObjectSelector ({}) : selected {} out {} objects".format(nth,len(list_reduced), len(list_all)))
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .