Skip to content

Commit 04ef6b3

Browse files
committed
diffuse light setting in pickle, cleanup without render mutex set
1 parent 325d4ec commit 04ef6b3

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

webgpu/light.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def __getstate__(self):
4545
"key": self.key,
4646
"fill": self.fill,
4747
"ambient": self.ambient,
48+
"diffuse": self.diffuse,
4849
"specular": self.specular,
4950
"shininess": self.shininess,
5051
"wrap": self.wrap,
@@ -55,8 +56,9 @@ def __getstate__(self):
5556
return state
5657

5758
def __setstate__(self, state):
58-
self.keys = state["key"]
59+
self.key = state["key"]
5960
self.fill = state["fill"]
61+
self.diffuse = state.get("diffuse", 0.75)
6062
self.ambient = state["ambient"]
6163
self.specular = state["specular"]
6264
self.shininess = state["shininess"]

webgpu/scene.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ def render(self, t=0, rerender_if_update_needed=True):
336336

337337
def cleanup(self):
338338
"""Detach the scene from its canvas, unregister callbacks, and release JS proxies."""
339+
if self._render_mutex is None:
340+
return
339341
with self._render_mutex:
340342
if self.canvas is not None:
341343
self.options.camera.unregister_callbacks(self.input_handler)

0 commit comments

Comments
 (0)