Skip to content

Commit

Permalink
deploy: 4ad159d
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Sep 26, 2023
1 parent 2f4c6f4 commit f6e3c66
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 114 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/examples/15_gui_in_scene.doctree
Binary file not shown.
10 changes: 0 additions & 10 deletions _sources/examples/15_gui_in_scene.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ performed on them.
rng = onp.random.default_rng(0)
displayed_3d_container: Optional[viser.Gui3dContainerHandle] = None
displayed_index: Optional[int] = None
def make_frame(i: int) -> None:
# Sample a random orientation + position.
Expand All @@ -52,18 +51,11 @@ performed on them.
@frame.on_click
def _(_):
nonlocal displayed_3d_container
nonlocal displayed_index
# Close previously opened GUI.
if displayed_3d_container is not None:
displayed_3d_container.remove()
# Don't re-show the same GUI element.
if displayed_index == i:
return
displayed_index = i
displayed_3d_container = client.add_3d_gui_container(f"/frame_{i}/gui")
with displayed_3d_container:
go_to = client.add_gui_button("Go to")
Expand Down Expand Up @@ -105,12 +97,10 @@ performed on them.
@close.on_click
def _(_) -> None:
nonlocal displayed_3d_container
nonlocal displayed_index
if displayed_3d_container is None:
return
displayed_3d_container.remove()
displayed_3d_container = None
displayed_index = None
for i in range(num_frames):
make_frame(i)
Expand Down
Loading

0 comments on commit f6e3c66

Please sign in to comment.