<div dir="ltr">The add actor should be done by the same VTK thread that is rendering.<div style>So only one thread can do that action.</div><div style>Moreover, you should call Update() on the mapper within each of your thread to reduce the work that will be done by the main vtk thread.</div>
<div style><br></div><div style>Hope that make sense,</div><div style><br></div><div style>Seb</div><div style><br></div><div style>PS: VTK is not thread safe, but I&#39;ve already done something similar to what you did without any issue.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 20, 2013 at 5:18 PM, Dženan Zukić <span dir="ltr">&lt;<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">I have a need to modify the scene from multiple threads.</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">

<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Each thread looks like:</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">{</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">


for (i=1 to 100)</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">create mesh_i;</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">convert it to vtkPolyData;</div>


<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">if exists actor delete it;</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">create actor with pd;</div>


<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">add actor to renderer;</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">update display;</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">


}</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">How best to accomplish this? I already tried <a href="http://www.vtk.org/pipermail/vtkusers/2004-April/073478.html" target="_blank">this</a> approach, but it does not work. It always crashes before returning from Render() method. Crashes are at random location in VTK rendering code.</div>


</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>