[Paraview] Specifying camera movement using points from a file
Per Adamsen
padamsen at grundfos.com
Thu Apr 14 01:45:21 EDT 2016
Hi Cory,
Thanks for your feedback.
Of course this can be handled with a Python script - sometimes the answer is so obvious ;-)
I will follow your advice and let you know if I encounter any problems.
Regards,
Per
-----Original Message-----
From: Cory Quammen [mailto:cory.quammen at kitware.com]
Sent: 13. april 2016 16:03
To: Per Adamsen <padamsen at grundfos.com>
Cc: paraview at paraview.org
Subject: Re: [Paraview] Specifying camera movement using points from a file
Per,
You can do this with Python scripting in the Python console.
# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size # renderView1.ViewSize = [689, 340]
# get camera animation track for the view
cameraAnimationCue1 = GetCameraTrack(view=renderView1)
# create keyframes for this animation track # create a key frame
keyFrame4737 = CameraKeyFrame()
keyFrame4737.Position = [0.0, 0.0, 6.69] keyFrame4737.ParallelScale = 1.73
keyFrame4737.PositionPathPoints = [0.0, 0.0, 5.0, 2.938926261462365, 0.0, 4.045084971874736, 4.755282581475766, 0.0, 1.545084971874737, 4.755282581475766, 0.0, -1.5450849718747361, 2.938926261462365, 0.0, -4.045084971874735, 1.3322676295501878e-15, 0.0, -4.9999999999999964, -2.9389262614623624, 0.0, -4.045084971874735, -4.755282581475763, 0.0, -1.5450849718747368, -4.755282581475763, 0.0, 1.5450849718747341, -2.9389262614623632, 0.0, 4.045084971874731]
keyFrame4737.FocalPathPoints = [0.0, 0.0, 0.0] keyFrame4737.ClosedPositionPath = 1
# create a key frame
keyFrame4738 = CameraKeyFrame()
keyFrame4738.KeyTime = 1.0
keyFrame4738.Position = [0.0, 0.0, 6.69] keyFrame4738.ParallelScale = 1.73
# initialize the animation track
cameraAnimationCue1.Mode = 'Path-based'
cameraAnimationCue1.KeyFrames = [keyFrame4737, keyFrame4738]
# get animation scene
animationScene1 = GetAnimationScene()
animationScene1.Play()
Just modify the keyFrame4737.PositionPathPoints. They are ordered [x, y, z, x, y, z ...].
HTH,
Cory
On Wed, Apr 13, 2016 at 7:38 AM, Per Adamsen <padamsen at grundfos.com> wrote:
> Hi,
>
>
>
> I have been playing with the camera animations in PV5.0 and was
> wondering if there was an easier way to specify the camera path than
> manually adding and dragging points.
>
>
>
> Is it possible to copy paste camera coordinates from a file to obtain
> e.g. a helical path?
>
>
>
> Thank you in advance.
>
>
>
> Regards,
>
> Per
>
>
> _______________________________________________
> 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
>
--
Cory Quammen
R&D Engineer
Kitware, Inc.
More information about the ParaView
mailing list