Skip to content

Commit babb275

Browse files
germa89AlejandroFernandezLuces
authored andcommitted
Bump version 0.6.2
1 parent 5b3302d commit babb275

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

doc/changelog.d/209.fixed.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fix: not checking if actors have datasets.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
44

55
[project]
66
name = "ansys-tools-visualization-interface"
7-
version = "0.6.1"
7+
version = "0.6.2"
88
description = "A Python visualization interface for PyAnsys libraries"
99
readme = "README.rst"
1010
requires-python = ">=3.10,<4"

src/ansys/tools/visualization_interface/backends/pyvista/widgets/mesh_slider.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,21 @@ def __init__(self, plotter_helper: "Plotter") -> None:
5252
self._button: vtkButtonWidget = self.plotter_helper._pl.scene.add_checkbox_button_widget(
5353
self.callback, position=(45, 60), size=30, border_size=3
5454
)
55-
self._meshes = self.plotter_helper._pl.scene.meshes
5655
self._mb = None
5756
self._mesh_actor_list = []
5857

58+
@property
59+
def _meshes(self):
60+
"""Return all the meshes which have dataset from the underlying plotter."""
61+
# This method is patching #208
62+
# until pyvista fix this upstream.
63+
actors = self.plotter_helper._pl.scene.actors.values()
64+
meshes = []
65+
for actor in actors:
66+
if hasattr(actor, 'mapper') and hasattr(actor.mapper, "dataset"):
67+
meshes.append(actor.mapper.dataset)
68+
return meshes
69+
5970
def callback(self, state: bool) -> None:
6071
"""Remove or add the mesh slider widget actor upon click.
6172

0 commit comments

Comments
 (0)