Skip to content

Commit

Permalink
FIX: Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Sep 8, 2023
1 parent 3c3aa25 commit 641beb7
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions mne/viz/backends/_pyvista.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 641beb7

Please sign in to comment.