Skip to content
Snippets Groups Projects
Commit 704c1840 authored by Ju Hee Son's avatar Ju Hee Son
Browse files

Add new file

parent 3db01c11
No related branches found
No related tags found
No related merge requests found
Data Access (bpy.data)
This module is used for all Blender/Python access.
bpy.data.data
Access to Blender’s internal data
Type
bpy.types.BlendData
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)
bpy.data.meshes.remove(mesh)
# write images into a file next to the blend
import os
with open(os.path.splitext(bpy.data.filepath)[0] + ".txt", 'w') as fs:
for image in bpy.data.images:
fs.write("%s %d x %d\n" % (image.filepath, image.size[0], image.size[1]))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment