Changes between Version 9 and Version 10 of Examples/ParaviewAnimating


Ignore:
Timestamp:
06/14/18 17:12:23 (6 years ago)
Author:
Herwig Zilken
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Examples/ParaviewAnimating

    v9 v10  
    44https://www.paraview.org/ParaView3/Doc/Nightly/www/py-doc/paraview.servermanager_proxies.html
    55
    6 On this page, we would like to share our own experience with you. DISCLAIMER: our knowlegde about all this is not complete and maybe incorrect. So believe everything found on this page on your own risk.
     6On this page, we would like to share our own experience with you. DISCLAIMER: our knowledge about all this is limited and maybe even incorrect. So take all this with a grain of salt.
    77
    88== ParaView Gui: Animation View ==
    9 As usual, when you want to write a Python script for !ParaView from scratch, and have no idea where to start, it make sense to open the !ParaView GUI, start a Python trace, and prototype the desired setup in the GUI interactively. When you want to generate an animation, you have to deal with the Animation View, obviously.
     9As usual, when you want to write a Python script for !ParaView from scratch, and have no idea where to start, it makes sense to open the !ParaView GUI, start a Python trace, and prototype the desired setup in the GUI interactively. When you want to generate an animation, you have to deal with the Animation View, obviously.
    1010
    1111[[Image(ParaView_AnimationView.jpg, margin=10)]]\\
    1212
    13 Unfortunately, !ParaView is not willing to include all interactive settings in the trace. Some are just skipped, e.g. settings regarding the "TimeKeeper1 - Time" are NOT reflected in the trace. For this reason it makes sense to take a more closer look at the mechanisms and Python classes working behind the scene.
     13Unfortunately, !ParaView is not willing to show you all settings in the trace. Some are just skipped, e.g. settings regarding the "TimeKeeper1 - Time" are NOT reflected in the trace. For this reason it makes sense to take a more closer look at the mechanisms and Python classes working behind the scene.
    1414
    1515== Basic Concept ==
     
    2424* paraview.simple.!TimeAnimationCue: cue to determine what data timesteps are loaded depending on the animation clock time
    2525
    26 In general, each cue is connected to one or more properties of a ParaView object and has a number of keyframes attached to it, each defining certain values for a specific point in time. Therefore the key elements :) of a keyframe are keytime and keyvalues. The value(s) of the referred property is set to the keyvalues at the specified keytime. Some types of keyframes also have the ability to interpolate keyvalues from one keyframe to the next. Specifically these are paraview.simple.!CameraKeyFrame, paraview.simple.!CompositeKeyFrame, paraview.simple.!ExponentialKeyFrame, paraview.simple.!RampKeyFrame and paraview.simple.!SinusoidKeyFrame.
     26In general, each cue is connected to one or more properties of a ParaView object and has a number of keyframes attached to it, each defining certain values valid for a specific point in time. Therefore the key elements :) of a keyframe are keytime and keyvalues. The value(s) of the referred property is set to the keyvalues at the specified keytime. The most types of keyframes have the ability to interpolate keyvalues from one keyframe to the next. Specifically these are paraview.simple.!CameraKeyFrame, paraview.simple.!CompositeKeyFrame, paraview.simple.!ExponentialKeyFrame, paraview.simple.!RampKeyFrame and paraview.simple.!SinusoidKeyFrame.
    2727
    2828In the next paragraphs we are going to explain the basic mechanisms of the relevat Python classes and we give examples of typical use cases.
     
    3030== !AnimationScene ==
    3131The !AnimationScene is responsible to steer the animation clock time.
    32 For this purpose, the !AnimationScene has a !StartTime, an !EndTime, and a mechanism to determine the discrete points in time it will generate between !StartTime and !EndTime. These descrete timesteps are determined by the Mode (called !PlayMode in Python) of the !AnimationScene. Three different PlayModes are avilable:
     32For this purpose, the !AnimationScene has a !StartTime, an !EndTime, and a mechanism to calculate the discrete points in time between !StartTime and !EndTime. These descrete timesteps are determined by the Mode (called !PlayMode in Python) of the !AnimationScene. Three different PlayModes are avilable:
    3333* 'Sequence': the timesteps are defined by the property !NumberOfFrames
    3434* 'Snap To !TimeSteps': only useful if you have time dependent data. The descrete timesteps are determind by the timesteps of the data. The !AnimationScene has knowledge about the available data timesteps by the help of a seperate object, the !TimeKeeper.
     
    136136
    137137== !TimeAnimationCue ==
    138 This type of cue is very special somehow: while all other kind of cues are absolutely useless without attached keyframes, this one can fullfill a special task without any: it can directly hand over the animation clock time (coming from !AnimationScene) to the property of a connected object. The typical use case within !ParaView is as follows: the !AnimationScene sets the value of the !TimeAnimationCue directly to its clock time. The !TimeAnimationCue is connected to the Time property of the !TimeKeeper object, which in turn requests all data objects to load just this time step of the data. This way the clock time of the animation scene can be kept in sync with the data timsteps.
     138This type of cue is very special somehow: while all other kind of cues are absolutely useless without attached keyframes, this one can fullfill a special task without any: it can directly hand over the animation clock time (coming from !AnimationScene) to the property of a connected object. The typical use case within !ParaView is as follows: the !AnimationScene sets the value of the !TimeAnimationCue directly to its clock time. The !TimeAnimationCue passes this value to the Time property of the !TimeKeeper object, which in turn requests all data objects to load just this time step of the data. This way the clock time of the animation scene can be kept in sync with the data timsteps.
    139139Nevertheless you can override this behaviour by attaching keyframes to this cue and setting "!UseAnimationTime=0". This way you can control what data timesteps are loaded/rendered independent from the animation clock time.
    140140
    141141=== !TimeAnimationCue Use Cases ===
    142142Whatever the !AnimationScene clock time is, set the time of the timetrack to 100.
    143 This setup can be useful e.g. to generate an animated camera flight from one single data timestep (100 in this example).
     143This setup can be useful e.g. to generate an animated camera flight of one single data timestep (100 in this example).
    144144{{{
    145145#!python
     
    156156}}}
    157157
    158 Reset the time track to use the AnimationScene clock time again:
     158Reset the timetrack to use the AnimationScene clock time again:
    159159{{{
    160160#!python
     
    178178cameraTrack = GetCameraAnimationCue(view=renderView)
    179179cameraTrack.Mode = 'Interpolate Camera'
     180To be continued
    180181}}}
    181182