[Paraview] PV 4.1.0 programmimg the camera position using python

Dan Lipsa dan.lipsa at kitware.com
Tue May 26 11:50:01 EDT 2015


Stephen,
Here is another cool feature added recently (thanks Utkarsh for the tip)
that allows one to add a custom Python animation to time-dependent data:
Open the animation view:

View > Animation View
Next to the + sign, choose Python and then click +
Double-click on the timeline to the right of Pyton.

You'll get a skeleton script that you can fill in. Here is a sample script
that just moves the
camera closer and father from the data.

from paraview.simple import *

from math import *


def start_cue(self):

    self.camera = GetActiveView().GetActiveCamera()

    self.start = 0

    pass


def tick(self):

    self.camera.Dolly(1 + sin(self.start * pi / 6) / 2)

    self.start = self.start + 1

    pass


def end_cue(self): pass




On Sun, May 24, 2015 at 5:27 PM, Christopher Snyder <22csnyder at gmail.com>
wrote:

> Steven,
>
> Not sure if your question has been answered. Why not try turning on the
> trace (tools>trace) then moving the camera, then turning off the trace? I
> think that'll get you want you want and is a generally helpful technique.
>
> -Chris
>
> On Fri, May 22, 2015 at 12:40 PM, Dan Lipsa <dan.lipsa at kitware.com> wrote:
>
>> Stephen,
>>
>> See ParaView User Guide section 4.4.3, section Interactions.
>>
>> Dan
>>
>>
>> On Fri, May 22, 2015 at 12:06 PM, Stephen Wornom <stephen.wornom at inria.fr
>> > wrote:
>>
>>> Are there some examples available showing how to programming the camera
>>> position using python?
>>> The position would be a function (x,y,z,t).
>>> Hope my question is clear.
>>> Stephen
>>>
>>> --
>>> stephen.wornom at inria.fr
>>> 2004 route des lucioles - BP93
>>> Sophia Antipolis
>>> 06902 CEDEX
>>>
>>> Tel: 04 92 38 50 54
>>> Fax: 04 97 15 53 51
>>>
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the ParaView Wiki at:
>>> http://paraview.org/Wiki/ParaView
>>>
>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/paraview
>>>
>>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/paraview
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150526/143e34c1/attachment.html>


More information about the ParaView mailing list