Skip to content

Commit 1b4a11a

Browse files
committed
Fix volume pipeline range check to work with cell_data
Previously trying to render volume views of UnstructuredGrids with cell_data as the rendered scalar field caused constant error messages although there are no real issues with them. Signed-off-by: Topi Kuutela <topi.kuutela@aalto.fi>
1 parent 61ef7c0 commit 1b4a11a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

mayavi/modules/volume.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,15 @@ def _setup_current_range(self):
455455
# Set the current range.
456456
dataset = mm.source.get_output_dataset()
457457
dsh = DataSetHelper(dataset)
458-
name, rng = dsh.get_range('scalars', 'point')
459-
if name is None:
458+
point_name, point_rng = dsh.get_range('scalars', 'point')
459+
cell_name, cell_rng = dsh.get_range('scalars', 'cell')
460+
if point_name is None and cell_name is None:
460461
error('No scalars in input data!')
461462
rng = (0, 255)
463+
elif not point_name is None:
464+
rng = point_rng
465+
else:
466+
rng = cell_rng
462467

463468
if self.current_range != rng:
464469
self.current_range = rng

0 commit comments

Comments
 (0)