Monday, 9 May 2011

Tiny group/items printing script

import bpy

# print a divider
print("="*20)

for item in bpy.data.groups:
print(item.name)
for object in item.objects:
print("--", object.name)
simple but useful.
and here is an even more usefull version.

import bpy

# creates a new text file, named "SceneList"
# writes Groups and contained Objects to it.

bpy.ops.text.new()
newtext = bpy.data.texts[-1] # -1 is last added text file
newtext.name = "SceneList"

newtext.write("="*20 + "\n") # makes a divider

for item in bpy.data.groups:
newtext.write(item.name + "\n")
for object in item.objects:
newtext.write("--" + object.name + "\n")

No comments:

Post a Comment