Deactivate the reset of graphical properties

Dear support,

I am struggling with the management of the visualization properties in my script as the graphical properties get set to default or lose their value when changing the visibility. I am using the “visibility“ method to hide/show the filters and colorbars (i.e. UColorBar.Visibility = 1, cutplaneDisplay.Visibility = 0)

I set the following properties in the color transfer functions to display the variables:

U_CTF = GetColorTransferFunction(‘U’)
U_CTF.ApplyPreset(‘Rainbow Desaturated’, True)
U_CTF.RescaleTransferFunction(5,25)
U_CTF.RescaleOnVisibilityChange = 0

p_CTF = GetColorTransferFunction(‘p’)
p_CTF.ApplyPreset(‘Fast’, True)
p_CTF.RescaleTransferFunction(-100,100)
p_CTF.RescaleOnVisibilityChange = 0
Render()

And it works fine:

But then I hide them to manage other elements in the scene and when I display them, the velocity display is fine but the pressure contour has changed its range:

I have a similar issue with the cutplanes:

CPtotCTF = GetColorTransferFunction(‘CPtot’)
CPtotCTF.ApplyPreset(‘Rainbow Desaturated’, True)
CPtotCTF.NumberOfTableValues = 301 # Number of discrete colors
CPtotCTF.RescaleTransferFunction(0,0.95)
CPtotCTF.RescaleOnVisibilityChange = 0
CPtotCTF.EnableOpacityMapping = 1
CPtotOTF = GetOpacityTransferFunction(‘CPtot’)
CPtotOTF.Points = [
-1.0, 1.0, 0.5, 0.0,
0.95, 1.0, 0.5, 0.0,
0.95, 0.0, 0.5, 0.0,
1.0, 0.0, 0.5, 0.0
]

UnormCTF = GetColorTransferFunction(‘Unorm’)
UnormCTF.ApplyPreset(‘Fast’, True)
UnormCTF.RescaleTransferFunction(0,0.95)
UnormCTF.RescaleOnVisibilityChange = 0
UnormCTF.EnableOpacityMapping = 1
UnormOTF = GetOpacityTransferFunction(‘Unorm’)
UnormOTF.Points = [
-1.0, 0.95, 0.5, 0.0,
0.95, 0.95, 0.5, 0.0,
0.95, 0.0, 0.5, 0.0,
1.0, 0.0, 0.5, 0.0
]

It should look like this:

But it looks like this after hidind and showing it:

The quick solution is to set everytime the graphical display of these filters at the display time but it leads to a messy code as I like to create all the filters at the beginnig, set the right display properties and then manage the visibility later on.

Is there any way to completely disable the update/reset of graphical properties of filters/color bars? I am using ParaView 6.0 but this occurs too in Paraview 5.13.2.

Thank you in advance for your time!