From a0f23ef8157352776d161656fdd12e030e3ed98b Mon Sep 17 00:00:00 2001 From: Sankhesh Jhaveri Date: Sun, 2 Nov 2025 21:46:56 -0500 Subject: [PATCH] fix(datasetattributes): Fix active attribute assignment This change fixes an issue where setting different attributes after initializing the dataset causes the active attributes to be retained from previous dataset state. --- Sources/Common/DataModel/DataSetAttributes/index.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Sources/Common/DataModel/DataSetAttributes/index.js b/Sources/Common/DataModel/DataSetAttributes/index.js index b024b5cc50f..6fe7c60b107 100644 --- a/Sources/Common/DataModel/DataSetAttributes/index.js +++ b/Sources/Common/DataModel/DataSetAttributes/index.js @@ -61,17 +61,9 @@ function vtkDataSetAttributes(publicAPI, model) { ); return -1; } - let currentAttribute = model[`active${attType}`]; - if (currentAttribute >= 0 && currentAttribute < model.arrays.length) { - if (model.arrays[currentAttribute] === arr) { - return currentAttribute; - } - // FIXME setting an array actually changes its index - publicAPI.removeArrayByIndex(currentAttribute); - } if (arr) { - currentAttribute = publicAPI.addArray(arr); + const currentAttribute = publicAPI.addArray(arr); model[`active${attType}`] = currentAttribute; } else { model[`active${attType}`] = -1;