<div dir="ltr">Can you remove <br><br>ren.AddActor( self.ia )<br><br>from the class and add it after adding the renderer?<br><br>Jothy<br><br><div class="gmail_quote">On Sat, Feb 11, 2012 at 9:07 AM, Anders Wallin <span dir="ltr">&lt;<a href="mailto:anders.e.e.wallin@gmail.com">anders.e.e.wallin@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">Here is a more realistic example of what I want to do:<br>
<a href="http://pastebin.com/3Wz8C8yC" target="_blank">http://pastebin.com/3Wz8C8yC</a><br>
<br>
Now I see different behavior between:<br>
<br>
myim = MyImage(ren)  # create vtkImageActor, add it to ren<br>
renWin.Render()         # when Render() is called here, we don&#39;t see<br>
the results of modify()<br>
myim.modify()            # this modifies the vtkCharArray of the image<br>
renWin.Render()<br>
<br>
and<br>
<br>
myim = MyImage(ren)  # create vtkImageActor, add it to ren<br>
# without Render() here , the results of modify() are visible<br>
myim.modify()            # this modifies the vtkCharArray of the image<br>
renWin.Render()   # now we see a modified image!<br>
<br>
<br>
Confused.<br>
<font color="#888888">Anders<br>
</font><div><div></div><div class="h5"><br>
On Fri, Feb 10, 2012 at 11:01 PM, David Doria &lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; It turns out there is some subtle difference between<br>
&gt;&gt; vtkRenderer.Render() and vtkRenderWindow.Render()<br>
&gt;&gt;<br>
&gt;&gt; This example shows the behavior:<br>
&gt;&gt; <a href="http://pastebin.com/KPFpkCKU" target="_blank">http://pastebin.com/KPFpkCKU</a><br>
&gt;&gt; On my machine I see an unmodified image with &quot;renWin.Render()&quot; and a<br>
&gt;&gt; modified image with &quot;ren.Render()&quot;<br>
&gt;&gt; I had previously used renWin.Render() in all my vtk code, but I have<br>
&gt;&gt; always worked with polydata only.<br>
&gt;<br>
&gt;<br>
&gt; Quoting David Gobbi from an old mailing list post that I&#39;ve used ever since:<br>
&gt;<br>
&gt; &quot;You should never, ever call renderer-&gt;Render().  That method is only<br>
&gt; meant to be called by the vtkRenderWindow.  The documentation says<br>
&gt; so quite clearly.  By calling it you are probably causing some timestamps<br>
&gt; to be set (indicating that all actors in the renderer have rendered), but<br>
&gt; you<br>
&gt; aren&#39;t actually doing any rendering.  Then, when you call<br>
&gt; renderWindow-&gt;Render() it sees that those timestamps have been updated<br>
&gt; and thinks that there is nothing to be done.&quot;<br>
&gt;<br>
&gt; I&#39;m not sure why renderWindow-&gt;Render() is not working for you in this case.<br>
&gt; Any Python VTK experts out there?<br>
</div></div><div><div></div><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>