2010-06-27 18:34:27 +00:00
|
|
|
import bpy
|
|
|
|
|
|
|
|
|
|
|
|
# print all objects
|
|
|
|
for obj in bpy.data.objects:
|
|
|
|
print(obj.name)
|
|
|
|
|
|
|
|
|
|
|
|
# print all scene names in a list
|
|
|
|
print(bpy.data.scenes.keys())
|
|
|
|
|
|
|
|
|
|
|
|
# remove mesh Cube
|
|
|
|
if "Cube" in bpy.data.meshes:
|
|
|
|
mesh = bpy.data.meshes["Cube"]
|
|
|
|
print("removing mesh", mesh)
|
2011-03-26 03:42:59 +00:00
|
|
|
bpy.data.meshes.remove(mesh)
|
2010-06-27 18:34:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
# write images into a file next to the blend
|
2010-07-14 17:47:58 +00:00
|
|
|
import os
|
|
|
|
file = open(os.path.splitext(bpy.data.filepath)[0] + ".txt", 'w')
|
2010-06-27 18:34:27 +00:00
|
|
|
|
|
|
|
for image in bpy.data.images:
|
2011-03-26 03:42:59 +00:00
|
|
|
file.write("%s %d x %d\n" % (image.filepath, image.size[0], image.size[1]))
|
2010-06-27 18:34:27 +00:00
|
|
|
|
|
|
|
file.close()
|