[Paraview] Moving slice animation

Adriano Gagliardi agagliardi at ara.co.uk
Wed Aug 18 10:42:06 EDT 2010


Utkarsh,

I made that change you suggested and it removed the error message. However,
when using the Origin as the AnimatedPropertyName, it was ignoring all but
the first value of the vector I used for the KeyValues e.g.:

keyf1.KeyValues = [0,0,0]
keyf2.KeyValues = [1,1,0]

It would only recognise the first component of the vector and animate along
that, which didn't do anything as you'd expect (apart from move the arrow
widget). I got round this by using Offset instead of Origin and that worked
as I expected. Code is below:

movie = servermanager.animation.AnimationScene()
movie.ViewModules = (GetActiveView())
cue = servermanager.animation.KeyFrameAnimationCue()
cue.AnimatedProxy = sl.SliceType
cue.AnimatedPropertyName = "Offset"
keyf1 = servermanager.animation.CompositeKeyFrame()
keyf1.Interpolation = "Ramp"
keyf1.KeyTime = 0
keyf1.KeyValues = [0,0,0]
keyf2 = servermanager.animation.CompositeKeyFrame()
keyf2.KeyTime = 1.0
keyf2.KeyValues = [0.5,0.5,0]
cue.KeyFrames = [keyf1,keyf2]
movie.NumberOfFrames = 20
movie.Cues = [cue]

movie_writer = servermanager.vtkSMAnimationSceneImageWriter()
movie_writer.SetFileName("temp.avi")
movie_writer.SetFrameRate(3)
movie_writer.SetQuality(2)
movie_writer.SetMagnification(2)
movie_writer.SetAnimationScene(movie.SMProxy)
movie_writer.Save()

Hopefully this can give others a helping hand in the future.

Cheers,

Adriano

===================================

Adriano Gagliardi MEng PhD
Business Sector Leader
Computational Aerodynamics
Aircraft Research Association Ltd.
Manton Lane
Bedford

Tel: 01234 32 4644
E-mail: agagliardi at ara.co.uk
Url: www.ara.co.uk 
-----Original Message-----
From: Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com] 
Sent: 18 August 2010 14:36
To: agagliardi at ara.co.uk
Cc: ParaView
Subject: Re: [Paraview] Moving slice animation

Try:

cue.AnimatedProxy = slice.SliceType
cue.AnimatedPropertyName = "Origin"

Utkarsh


On Wed, Aug 18, 2010 at 4:17 AM, Adriano Gagliardi <agagliardi at ara.co.uk>
wrote:
>
> Dear All,
>
> I've decided to revisit a problem that got me stuck a long time ago. 
> I'd like to animate a slice moving through a fluid, but I'm stuck on 
> the syntax for the cue.AnimatedPropertyName I need. I followed the 
> example from the Wiki as closely as possible. I only wish to animate 
> the y component of the origin, but since I can't pass that scalar as 
> an AnimatedPropertyName, I am defining the KeyValue as a vector 
> instead. Is this correct? Secondly, after I execute the following code, I
get this error message:
>
> ERROR: In
> /usr/people/gagliard/Paraview/FILES/ParaView3/Servers/ServerManager/vt
> kSMRam
> pKeyFrameProxy.cxx, line 53
> vtkSMRampKeyFrameProxy (0x10e34270): Cue does not have domain or 
> property set!
>
>>>> slice = GetActiveSource()
>>>> movie = servermanager.animation.AnimationScene()
>>>> movie.ViewModules = (GetActiveView()) cue = 
>>>> servermanager.animation.KeyFrameAnimationCue()
>>>> cue.AnimatedProxy = slice
>>>> cue.AnimatedPropertyName = "SliceType.Origin"
>>>> movie.Cues = [cue]
>>>> keyf1 = servermanager.animation.CompositeKeyFrame()
>>>> keyf1.Interpolation = "Ramp"
>>>> keyf1.KeyTime = 0
>>>> keyf1.KeyValues = [0,0.2,0]
>>>> keyf2 = servermanager.animation.CompositeKeyFrame()
>>>> keyf2.KeyTime = 1.0
>>>> keyf2.KeyValues = [0,0.4,0]
>>>> cue.KeyFrames = [keyf1,keyf2]
>>>> movie.Play()
>
> I'm pretty sure other people have this working, so it would be good to 
> have some pointers.
>
> Cheers,
>
> Adriano
>
> ===================================
>
> Adriano Gagliardi MEng PhD
> Business Sector Leader
> Computational Aerodynamics
> Aircraft Research Association Ltd.
> Manton Lane
> Bedford
>
> Tel: 01234 32 4644
> E-mail: agagliardi at ara.co.uk
> Url: www.ara.co.uk
>
>
> **********************************************************************
> This email contains information that is private and confidential and is
intended only for the addressee.
> If you are not the intended recipient please delete it and notify us
immediately by e-mailing the sender.
> Note: All email sent to or from this address may be accessed by 
> someone other than the recipient, for system management and security
reasons.
> Aircraft Research Association Ltd.  Registered in England, Registration No
503668 Registered Office:
> Manton Lane, Bedford MK41 7PF England VAT No GB 196351245
>
> **********************************************************************
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>


**********************************************************************
This email contains information that is private and confidential and is intended only for the addressee.
If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.
Note: All email sent to or from this address may be accessed by someone other than the recipient, for
system management and security reasons.
Aircraft Research Association Ltd.  Registered in England, Registration No 503668 Registered Office:
Manton Lane, Bedford MK41 7PF England VAT No GB 196351245

**********************************************************************


More information about the ParaView mailing list