Skip to content

Commit 057bda8

Browse files
committed
Merge branch 'enh_manifold_models'
2 parents 37a7689 + be52fa9 commit 057bda8

File tree

3 files changed

+142
-164
lines changed

3 files changed

+142
-164
lines changed

src/flitter/engine/control.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from ..language.vm import log_vm_stats
1717
from ..model import Vector, StateDict, Context, null, numbers_cache_counts, empty_numbers_cache
1818
from ..plugins import get_plugin
19+
from ..render.window.models import Model
1920

2021

2122
class EngineController:
@@ -334,6 +335,9 @@ async def run(self):
334335
self._references = {}
335336
self.pages = []
336337
program = run_program = current_program = context = None
338+
count = Model.flush_cache()
339+
if count:
340+
logger.trace("Flushed {} 3D models", count)
337341
SharedCache.clean(0)
338342
for renderers in self.renderers.values():
339343
while renderers:

src/flitter/render/window/models.pxd

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,23 @@ cdef int64_t DefaultSegments
1010

1111
cdef class Model:
1212
cdef readonly str name
13-
cdef readonly object trimesh_model
14-
cdef readonly bint created
15-
cdef readonly bint valid
13+
cdef readonly dict cache
1614
cdef Vector bounds
1715
cdef set dependents
1816
cdef list buffer_caches
1917

20-
cpdef bint is_manifold(self)
2118
cpdef void check_for_changes(self)
19+
cpdef bint is_manifold(self)
2220
cpdef object build_trimesh(self)
21+
cpdef object build_manifold(self)
2322

2423
cpdef void add_dependent(self, Model model)
2524
cpdef void invalidate(self)
26-
cpdef object get_trimesh(self)
2725
cpdef Vector get_bounds(self)
26+
cpdef object get_trimesh(self)
27+
cpdef object get_manifold(self)
2828
cdef tuple get_buffers(self, object glctx, dict objects)
2929

30-
cpdef Model manifold(self)
3130
cpdef Model flatten(self)
3231
cpdef Model invert(self)
3332
cpdef Model repair(self)

0 commit comments

Comments
 (0)