Skip to content

Commit cff6b6a

Browse files
committed
clear background when render checkbox unchecked
1 parent e7146be commit cff6b6a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

threedgrut/utils/viser_gui_util.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,19 +284,23 @@ def render_from_current_view(self, client) -> Tuple[torch.Tensor, torch.Tensor,
284284
points_plane
285285
)
286286

287-
def update_render_view(self, client, force: bool = False):
288-
"""Update rendered view - rewritten to match polyscope version"""
289-
if not self.viz_render_enabled and force:
290-
# img = to_np(self.model.features_specular)
291-
# client.scene.set_background_image(img)
292-
return
293-
287+
def update_render_view(self, client, force: bool = False):
294288
# Get current render style
295289
style = self.viz_render_style
296290

297291
# Render current view
298292
sple_orad, sple_odns, sple_odist, sple_onrm, sple_ohit, points_plane = self.render_from_current_view(client)
299293

294+
295+
"""Update rendered view - rewritten to match polyscope version"""
296+
if not self.viz_render_enabled and force:
297+
# Create a pure white background image
298+
# Get the shape from the model's features_specular to maintain dimensions
299+
rgb_np = to_np(sple_orad[0])
300+
img = np.ones(rgb_np.shape, dtype=np.float32) # Pure white image
301+
client.scene.set_background_image(img)
302+
return
303+
300304
# Update viser background image based on style
301305
if style == "color":
302306
# Convert RGB to numpy and set as background

0 commit comments

Comments
 (0)