Python: broken wxVTKRenderWindow and wxVTKRenderWindowInteractor
I'm trying to run the
wxVTKRenderWindowConeExample function from the file
vtkmodules.wx.wxVTKRenderWindow on ubuntu 20.04 and on windows 10.
The example is not working and it's just showing an empty window (black on linux, white on windows).
The same problem occurs with the example in wxVTKRenderWindowInteractor
Both wxWidgets and VTK alone are working properly. I run examples from both the software and they are working properly.
I also tried to took the code inside the function
wxVTKRenderWindowConeExample and commented everything a part from the definition of the window and of the class
import wx """Like it says, just a simple example. """ from vtkmodules.wx.wxVTKRenderWindow import wxVTKRenderWindow from vtkmodules.vtkFiltersSources import vtkConeSource from vtkmodules.vtkRenderingCore import vtkActor, vtkPolyDataMapper, vtkRenderer # every wx app needs an app app = wx.App(False) # create the widget frame = wx.Frame(None, -1, "wxVTKRenderWindow", size=(400, 400)) widget = wxVTKRenderWindow(frame, -1) #ren = vtkRenderer() #widget.GetRenderWindow().AddRenderer(ren) #cone = vtkConeSource() #cone.SetResolution(8) #coneMapper = vtkPolyDataMapper() #coneMapper.SetInputConnection(cone.GetOutputPort()) #coneActor = vtkActor() #coneActor.SetMapper(coneMapper) #ren.AddActor(coneActor) frame.Show() app.MainLoop()
Since the result is equal with the commented code and without the commented code I think that the problem is that the renderer is not rendering the actor.