work
save startup blend for animation tab & whatnot
This commit is contained in:
@@ -31,6 +31,13 @@ from bpy.utils import register_class
|
||||
from ..utils import compat
|
||||
from ..stats import count
|
||||
from ..stats import misc
|
||||
from ..utils.compat import (
|
||||
format_bytes,
|
||||
format_embedded_total,
|
||||
get_report,
|
||||
storage_override_icon,
|
||||
storage_type_icon,
|
||||
)
|
||||
from .utils import ui_layouts
|
||||
|
||||
|
||||
@@ -46,6 +53,8 @@ class ATOMIC_PT_stats_panel(bpy.types.Panel):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
atom = bpy.context.scene.atomic
|
||||
# Keep blend storage scan in sync whenever the stats panel is shown
|
||||
storage_report = get_report()
|
||||
|
||||
# categories selector / header
|
||||
row = layout.row()
|
||||
@@ -66,6 +75,12 @@ class ATOMIC_PT_stats_panel(bpy.types.Panel):
|
||||
row = box.row()
|
||||
row.label(text="Blend File Size: " + misc.blend_size())
|
||||
|
||||
row = box.row()
|
||||
row.label(
|
||||
text="Packed data (local IDs): "
|
||||
+ format_embedded_total(storage_report["total_embedded_packed"])
|
||||
)
|
||||
|
||||
# cateogry statistics
|
||||
split = box.split()
|
||||
|
||||
@@ -115,6 +130,52 @@ class ATOMIC_PT_stats_panel(bpy.types.Panel):
|
||||
# world count
|
||||
col.label(text=str(count.worlds()))
|
||||
|
||||
# local blend storage (excludes linked IDs)
|
||||
elif atom.stats_mode == 'STORAGE':
|
||||
|
||||
row = box.row()
|
||||
row.label(text="Local blend storage", icon='DISK_DRIVE')
|
||||
|
||||
rep = storage_report
|
||||
|
||||
col = box.column(align=True)
|
||||
col.label(
|
||||
text="IDs linked from another .blend (library) are excluded.",
|
||||
icon='INFO',
|
||||
)
|
||||
col.label(text="Packed = exact bytes stored inside this .blend.")
|
||||
col.label(text="Other sizes are estimates; disk file may compress.")
|
||||
col.label(text="Second icon = library override (when applicable).")
|
||||
|
||||
row = col.row()
|
||||
row.label(
|
||||
text="Packed embedded total: "
|
||||
+ format_embedded_total(rep["total_embedded_packed"])
|
||||
)
|
||||
|
||||
col.separator()
|
||||
col.label(text="By datablock type (estimated total)")
|
||||
|
||||
for t, nbytes in rep["by_type"][:12]:
|
||||
col.label(text=" %s: %s" % (t, format_bytes(nbytes)))
|
||||
|
||||
col.separator()
|
||||
col.label(text="Largest local datablocks (top 40)")
|
||||
|
||||
for r in rep["rows"][:40]:
|
||||
split = col.split(factor=0.68)
|
||||
left = split.row(align=True)
|
||||
left.label(icon=storage_type_icon(r["type"]), text="")
|
||||
left.label(
|
||||
icon=storage_override_icon(r.get("is_lib_override", False)),
|
||||
text="",
|
||||
)
|
||||
left.label(text=r["name"])
|
||||
split.label(text=format_bytes(r["size_bytes"]))
|
||||
|
||||
if len(rep["rows"]) > 40:
|
||||
col.label(text=" ...")
|
||||
|
||||
# collection statistics
|
||||
elif atom.stats_mode == 'COLLECTIONS':
|
||||
|
||||
|
||||
Reference in New Issue
Block a user