Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2a6cccf
Added preload property to add-on panel
Domelele Oct 20, 2025
ad69768
Started preloading module
Domelele Oct 22, 2025
e20196c
Added callback to Preload property
Domelele Oct 22, 2025
2ff7eed
implemented preloader prototype
Domelele Oct 24, 2025
a3c7ffd
Refactored update_obj() into load_into_ram() and update_scene() funct…
Domelele Oct 24, 2025
b39455a
Added threaded diskread
Domelele Oct 29, 2025
83d204b
Added data conversion to preload
Domelele Oct 29, 2025
260f5c3
Added loading status to UI
Domelele Oct 30, 2025
0297047
Added multithreading per object
Domelele Oct 30, 2025
ea21bef
moved _load_data_into_buffer to class method
Domelele Nov 5, 2025
f81d36b
Reduced memory leak by explicitly removing old object.data DataBlock
Domelele Nov 5, 2025
51e443c
Added documentation
Domelele Nov 6, 2025
8b44bbb
Removed unused buffer
Domelele Nov 6, 2025
56a8fc6
Removed deletemesh() since meshio meshes seem to be garbage collected
Domelele Nov 6, 2025
f440384
Moved update_mesh() profiling code to preloader
Domelele Nov 6, 2025
67dc202
Renamed Preloader to Framebuffer
Domelele Nov 6, 2025
19d0a3c
Removed old unused importer code
Domelele Nov 6, 2025
d58d0a3
Fixed exceptions that may occur while rendering due to write block of…
Domelele Nov 13, 2025
42b172a
Mesh data now gets removed on buffer invalidation and on buffer termi…
Domelele Nov 13, 2025
467ad56
Removed unused test code
Domelele Nov 13, 2025
dd61e0e
load_into_ram() can now buffer the filepath using the filepath_buffer…
Domelele Nov 14, 2025
6454a7c
Added function decorator for function timings for profiling
Domelele Nov 18, 2025
ae55c43
Removed debug messages
Domelele Nov 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added loading status to UI
  • Loading branch information
Domelele committed Oct 30, 2025
commit 260f5c3cf3063fe0814fbc8872016825530cfc39
6 changes: 6 additions & 0 deletions bseq/panels.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ def draw(self, context):
col2.prop(sim_loader, "auto_refresh_all", text="")
col1.label(text="Preload Frames")
col2.prop(sim_loader, "preload_next_frame", text="")
if sim_loader.preload_next_frame:
col1.label(text="Loading Status")
row2 = col2.row()
row2.enabled = False
row2.prop(sim_loader, "loading_status", text="")


class BSEQ_Advanced_Panel(BSEQ_Panel, bpy.types.Panel):
bl_label = "Advanced Settings"
Expand Down
8 changes: 7 additions & 1 deletion bseq/preloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Frame():
_buffer_meshes: dict[str, meshio.Mesh]
_buffer_data: dict[str, bpy.types.Mesh]
_frame: int = -1
loading_complete: bool = False

def _load_buffer_to_data(self, object: bpy.types.Object, meshio_mesh, depsgraph):
if object.name_full in self._buffer_data:
Expand All @@ -37,14 +38,18 @@ def _load_objs(self, scene, depsgraph):
self._frame = scene.frame_current + scene.frame_step
self._buffer_meshes = {}
self._buffer_data = {}
n_loaded = 0
for obj in bpy.data.objects:
scene.BSEQ.loading_status = f"{n_loaded}/{len(bpy.data.objects)}"
n_loaded += 1
# TODO: Select next frame (currently seems to load the current frame again)
mesh = load_into_ram(obj, scene, depsgraph, target_frame = self._frame)
if isinstance(mesh, meshio.Mesh):
self._buffer_meshes[obj.name_full] = mesh
_load_data_into_buffer(mesh, self._buffer_data, obj)
end = time.perf_counter()
print("load_objs() took ", (end - start) * 1000, " ms")
scene.BSEQ.loading_status = "Complete"

def _delete_mesh(self, mesh: meshio.Mesh):
mesh.point_data.clear()
Expand Down Expand Up @@ -93,11 +98,12 @@ def queue_load(self, scene, depsgraph):
init()
copy_start = time.perf_counter()
self._buffer = scene.copy()

copy_end = time.perf_counter()
self._frame = scene.frame_current + scene.frame_step
start_queue = time.perf_counter()
self._future = _executor.submit(self._load_objs, scene, depsgraph)
end_submit = time.perf_counter()
scene.BSEQ.loading_status = "Queued"
end = time.perf_counter()
print("queue_load():\n\ttotal: ", (end - start) * 1000, "\n\tcopy: ", (copy_end - copy_start) * 1000, "\n\tqueuing:", (end - start_queue) * 1000)

Expand Down
2 changes: 2 additions & 0 deletions bseq/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class BSEQ_scene_property(bpy.types.PropertyGroup):
default=False,
update=update_preloader
)

loading_status: bpy.props.StringProperty(default="")

use_custom_transform: bpy.props.BoolProperty(name='Custom Transform',
description="Use a custom transformation matrix when importing",
Expand Down