Skip to content

Commit 8124f36

Browse files
committed
fix: use active_scalars_name to prefile scalars kwarg
1 parent 742508e commit 8124f36

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

loopstructural/gui/visualisation/loop_pyvistaqt_wrapper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ def add_mesh_object(self, mesh, name: str, *, scalars: Optional[Any] = None, cma
5555
# pass
5656

5757
# Decide rendering mode: color (solid) if color provided else scalar mapping
58+
scalars = scalars if scalars is not None else mesh.active_scalars_name
5859
use_scalar = color is None and scalars is not None
5960

6061
# Build add_mesh kwargs
6162
add_kwargs: Dict[str, Any] = {}
63+
6264
if use_scalar:
6365
add_kwargs['scalars'] = scalars
6466
add_kwargs['cmap'] = cmap

0 commit comments

Comments
 (0)