<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">hi, thanks alot for the fast reply.
DATA_TIME_STEP was the variable that i was looking for.<br>
here is my "Programmable Filter Script" that is able to translate
an object into a given direction depending on the actual timestep.<br>
<br>
### paraview programmable filter script for translation of object
depending on timestep<br>
<meta name="qrichtext" content="1">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><!--StartFragment-->from
vtk import vtkDataObject</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">from
paraview.vtk import dataset_adapter as DA</p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px;"><br>
</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">speed =
[0.0004, 0.000, 0.000]</p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px;"><br>
</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"># define
input and output </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">pdi =
self.GetInputDataObject(0,0)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">pdo =
self.GetOutputDataObject(0)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">pdo.CopyAttributes(pdi)</p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px;"><br>
</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"># get
current time-step </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">step =
pdi.GetInformation().Get(vtkDataObject.DATA_TIME_STEP())</p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px;"><br>
</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"># move
object</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">old_pts
= inputs[0].Points</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">new_pts
= old_pts</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">for i in
range(3):</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">
new_pts[:,i] = old_pts[:,i] + step * speed[i]</p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px;"><br>
</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">arr =
DA.numpyTovtkDataArray(new_pts, 'newpts')</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">pdo.GetPoints().SetData(arr)</p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px;"><br>
<!--EndFragment--></p>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style><br>
greetings<br>
FloB<br>
<br>
<br>
<br>
On 09/16/2014 02:41 PM, Utkarsh Ayachit wrote:<br>
</div>
<blockquote
cite="mid:CADHSJjCg5PLZD-PcPbKrO8u3NrS3f8SWMbP_2V0JZhkyD9ui9g@mail.gmail.com"
type="cite">
<pre wrap="">I'd suggest using "Programmable Filter" instead of "Python
Calculator". Refer to vtkTimeToTexConvertor::RequestData() [1] for how
to access DATA_TIME_STEP value. You can write an equivalent script in
"Script" part for the Programmable Filter to access the time value.
Utkarsh
[1] <a class="moz-txt-link-freetext" href="https://github.com/Kitware/ParaView/blob/ad70367102a1d9779435e9949d84a576e68a6ee8/ParaViewCore/VTKExtensions/Default/vtkTimeToTextConvertor.cxx">https://github.com/Kitware/ParaView/blob/ad70367102a1d9779435e9949d84a576e68a6ee8/ParaViewCore/VTKExtensions/Default/vtkTimeToTextConvertor.cxx</a>
On Tue, Sep 16, 2014 at 6:33 AM, Florian Bruckner <a class="moz-txt-link-rfc2396E" href="mailto:e0425375@gmail.com"><e0425375@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">hello,
i would like to create an animation of moving objects using the animation
view. unfortunately the positions of the objects stored within the data file
are stationary, so i have to manually define the movement anyhow.
is there a simple method to archive this using the animation inspector? (i
am using paraview 4.1.0)
alternatively i found a method to use the python calculator to translate the
object. if i could access the actual time it would be possible to define the
trajectory of the moving particle. is this possible?
thanks
FloB
_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the ParaView Wiki at:
<a class="moz-txt-link-freetext" href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://public.kitware.com/mailman/listinfo/paraview">http://public.kitware.com/mailman/listinfo/paraview</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
</body>
</html>