You need to call vtkRenderWindow::Render after each change to force a render before the animation continues... Otherwise, there will just be a pending paint message waiting to be processed when your animation is over and you are again allowing the message loop to process paint messages.<div>
<br></div><div>Call vtkRenderWindow::Render, not vtkRenderer::Render...</div><div><br></div><div>HTH,</div><div>David</div><div><br><br><div class="gmail_quote">On Tue, Dec 2, 2008 at 11:10 AM, Gerrick Bivins <span dir="ltr">&lt;<a href="mailto:gbivins@objectreservoir.com">gbivins@objectreservoir.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 lang="EN-US" link="blue" vlink="purple">

<div>

<p><span style="font-size:11.0pt;color:#1F497D">Hi David,</span></p>

<p><span style="font-size:11.0pt;color:#1F497D">I've tried calling Render via vtkPlaybackRepresenation::GetRenderer()-&gt;Render()
but that had no effect.</span></p>

<p><span style="font-size:11.0pt;color:#1F497D">&nbsp;</span></p>

<p><span style="font-size:11.0pt;color:#1F497D">I've subclassed vtkPlaybackRepresentation and overridden Play
as follows:</span></p>

<p><span style="font-size:11.0pt;color:#1F497D">&nbsp;</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">&nbsp;&nbsp;&nbsp;&nbsp; virtual</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> <span style="color:blue">void</span>
Play()</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; &nbsp;&nbsp;&nbsp;{</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; _playing = <span style="color:blue">true</span>;</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <span style="color:green">//this-&gt;_playThread.join();</span></span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <span style="color:blue">this</span>-&gt;PlayThread();</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; </span></p>

<p><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;
&nbsp;&nbsp;&nbsp;}</span></p>

<p><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;</span></p>

<p><span style="font-size:11.0pt;color:#1F497D">With PlayThread() as follows (which I'd like eventually move
functionality into a thread so I can pause it):</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> PlayThread()</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <span style="color:blue">while</span>(_currentFrame &lt; NumberOfFrames &amp;&amp;
_playing)</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; {</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<span style="color:green">//this-&gt;_pbw-&gt;InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);</span></span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
std::cout&lt;&lt;_currentFrame&lt;&lt;std::endl;</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<span style="color:blue">this</span>-&gt;UpdateCurrentFrame(1);</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<span style="color:blue">this</span>-&gt;GetRenderer()-&gt;Render();</span></p>

<p style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }</span></p>

<p><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><span style="font-size:11.0pt;color:#1F497D"></span></p>

<p><span style="font-size:11.0pt;color:#1F497D">&nbsp;</span></p>

<p><span style="font-size:11.0pt;color:#1F497D">UpdateCurrentFrame calculates the next frame depending on
direction and triggers the pipeline update.</span></p>

<p><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;</span></p>

<p><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">Gerrick</span><span style="font-size:11.0pt;color:#1F497D"></span></p>

<p><span style="font-size:11.0pt;color:#1F497D">&nbsp;</span></p>

<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">

<p><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> David Cole
[mailto:<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>] <br>
<b>Sent:</b> Tuesday, December 02, 2008 9:48 AM<br>
<b>To:</b> Gerrick Bivins<br>
<b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Subject:</b> Re: [vtkusers] vtkPlaybackWidget doesn&#39;t &quot;play&quot;</span></p>

</div><div><div></div><div class="Wj3C7c">

<p>&nbsp;</p>

<p>Are you calling Render from your play callback after each
step of the animation...?</p>

<div>

<p style="margin-bottom:12.0pt">&nbsp;</p>

<div>

<p>On Tue, Dec 2, 2008 at 10:33 AM, Gerrick Bivins &lt;<a href="mailto:gbivins@objectreservoir.com" target="_blank">gbivins@objectreservoir.com</a>&gt;
wrote:</p>

<p><br>
Hello,<br>
I&#39;m trying to use the vtkPlaybackWidget to control an animation sequence.<br>
All the actions work as expected except for the &quot;play&quot; button.
&nbsp;I&#39;ve<br>
overridden the Play callback function to loop over my animation and update<br>
for each step but the render window is only updated at the end of sequence.<br>
Using the &quot;Forward&quot; and &quot;Backward&quot; step buttons work as
expected. Does<br>
anyone have any suggestions on how to get the render to update using the<br>
&quot;Play&quot; button?<br>
Thanks in advance,<br>
Gerrick<br>
--<br>
View this message in context: <a href="http://www.nabble.com/vtkPlaybackWidget-doesn%27t-%22play%22-tp20794191p20794191.html" target="_blank">http://www.nabble.com/vtkPlaybackWidget-doesn%27t-%22play%22-tp20794191p20794191.html</a><br>

Sent from the VTK - Users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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></p>

</div>

<p>&nbsp;</p>

</div>

</div></div></div>

</div>


</blockquote></div><br></div>