Skip to content

Commit

Permalink
belay import of WgpuCanvas
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Aug 28, 2024
1 parent 2a4fcf8 commit b0f9155
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion octarine/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from functools import wraps, lru_cache, partial
from collections import OrderedDict

from wgpu.gui.auto import WgpuCanvas, run
from wgpu.gui.offscreen import WgpuCanvas as WgpuCanvasOffscreen

from .visuals import mesh2gfx, volume2gfx, points2gfx, lines2gfx, text2gfx
Expand Down Expand Up @@ -149,6 +148,7 @@ def __init__(
return

if not offscreen:
from wgpu.gui.auto import WgpuCanvas
self.canvas = WgpuCanvas(**defaults)
else:
self.canvas = WgpuCanvasOffscreen(**defaults)
Expand Down Expand Up @@ -754,6 +754,7 @@ def show(self, use_sidecar=False, toolbar=False, start_loop=False):
self.canvas.show()

if start_loop:
from wgpu.gui.auto import run
run()
elif utils._type_of_script() in ("terminal", "script"):
logger.warning(
Expand Down

0 comments on commit b0f9155

Please sign in to comment.