vtkLookupTable Nan/Above/Below color with alpha value turns the whole scalar mapping translucent
I would like to map scalars, be able to hide cells with NaN, above or below range values. Then I would like to be able to change the opacity of the map.
I have an issue as soon as I tune the lookup table if I use either nan, above or below range colors.
pd.SetScalars(scalar_array) mapper.GetLookupTable().SetNanColor(0., 0., 0., 0.5) # or SetAboveRangeColor or SetBelowRangeColor with some alpha value
This will result in a translucent render even if all the values are valid and in the range of the lookup table.
See below for different attempts and results:
- Top-left: Do not tune the lookup table nan color
- Top-right: Tune the lookup table with alpha values for nan color
- Bottom-left: Using
actor.SetForceOpaque(True)in order to get correct results
- Bottom-right: Now I want to set the opacity of the map. Using
actor.GetProperty().SetOpacity(0.8)will not give ok results of course because the actor is treated as opaque
Here is a script that shows the issue. Lines 50-56 you can change the flags that I used for the screenshots. Thank you,