[Paraview] Scripting the opacity property of a Time Annotation filter

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon Jun 1 08:50:32 EDT 2009


There was a bug in the server manager configuration XML where no domain was
specified for the Opacity property. Domains are used by the animation engine
to change the property values. I've committed a fix for it in the CVS.
Please update and give it a try.

/cvsroot/ParaView3/ParaView3/Servers/ServerManager/Resources/rendering.xml,v
<--  Servers/ServerManager/Resources/rendering.xml
new revision: 1.351; previous revision: 1.350

Thanks
Utkarsh



On Sun, May 31, 2009 at 3:10 AM, Wim van der Meer
<wpjvandermeer at gmail.com>wrote:

> Hi all,
>
> Another animation script question. I am trying to create an animation
> movie with the fade-out of a Time Annotation filter using its opacity
> property. I have attached a short script that shows what I am trying
> to do. However , the script produces the following error:
>
> ERROR: In
> /tmp/Kitware/ParaView3/Servers/ServerManager/vtkSMRampKeyFrameProxy.cxx,
> line 53
> vtkSMRampKeyFrameProxy (0xb33c390): Cue does not have domain or property
> set!
>
> By the way, using the same method to animate the opacity of a Slice
> filter works without problems (thank you Utkarsh). Am I missing
> something?
>
> Here is the script, you need to create a Annotate Time filter in
> ParaView and then run this script from the built-in Python shell:
>
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
>
> # parameters
> fps = 24.0 # frames/seconds
> time = 6.0 #movie length in seconds
>
> # get the view and camera, create the movie
> view = servermanager.GetRenderView()
> camera = view.GetActiveCamera()
> camera.SetParallelProjection(True)
> camera.SetViewUp(0.0, 1.0, 0.0)
> movie = servermanager.animation.AnimationScene()
> movie.ViewModules = [view]
> movie.NumberOfFrames = fps * time
>
> # get the annotation and its representation
> pm = servermanager.ProxyManager()
> anntime = pm.GetProxy("sources", "AnnotateTime1")
> anntime_repr = None
> for rep in view.Representations:
>  if rep.Input[0].Proxy == anntime:
>    anntime_repr = rep
>    break
>
> # make sure the annotation is visible
> anntime_repr.Opacity = 1.0
> anntime_repr.Visibility = 1
> anntime_repr.Enabled = 1
>
> # fade out the annotation
> cue = servermanager.animation.KeyFrameAnimationCue()
> cue.StartTime = 0.0
> cue.EndTime = 1.0
>
> cue.AnimatedProxy = anntime_repr
> cue.AnimatedPropertyName = "Opacity"
>
> keyf0 = servermanager.animation.CompositeKeyFrame();
> keyf0.Type = 2 # Set keyframe interpolation type to Ramp.
> keyf0.KeyTime = 0.0
> keyf0.KeyValues= [1.0]
>
> keyf1 = servermanager.animation.CompositeKeyFrame()
> keyf1.KeyTime = 1.0
> keyf1.KeyValues = [0.0]
>
> cue.KeyFrames = [keyf0, keyf1]
>
> movie.AddCueProxy(cue)
>
> # Play the animation
> movie.Play()
>
>
> --
> Wim van der Meer
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090601/648e42ff/attachment.htm>


More information about the ParaView mailing list