Can you switch the lines "WriteAnimation" and "CameraAnimationCue.KeyFrame
=...". The WrieAnimation should happen after that. Seems like a bug in the
tracing code. The tracing code is being revamped. Although animation has
been skipped in this revamp, it's on my todo list for subsequent release.

Utkarsh


On Wed, Jul 23, 2014 at 9:50 AM, Anton Shterenlikht <me...@bris.ac.uk>
wrote:

> I made an animation interactively in PV 4.1.0.
> I checked that the animation is fine with mplayer.
> I recorded my steps with Tools -> Start Trace.
> When I try to run the resulting python script
> with pvbatch I get this error:
>
> $ pvbatch --use-offscreen-rendering zpart1.py
> ERROR: In
> /wrkdirs/usr/ports/science/paraview/work/ParaView-v4.1.0/ParaViewCore/ServerManager/Default/vtkPVCameraCueManipulator.cxx,
> line 52
> vtkPVCameraCueManipulator (0x8353f8e60): Too few keyframes to animate.
>
> The python script:
>
>
> # user defined variables, no identation allowed, start at col 1
>
> infile  = "z.xdmf"  # name of XDMF file
> picfile = "z.png"   # image output file
> vidfile = "z.ogv"   # animation output file
> trlo    = -4        # lower threshold
> trhi    = 0         # upper threshold
>
> # end of user variables
>
> try: paraview.simple
> except: from paraview.simple import *
> paraview.simple._DisableFirstRenderCameraReset()
>
> # load XDMF file
> z_xdmf = XDMFReader( FileName=infile )
>
> AnimationScene1 = GetAnimationScene()
> AnimationScene1.EndTime = 10.0
> AnimationScene1.PlayMode = 'Snap To TimeSteps'
>
> z_xdmf.Sets = []
> z_xdmf.Grids = ['T0', 'T30', 'T60', 'T90', 'T120', 'T150', 'T180', 'T210',
> 'T240', 'T270', 'T300']
> z_xdmf.PointArrays = ['crack']
>
> RenderView1 = GetRenderView()
> RenderView1.CenterOfRotation = [127.5, 127.5, 95.5]
>
> DataRepresentation1 = Show()
> DataRepresentation1.EdgeColor = [0.0, 0.0, 0.5000076295109483]
> DataRepresentation1.Slice = 95
> DataRepresentation1.SelectionPointFieldDataArrayName = 'crack'
> DataRepresentation1.ScalarOpacityUnitDistance = 1.762150384296635
> DataRepresentation1.Representation = 'Outline'
> DataRepresentation1.ScaleFactor = 25.5
>
> RenderView1.CameraPosition = [127.5, 127.5, 883.8540784668097]
> RenderView1.CameraFocalPoint = [127.5, 127.5, 95.5]
> RenderView1.CameraClippingRange = [590.4255376821416, 1039.4068896438118]
> RenderView1.CameraParallelScale = 204.0410497914574
>
> Threshold1 = Threshold()
> Threshold1.Scalars = ['POINTS', 'crack']
> Threshold1.AllScalars = 0
> Threshold1.ThresholdRange = [ trlo, trhi ]
>
> DataRepresentation2 = Show()
> DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483]
> DataRepresentation2.SelectionPointFieldDataArrayName = 'crack'
> DataRepresentation2.ColorArrayName = ('POINT_DATA', 'crack')
> DataRepresentation2.ScalarOpacityUnitDistance = 1.88988157484231
> DataRepresentation2.ScaleFactor = 0.2
>
> a1_crack_PVLookupTable = GetLookupTableForArray( "crack", 1,
> RGBPoints=[-3.0, 0.23, 0.299, 0.754, 1073741822.0, 0.865, 0.865, 0.865,
> 2147483647.0, 0.706, 0.016, 0.15], VectorMode='Magnitude', NanColor=[0.25,
> 0.0, 0.0], ColorSpace='Diverging', ScalarRangeInitialized=1.0 )
>
> a1_crack_PiecewiseFunction = CreatePiecewiseFunction( Points=[-3.0, 0.0,
> 0.5, 0.0, 2147483647.0, 1.0, 0.5, 0.0] )
>
> DataRepresentation2.ScalarOpacityFunction = a1_crack_PiecewiseFunction
> DataRepresentation2.LookupTable = a1_crack_PVLookupTable
>
> a1_crack_PVLookupTable.NanColor = [1.0, 1.0, 0.0]
> a1_crack_PVLookupTable.RGBPoints = [-3.0, 1.0, 1.0, 1.0, 365072217.5, 0.0,
> 0.0, 1.0, 730144438.0, 0.0, 1.0, 1.0, 1073741822.0, 0.0, 1.0, 0.0,
> 1438814042.5, 1.0, 1.0, 0.0, 1803886263.0, 1.0, 0.0, 0.0, 2147483647.0,
> 0.878431, 0.0, 1.0]
> a1_crack_PVLookupTable.ScalarOpacityFunction = a1_crack_PiecewiseFunction
> a1_crack_PVLookupTable.ColorSpace = 'RGB'
>
> RenderView1.CameraPosition = [127.49999999999966, 127.5, 883.8540000000002]
> RenderView1.CameraClippingRange = [590.4254600000002, 1039.4068100000004]
>
> AnimationScene1.AnimationTime = 10.0
> AnimationScene1.NumberOfFrames = 100
> AnimationScene1.PlayMode = 'Sequence'
>
> CameraAnimationCue1 = GetCameraTrack()
> CameraAnimationCue1.AnimatedProxy = RenderView1
> CameraAnimationCue1.Mode = 'Path-based'
>
> TimeAnimationCue1 = GetTimeTrack()
> TimeAnimationCue1.Enabled = 0
>
> KeyFrame3658 = CameraKeyFrame( FocalPathPoints=[127.5, 127.5, 95.5],
> FocalPoint=[127.5, 127.5, 95.5], PositionPathPoints=[127.5, 127.5, 883.854,
> 740.1661272984488, 127.5, 591.6272475657036, 898.6265736288988, 127.5,
> -68.40801310294381, 485.4052264316708, 127.5, -606.9285573699966,
> -193.1524595153794, 127.5, -624.6972157143753, -633.9914888582924, 127.5,
> -108.54102948275286, -510.2917835834677, 127.5, 558.8828547857805],
> ClosedPositionPath=1, ParallelScale=204.0410497914574, Position=[127.5,
> 127.5, 883.8540784668097] )
>
> KeyFrame3659 = CameraKeyFrame( ParallelScale=204.0410497914574,
> Position=[127.5, 127.5, 883.8540784668097], KeyTime=1.0, FocalPoint=[127.5,
> 127.5, 95.5] )
>
> WriteAnimation( vidfile , Magnification=1, Quality=2, FrameRate=6.000000)
> CameraAnimationCue1.KeyFrames = [ KeyFrame3658, KeyFrame3659 ]
>
> Render()
>
>
> Please advise
>
> Many thanks
>
> Anton
>
> _______________________________________________
> 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://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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to