Control Scalar Array not working properly #496
-
Hi! If you run this code, and then you change scalar (in this case, to node_value). The scalar array its changing, but its seems like its not deleting the previous one, so it doesnt show as it should. However, if when you add the mesh, you select the scalar, now the mesh its showing as it should: But, that only works for the fist time, because if you want to change to other (EX: velocity) the same problem appears again. I tried to update the mapper & rebuild the LUT after the array_name is changed, but doesnt solve the problem.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
okey, I discovered what it was needed. @state.change("scalars")
def set_scalars(scalars=mesh.active_scalars_name, **kwargs):
actor.mapper.array_name = scalars
mesh.set_active_scalars(scalars) ## Update at the mesh
actor.mapper.scalar_range = mesh.get_data_range(scalars)
print(scalars, mesh.get_data_range(scalars))
ctrl.view_update() |
Beta Was this translation helpful? Give feedback.
okey, I discovered what it was needed.
You also need to update the mesh: