MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / update_entries

Function update_entries

splashsurf_studio/src/updater.py:70–123  ·  view source on GitHub ↗
(scene)

Source from the content-addressed store, hash-verified

68 mesh.update()
69
70def update_entries(scene):
71 frame = scene.frame_current
72
73 # Check if frame should be cached
74 cache_frame = False
75 for part in scene.splashsurf_studio.cached_frames:
76 if frame == part.frame:
77 cache_frame = True
78 break
79
80 # Use correct reconstruction properties
81 use_render_props = scene.splashsurf_studio.use_render_for_viewport or scene.splashsurf_studio.rendering
82 if cache_frame:
83 match scene.splashsurf_studio.cache_settings:
84 case 'VIEWPORT':
85 use_render_props = False
86 case 'RENDER':
87 use_render_props = True
88
89 use_cache = scene.splashsurf_studio.use_cache_during_render or not scene.splashsurf_studio.rendering
90
91 for entry in scene.splashsurf_studio.data_objs:
92 if not entry.generate:
93 continue
94
95 if use_cache and frame in cached_meshes and entry.data_pointer in cached_meshes[frame]:
96 cloud = entry.data_pointer
97 if cloud is None:
98 print(f"Object '{entry.data_pointer}' not found in the scene.")
99 continue
100
101 # Try to get old surface object
102 surface = get_valid_surface_object(scene, cloud, entry)
103
104 old_mesh = surface.data
105 if old_mesh is not None and not old_mesh.cached:
106 global uncached_mesh
107 uncached_mesh = old_mesh
108
109 surface.data = cached_meshes[frame][entry.data_pointer]
110
111 copy_materials(old_mesh, surface.data)
112
113 else:
114 update_reconstruction(scene, entry, use_render_props)
115
116 if use_cache and cache_frame:
117 if frame not in cached_meshes:
118 cached_meshes[frame] = {}
119
120 mesh = entry.surface_pointer.data
121 mesh.cached = True
122
123 cached_meshes[frame][entry.data_pointer] = mesh

Callers 1

generate_meshFunction · 0.85

Calls 3

get_valid_surface_objectFunction · 0.85
copy_materialsFunction · 0.85
update_reconstructionFunction · 0.85

Tested by

no test coverage detected