Skip to content

Commit 6018bca

Browse files
committed
Use same active scalars as parent if possible
For the internal pipeline, try to set the child data sources' active scalars to match that of the parent if possible. This prevents the active scalars changing due to operations that produce child data sources. Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
1 parent a507458 commit 6018bca

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tomviz/operators/OperatorPython.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,11 @@ void OperatorPython::updateChildDataSource(vtkSmartPointer<vtkDataObject> data)
657657
if (dataSource->hasTiltAngles())
658658
dataSource->setType(DataSource::TiltSeries);
659659

660+
// Keep the same active scalars that the parent had if possible
661+
QString prevActiveScalars = this->dataSource()->activeScalars();
662+
if (dataSource->listScalars().contains(prevActiveScalars))
663+
dataSource->setActiveScalars(prevActiveScalars);
664+
660665
emit dataSource->dataChanged();
661666
emit dataSource->dataPropertiesChanged();
662667
ActiveObjects::instance().renderAllViews();

0 commit comments

Comments
 (0)