1 # SPDX-FileCopyrightText: 2010 Mariano Hidalgo
3 # SPDX-License-Identifier: GPL-2.0-or-later
6 "name": "Scene Information",
7 "author": "uselessdreamer",
10 "location": "Properties > Scene > Blend Info Panel",
11 "description": "Show information about the .blend",
13 "doc_url": "{BLENDER_MANUAL_URL}/addons/system/blend_info.html",
20 def quantity_string(quantity
, text_single
, text_plural
, text_none
=None):
24 text_none
= text_plural
27 string
= str(quantity
) + sep
+ text_none
30 string
= str(quantity
) + sep
+ text_single
33 string
= str(quantity
) + sep
+ text_plural
41 class OBJECT_PT_blendinfo(bpy
.types
.Panel
):
42 bl_label
= "Blend Info"
43 bl_space_type
= "PROPERTIES"
44 bl_region_type
= "WINDOW"
46 bl_options
= {'DEFAULT_CLOSED'}
48 def draw(self
, context
):
52 objects
= bpy
.data
.objects
59 num
= len(bpy
.data
.objects
)
60 l_row
.label(text
=quantity_string(num
, "Object", "Objects")
65 ob_cols
.append(l_row
.column())
66 ob_cols
.append(l_row
.column())
68 row
= ob_cols
[0].row()
69 meshes
= [o
for o
in objects
.values() if o
.type == 'MESH']
71 row
.label(text
=quantity_string(num
, "Mesh", "Meshes"),
74 row
= ob_cols
[1].row()
75 curves
= [o
for o
in objects
.values() if o
.type == 'CURVE']
77 row
.label(text
=quantity_string(num
, "Curve", "Curves"),
80 row
= ob_cols
[0].row()
81 cameras
= [o
for o
in objects
.values() if o
.type == 'CAMERA']
83 row
.label(text
=quantity_string(num
, "Camera", "Cameras"),
86 row
= ob_cols
[1].row()
87 lamps
= [o
for o
in objects
.values() if o
.type == 'LIGHT']
89 row
.label(text
=quantity_string(num
, "Lamp", "Lamps"),
92 row
= ob_cols
[0].row()
93 armatures
= [o
for o
in objects
.values() if o
.type == 'ARMATURE']
95 row
.label(text
=quantity_string(num
, "Armature", "Armatures"),
98 row
= ob_cols
[1].row()
99 lattices
= [o
for o
in objects
.values() if o
.type == 'LATTICE']
101 row
.label(text
=quantity_string(num
, "Lattice", "Lattices"),
104 row
= ob_cols
[0].row()
105 empties
= [o
for o
in objects
.values() if o
.type == 'EMPTY']
107 row
.label(text
=quantity_string(num
, "Empty", "Empties"),
110 row
= ob_cols
[1].row()
111 empties
= [o
for o
in objects
.values() if o
.type == 'SPEAKER']
113 row
.label(text
=quantity_string(num
, "Speaker", "Speakers"),
114 icon
='OUTLINER_OB_SPEAKER')
121 num
= len(bpy
.data
.objects
)
122 l_row
.label(text
="Datablocks in the scene:")
125 db_cols
.append(l_row
.column())
126 db_cols
.append(l_row
.column())
128 row
= db_cols
[0].row()
129 num
= len(bpy
.data
.meshes
)
130 row
.label(text
=quantity_string(num
, "Mesh", "Meshes"),
133 row
= db_cols
[1].row()
134 num
= len(bpy
.data
.curves
)
135 row
.label(text
=quantity_string(num
, "Curve", "Curves"),
138 row
= db_cols
[0].row()
139 num
= len(bpy
.data
.cameras
)
140 row
.label(text
=quantity_string(num
, "Camera", "Cameras"),
143 row
= db_cols
[1].row()
144 num
= len(bpy
.data
.lights
)
145 row
.label(text
=quantity_string(num
, "Lamp", "Lamps"),
148 row
= db_cols
[0].row()
149 num
= len(bpy
.data
.armatures
)
150 row
.label(text
=quantity_string(num
, "Armature", "Armatures"),
151 icon
='ARMATURE_DATA')
153 row
= db_cols
[1].row()
154 num
= len(bpy
.data
.lattices
)
155 row
.label(text
=quantity_string(num
, "Lattice", "Lattices"),
158 row
= db_cols
[0].row()
159 num
= len(bpy
.data
.materials
)
160 row
.label(text
=quantity_string(num
, "Material", "Materials"),
161 icon
='MATERIAL_DATA')
163 row
= db_cols
[1].row()
164 num
= len(bpy
.data
.worlds
)
165 row
.label(text
=quantity_string(num
, "World", "Worlds"),
168 row
= db_cols
[0].row()
169 num
= len(bpy
.data
.textures
)
170 row
.label(text
=quantity_string(num
, "Texture", "Textures"),
173 row
= db_cols
[1].row()
174 num
= len(bpy
.data
.images
)
175 row
.label(text
=quantity_string(num
, "Image", "Images"),
178 row
= db_cols
[0].row()
179 num
= len(bpy
.data
.texts
)
180 row
.label(text
=quantity_string(num
, "Text", "Texts"),
189 from bpy
.utils
import register_class
194 from bpy
.utils
import unregister_class
195 for cls
in reversed(classes
):
196 unregister_class(cls
)
199 if __name__
== "__main__":