Featured post

new redirect for blender.org bpy docs.

http://www.blender.org/api/blender_python_api_current/ As of 10/11 november 2015 we can now link to the current api docs and not be worr...

July 06, 2011

Selecting ungrouped objects

# a little verbose? :)
import bpy

scene_groups = bpy.data.groups

# make sure before this, that nothing is selected.
names_of_grouped_objects = []

for i in bpy.context.selectable_objects:
for group in bpy.data.groups:
for item in group.objects:
if item.name == i.name:
print("i.name", i.name, " is grouped in ", group.name)

# ungrouped objects
print("ungrouped objects are these")
for i in bpy.context.selectable_objects:
if i.name not in names_of_grouped_objects:
bpy.data.objects[i.name].select = True

No comments:

Post a Comment

Please use Blender.StackExchange.com for python scripting questions unrelated to this post.