<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi, </div><div class=""><br class=""></div><div class="">Thank you very much for the help. Indeed, I am not used to oop and I was a confused in the <a href="https://www.vtk.org/Wiki/VTK/Examples/Python/Animation" class="">https://www.vtk.org/Wiki/VTK/Examples/Python/Animation</a> that the „actor“ was not defined in class vtkTimerCallback. </div><div class=""><br class=""></div><div class="">Best Andreas</div><div class=""><br class=""></div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">Am 14.11.2018 um 01:39 schrieb Andaharoo <<a href="mailto:Andx_roo@live.com" class="">Andx_roo@live.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">I rarely write python so I'm not the best help. This doesn't have much to do<br class="">with VTK this is just basic oop. I'd suggest reading/learning about it<br class="">online. Here's the absolute simplest solution.<br class=""><br class="">If you simply want to hold a reference to the VideoCapture object in the<br class="">class then create a variable of it in the class. I don't write python so<br class="">excuse my example but it should get the idea across. Ex:<br class=""><br class="">class vtkTimerCallback():<br class="">    cap = None # Create an empty reference to an object<br class="">    ... All the other stuff<br class=""><br class="">Then in the Python Animation example before starting the timer, right under<br class="">"cb.actor = actor" you can add "cb.cap = cap" to give vtkTimerCallback a<br class="">reference to the capture object. If you don't do this cb.cap will be None<br class="">and not work.<br class=""><br class="">Note: In python objects are passed by reference so "_cap" will be a<br class="">reference to "cap" after "=" operator. IE: It's the same object. NOT a copy.<br class="">Both "_cap" and "cap" point to the same data.<br class=""><br class="">Also I'd recommend using vtkImageActor which is both a mapper and actor that<br class="">directly takes vtkImageData for display on a 3d plane.<br class=""><br class=""><br class=""><br class="">--<br class="">Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" class="">http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html</a><br class="">_______________________________________________<br class="">Powered by <a href="http://www.kitware.com" class="">www.kitware.com</a><br class=""><br class="">Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class=""><br class="">Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" class="">http://www.vtk.org/Wiki/VTK_FAQ</a><br class=""><br class="">Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" class="">http://markmail.org/search/?q=vtkusers</a><br class=""><br class="">Follow this link to subscribe/unsubscribe:<br class=""><a href="https://public.kitware.com/mailman/listinfo/vtkusers" class="">https://public.kitware.com/mailman/listinfo/vtkusers</a><br class=""></div></div></blockquote></div><br class=""></body></html>