From 641beb7e4f6ac6435a3a5b91cdc98df184b53bca Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 8 Sep 2023 14:55:59 -0400 Subject: [PATCH] FIX: Simplify --- mne/viz/backends/_pyvista.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/mne/viz/backends/_pyvista.py b/mne/viz/backends/_pyvista.py index e0e49a8d48b..fc9a2c6452a 100644 --- a/mne/viz/backends/_pyvista.py +++ b/mne/viz/backends/_pyvista.py @@ -168,8 +168,6 @@ def _build(self): return self.plotter def _is_active(self): - if self.plotter is None: - return False return hasattr(self.plotter, "ren_win") @@ -870,16 +868,15 @@ def _enable_depth_peeling(self): def _toggle_antialias(self): """Enable it everywhere except on systems with problematic OpenGL.""" - if self.figure._is_active(): - # MESA can't seem to handle MSAA and depth peeling simultaneously, see - # https://github.com/pyvista/pyvista/issues/4867 - bad_system = _is_mesa(self.plotter) - for plotter in self._all_plotters: - if bad_system or not self.antialias: - plotter.disable_anti_aliasing() - else: - if not bad_system: - plotter.enable_anti_aliasing(aa_type="msaa") + # MESA can't seem to handle MSAA and depth peeling simultaneously, see + # https://github.com/pyvista/pyvista/issues/4867 + bad_system = _is_mesa(self.plotter) + for plotter in self._all_plotters: + if bad_system or not self.antialias: + plotter.disable_anti_aliasing() + else: + if not bad_system: + plotter.enable_anti_aliasing(aa_type="msaa") def remove_mesh(self, mesh_data): actor, _ = mesh_data