[vtkusers] Re-rendering the scene from an external callback function

Skotheim, Oystein oystein.skotheim at tecnalia.com
Mon Dec 17 10:55:10 EST 2012


Hello. I am working on a Python application where I want to display 3D meshes on top of live video images. I have currently implemented this by using a vtkImageActor (with the image) along with a normal vtkActor (with the 3D data). Perhaps this is not the correct way of doing it, but it seems to work fine.

The application is developed within the ROS framework, and I receive images by subscribing to image messages on a ROS topic. This means that every time a new image comes in, I have a ROS callback function that converts the incoming image data to vtkImageData format via the vtkImageImport class, and then I attempt to re-render the scene.

However, it seems like the Render() function does nothing when called from such a callback function. (I have tried to call Render() both on the vtkRenderWindowInteractor and on the vtkRenderWindow). When I run Render() from the interactive Python prompt, however, the scene is correctly re-rendered.

So my question is: How can I force the system to re-render the scene from an (external) callback function? Or how can I otherwise resolve this issue?

Best regards,
--
Øystein Skotheim
Senior Researcher

TECNALIA
Department of Robotics. Industry & Transport Division
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121217/93438754/attachment.htm>


More information about the vtkusers mailing list