[vtkusers] Cannot disable vtkPolyDataMapper2D scalar visibility using VTK OpenGL2 backend
lasso at queensu.ca
Mon Jul 9 12:33:35 EDT 2018
I try to render a polydata with a plain solid color using a 2D actor. However, it seems that with OpenGL2 rendering backend, if a polydata has scalars and rendered once with scalar visibility enabled, ScalarVisibility cannot be disabled anymore. The actor will always appear as colored. In some cases, the colors randomly flicker. See a very simple code snippet below to reproduce it.
The same code works well (scalar visibility can be enabled/disabled) using VTK OpenGL1 backend. If I use 3D mapper and actor (vtkPolyDataMapper and vtk.vtkActor) then it works well using both VTK OpenGL1 and OpenGL2 backends.
Is this a known issue? Could somebody have a look?
reader = vtk.vtkXMLPolyDataReader()
mapper = vtk.vtkPolyDataMapper2D()
actor = vtk.vtkActor2D()
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
# actor appears in color here => OK
# actor appears in color here => ERROR (it should be white)
Download link for scalartest.vtp sample data set (any other polydata with scalars should work):
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers