Immediately update viewer when output or cmap changes (#1131)

* Immediately update viewer when output or cmap changes

* lint
This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-12-14 16:26:05 -08:00
1 parent 5630148c50
commit d51718ec2b
1 file changed
+13
+13
View File
@@ -454,6 +454,19 @@ class ViewerState:
else:
self.prev_camera_matrix = camera_object["matrix"]
self.camera_moving = True
output_type = self.vis["renderingState/output_choice"].read()
if output_type is None:
output_type = OutputTypes.INIT
if self.prev_output_type != output_type:
self.camera_moving = True
colormap_type = self.vis["renderingState/colormap_choice"].read()
if colormap_type is None:
colormap_type = ColormapTypes.INIT
if self.prev_colormap_type != colormap_type:
self.camera_moving = True
return camera_object
def _apply_colormap(self, outputs: Dict[str, Any], colors: torch.Tensor = None, eps=1e-6):