Changes between Version 9 and Version 10 of Examples/ParaviewAnimating
- Timestamp:
- 06/14/18 17:12:23 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Examples/ParaviewAnimating
v9 v10 4 4 https://www.paraview.org/ParaView3/Doc/Nightly/www/py-doc/paraview.servermanager_proxies.html 5 5 6 On this page, we would like to share our own experience with you. DISCLAIMER: our knowle gde about all this is not complete and maybe incorrect. So believe everything found on this page on your own risk.6 On 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. 7 7 8 8 == 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.9 As 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. 10 10 11 11 [[Image(ParaView_AnimationView.jpg, margin=10)]]\\ 12 12 13 Unfortunately, !ParaView is not willing to include all interactivesettings 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.13 Unfortunately, !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. 14 14 15 15 == Basic Concept == … … 24 24 * paraview.simple.!TimeAnimationCue: cue to determine what data timesteps are loaded depending on the animation clock time 25 25 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 alsohave 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.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 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. 27 27 28 28 In the next paragraphs we are going to explain the basic mechanisms of the relevat Python classes and we give examples of typical use cases. … … 30 30 == !AnimationScene == 31 31 The !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:32 For 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: 33 33 * 'Sequence': the timesteps are defined by the property !NumberOfFrames 34 34 * '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. … … 136 136 137 137 == !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 connectedto 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.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 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. 139 139 Nevertheless 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. 140 140 141 141 === !TimeAnimationCue Use Cases === 142 142 Whatever 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 fromone single data timestep (100 in this example).143 This setup can be useful e.g. to generate an animated camera flight of one single data timestep (100 in this example). 144 144 {{{ 145 145 #!python … … 156 156 }}} 157 157 158 Reset the time 158 Reset the timetrack to use the AnimationScene clock time again: 159 159 {{{ 160 160 #!python … … 178 178 cameraTrack = GetCameraAnimationCue(view=renderView) 179 179 cameraTrack.Mode = 'Interpolate Camera' 180 To be continued 180 181 }}} 181 182