[vtkusers] wx python scripts segfault

David Gobbi david.gobbi at gmail.com
Sat Feb 27 19:10:53 EST 2010


On Sat, Feb 27, 2010 at 10:34 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
>
> Thanks for looking at this. You are right that wxVTKRenderWindow doesn't
> crash. You didn't say explicitly - did wxVTKRenderWindowInteractor crash on
> your system, too?

Yes, it does crash.

> Can you get the interactor from the widget as a vtkRenderWindowInteractor? I
> tried to do this:
> widget = wxVTKRenderWindow(frame, -1)
> style = vtk.vtkInteractorStyleTrackballActor()
> widget.GetRenderWindow().GetInteractor().SetInteractorStyle(style)
> but I get:
> widget.GetRenderWindow().GetInteractor().SetInteractorStyle(style)
> AttributeError: 'NoneType' object has no attribute 'SetInteractorStyle'
> I guess this means that GetInteractor() is returning the equivalent of NULL?
> If I can get this line to work then I'll be back in familiar VTK land and
> out of wx land...

The RenderWindow inside the wxVTKRenderWindow has no interactor.  That
is why you get None when you call GetInteractor().  As I said in my
previous email, all interaction in wxVTKRenderWindow is done with pure
python code.

If you need a vtkRenderWindowInteractor, then your best bet is to fix
whatever is wrong with wxVTKRenderWindowInteractor.

   David



More information about the vtkusers mailing list