Advanced Animations: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(New page: =Introduction= This tutorial deals with advanced topics in animations. ==The Animation View== *Open a data set. This example uses the training data disk_out_ref.exo, which can be downlo...)
 
No edit summary
 
(21 intermediate revisions by the same user not shown)
Line 4: Line 4:
==The Animation View==
==The Animation View==


*Open a data set.  This example uses the training data disk_out_ref.exo, which can be downloaded at http://www.paraview.org  
*Open the data set can.exo, which can be downloaded at http://www.paraview.org/paraview/resources/software.html
*On the Properties tab, select all variables and press the Apply button.
*On the Properties tab, select all variables and press the Apply button
*Drag the cylinder around with the left mouse button.
*Drag the can around with the left mouse button
*On the Display tab, select Color by V
*Move forward to timestep number 5
*From the menu, select View, then Animation View.  This will display the animation window on the GUI display.  On the picture below, the animation view is highlighted in blue.
*Color by DISPL
*(If you changed the order of the steps above, you may need to click "Rescale to Data Range"
*View Animation View


[[Image:advanced_animations_new_1.png|1000px]]


[[Image:advanced_animations_1.png|800px]]
* Grab the slider bar and move it back and forth.


==Real Time==


==Camera Animation==
*In the Animation View window, change the mode to Real Time, and the Duration to 100. 
*Play.  Notice that the can motion is now very slow.  We are saying that we want the whole animation to last 100 seconds. 
*Note - this can also be used to speed up datasets with a large number of time steps.  Set the Duration to 10, and ParaView will animate over all time in 10 seconds.  Obviously, this is dependent on the whether ParaView can keep up with this frame rate!


*Open your data set and select the Animation View as described above.
*In the Animation View window, select the Camera option in the pull down menu and click the Plus icon next to it.  This will add a time chart to the view which will allow you to manipulate the camera settings.


==Temporal Interpolator==
*In the Animation View window, change the mode to Sequence, and the No. Frames to 200. 
*Filters → Temporal → Temporal Interpolator.
*Play.  Notice that the can motion is now smooth.  ParaView is interpolating between frames, and making 200 time steps. 
**Note that this only works with data that stays consistent through the whole time sequence.  AMR (Adaptive Mesh Refinement) data does not work with the Temporal Interpolator.
==Move the camera==
There are four ways to move the camera.  they are:
*Orbit
*Follow Data
*Interpolate Camera Locations
*Follow Path
===Orbit Camera===
We are going to make the camera rotate around our data.
**'''Edit → Reset Session'''
**Open the data set can.exo. 
**Apply.
**'''+Y'''
**'''View → Animation View'''
**Add a camera.  Default motion is Orbit, so click the blue +.
**A '''Create Orbit''' dialog will appear.  Take the defaults, hit OK.
**Play.
===Camera Follow Data===
We are going to make the camera follow the data.
**'''Edit → Reset Session'''
**Open the data set can.exo. 
**Apply.
**'''+Y'''
**'''View → Animation View'''
**Add a camera.  Change '''Orbit''' to '''Follow Data'''.  Click the blue +.
**Play.


[[Image:advanced_animations_2.png|800px]]


*Double click on the time chart.  This will open an editing window for the cameraThere should be two entries in the tableThese indicate the starting and finishing times and positions of the camera.
Note that the follow data option will follow the data from whatever filter is highlighted.  This means that you can choose one cell, run the '''Extract Selection''' filter, and follow this cell.  Note that you must keep visibility on for this cellIf needed, you can turn the cell's Opacity (Properties tab) to 1%, making it disappearBy turning visibility on for your whole dataset, you can follow the cell but display all of your data.




[[Image:advanced_animations_3.png]]
===Interpolate Camera Position===
   
We are going to move the camera along a straight lineWe want to move the camera to follow the can.


*Click on the New buttonThis will add a keyframe between the start and the finish.   
**'''Edit → Reset Session'''
**Open the data set can.exo. 
**Apply.
**'''+Y'''
**'''View → Animation View'''
**Add a camera.  Change '''Orbit''' to '''Interpolate Camera Position'''.  Click the blue +.
**Left click on the white section of the camera row that just appeared.
**An '''Animation Keyframes''' dialog will open.   
**Left click the top '''Position'''.
**Use Current.  OK
**Play to the last timestep.  Move the can dataset back into the center of the screen.  '''Tip''' - Don't hit '''Reset'''.
**Left click the bottom '''Position'''.
**Use CurrentOK.
**OK


**Play.
[[Image:advanced_animations_4.png]]




*You may change the time value of this keyframe by double clicking on the time entry and manually changing the time.  This can be done for any of the keyframes.   
You can also create an intermediate destination for the can by going to the Animation Keyframes dialog, and selecting NewThen, follow the directions above.
*Let us change the camera value of the second entry.  Keeping this window open, go back to the data set and move the disk to a desired position.
Experiment by adding more keyframes and different camera angles.
*Next, return to the Editing Camera table and double click on the second entry under the Camera Values column.


One way to create tracks in 3d space is to use Interpolate Camera Location, and place the control points onto a plane.  Then, copy these control points, and then copy them into the 3d simulation you want to animate.


[[Image:advanced_animations_5.png]]


===Follow Path===
We are going to move the camera along a spline.  Advanced operation.


*Click on the Use Current buttonThis will set the camera values to the position that you manually moved the disk to. Alternatively, you may specify the values by populating the various fieldsPress OK. Press OK again to close the Animation Keyframes window.
**'''Edit → Reset Session'''
*Next, back at the Animation View, specify the ModeIf your dataset already has time steps built into the model you may want to select Snap to TimeStepsIf it does not you will have to select either Sequence, or Real TimeIf you select Real Time you may want to modify the Duration setting. Similarly, if you selected the Sequence mode you will want to modify the No. Frames setting.
**Open the data set can.exo.   
**Apply.
**'''+Y'''
**'''View → Animation View'''
**Add a camera.  Change '''Orbit''' to '''Follow Path'''.  Click the blue +.
**Left click on the white section of the camera row that just appeared.
**An '''Animation Keyframes''' dialog will open.   
**Left click on '''Path'''.
**Click on Camera Position.
**Now, in the 3d view, zoom outRotate the canYou will see a yellow circle with white spheresDrag the spheres around.
**OK.
**OK.


*Play.


[[Image:advanced_animations_6.png|800px]]
 


*Play the animation.
One way to create tracks in 3d space is to use Interpolate Camera Location, and place the control points onto a plane. Then, copy these control points, and then copy them into the 3d simulation you want to animate.
*Experiment by adding more keyframes and different camera angles.


==Temporal Interpolator==


*Open can.exo.
 
*Filters → Temporal → Temporal Interpolator.  Apply.
[[Image:advanced_animations_new_2.png|1000px]]
*On the Animation View, change Mode to Real Time.
 
*Change the Duration to 100.
 
*Click the Play button.
==Animating a Filter==
 
In the previous example we showed how to manipulate the camera using the Animation View tools.  In this example we will show how to animate a filter.  Our goal is to move a slice through our dataset over time. 
 
 
*Lets start from scratch.  One way is to go Edit/ Reset Session.  Ok. 
*If you closed it, bring up the Animation View.
*Open disk_out_ref.exo, all variables on, Apply.
*Slice filter.  Apply.  Turn off the '''Show Plane'''.
*In the '''Animation View''', change Mode to Sequence, and number of frames to 400.
*We want to create a track that is Slice, Slice Offset Values.  Click the blue '''+'''.
*Double click on the track.  This will bring up a dialog, and will set the start and end. 
*Change the starting value to '''-8''' and the ending value to '''8'''.
*'''Play'''.
 
[[Image:advanced_animations_new_10.png|1000px]]




[[Image:advanced_animations_7.png|800px]]
 
==Data Animation==
==Data Animation==


In the previous example we showed how to manipulate the camera using the Animation View tools, in this example we will show how to animate your data set.
In this example we will show how to animate your data set.  Our goal is to show one data set, then fade into another dataset.  This can be handy when one physics simulation runs for an early time period, and another physics simulation runs for the later time period.


*Open your data set and select the Animation View as described above.
*In our example we are using the data set disk_out_ref.exo.
**This data set does not contain any time steps so it cannot be immediately animated. 
**There are many ways to animate your data set.  One simple way is to apply a Warp Vector.
*From the Filters menu option select Common → Warp Vector.
*On the Properties tab, select a Scale Factor of 0.5.  Press Apply.


*Lets start from scratch.  One way is to go File/ Disconnect.  Ok. 
*If you closed it, bring up the Animation View.
*Open can.exo, all variables on, Apply.
*Open can.exo again, all variables on, Apply.
*Select the upper can.exo, and change to color by DISPL.  Last time step, Rescale to Data Range, first time step.
*Select the lower can.exo, and chage the representation to Wireframe.


[[Image:advanced_animations_8.png|800px]]
We now want to fade from the first version of the can to the second version of the can.  This is done as follows:
 
*On the Animation View, on the can.ex2 pulldown menu, select the upper can.ex2.  Right of there, use the pulldown menu to select Opacity.  Click the blue plus sign.
*Do the same for the lower can.ex2.
*Click on the upper can.ex2 white horizontal bar.  Double click on the upper value, change it to 1.  Double click the lower value, change it to 0.  OK.
*Play.


*In the Animation View window, select the WarpVector option in the pull down menu along with Scale Factor in the pull down menu to the right of it and click the  iconThis will add a time chart to the view which will allow you to manipulate the data set.
You can substitute Visibility for Opacity when you add tracks to the Animation View.  Then, on one dataset, you can run visibility of 1 for half of your time, and run visibility of 1 for the other dataset for the second half of your timeThus, you will show the first simulation for the first half of your animation, and the second simulation for the second half.
*Double click on the new created time chart.  It should be labeled WarpVector1 – Scale Factor.  This should open the Animation Keyframes window containing two keyframe entries indicating the first and last keyframes.
*Press the New button to create another keyframe.  By default ParaView adds the new keyframe with a time value in the middle of the two previous keyframesYou may modify that value to whatever you wish.  The Value column is the Scale Factor of the Warp Vector filter that we are animating on.  Try changing that value to 1.  Change the interpolation to Sinusoid.  Experiment changing the interpolation values and see what effects it has on the data set.  Press OK.  Press OK.


**Linearly (Ramp) interpolate from one key frame value to the next.
**When using Exponential interpolation, the key frame value will be interpolated from this key frame to the next one according to the specified exponential function. The Base, Start Power, and End Power must be specified; user interface controls for this appear when Exponential interpolation is chosen. The interpolation of the exponents is linear, so the interpolation from Base ^ Start Power to Base ^ End Power is exponential.
**The Sinusoidal interpolation type varies the value from this key frame to the next one according to the specified sine function. The Phase, Frequency, and Offset must be specified from the user interface controls that appear when Sinusoidal interpolation is selected.
**For Step interpolation, use the key frame value from the time this key frame takes effect until the time for the next key frame is reached. At that point, immediately use the next key frame value.


*Back at the Animation View window you will need to change the Mode to either Sequence or Real Time if you data set does not contain time steps.  You also may want to change the No. Frames or Duration depending on the mode you selected. 
==Warp Vector Filter==
*Play the animation.
*You may also combine multiple animations.  Try adding a camera animation to make the camera pan around the data set as the warp vector animation is running.


* If your dataset has displacement data, but it is not using a variable name that ParaView recognizes, you can still animate your data.  Choose the Filters/ Alphabetical/ Warp Vector filter.


==Saving Animations==
Once an animation has been created in ParaView, the animation may be saved as an AVI file or as a series of image files (JPEG, TIFF, or PNG), one image per animation frame. This functionality is available by choosing Save Animation from the File menu. When a movie file or series of images is saved, all of the views in the ParaView application window are captured. Additionally, the geometry per animation frame may be saved by selecting Save Geometry from the File menu. The data will be written out using ParaView's PVD file format.




=Acknowledgements=
=Acknowledgements=
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000.
Sandia National Laboratories is a multi-mission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC., a wholly owned subsidiary of Honeywell International, Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA-0003525.

Latest revision as of 00:41, 15 March 2019

Introduction

This tutorial deals with advanced topics in animations.

The Animation View

  • Open the data set can.exo, which can be downloaded at http://www.paraview.org/paraview/resources/software.html
  • On the Properties tab, select all variables and press the Apply button
  • Drag the can around with the left mouse button
  • Move forward to timestep number 5
  • Color by DISPL
  • (If you changed the order of the steps above, you may need to click "Rescale to Data Range"
  • View → Animation View

Advanced animations new 1.png

  • Grab the slider bar and move it back and forth.

Real Time

  • In the Animation View window, change the mode to Real Time, and the Duration to 100.
  • Play. Notice that the can motion is now very slow. We are saying that we want the whole animation to last 100 seconds.
  • Note - this can also be used to speed up datasets with a large number of time steps. Set the Duration to 10, and ParaView will animate over all time in 10 seconds. Obviously, this is dependent on the whether ParaView can keep up with this frame rate!


Temporal Interpolator

  • In the Animation View window, change the mode to Sequence, and the No. Frames to 200.
  • Filters → Temporal → Temporal Interpolator.
  • Play. Notice that the can motion is now smooth. ParaView is interpolating between frames, and making 200 time steps.
    • Note that this only works with data that stays consistent through the whole time sequence. AMR (Adaptive Mesh Refinement) data does not work with the Temporal Interpolator.


Move the camera

There are four ways to move the camera. they are:

  • Orbit
  • Follow Data
  • Interpolate Camera Locations
  • Follow Path


Orbit Camera

We are going to make the camera rotate around our data.

    • Edit → Reset Session
    • Open the data set can.exo.
    • Apply.
    • +Y
    • View → Animation View
    • Add a camera. Default motion is Orbit, so click the blue +.
    • A Create Orbit dialog will appear. Take the defaults, hit OK.
    • Play.


Camera Follow Data

We are going to make the camera follow the data.

    • Edit → Reset Session
    • Open the data set can.exo.
    • Apply.
    • +Y
    • View → Animation View
    • Add a camera. Change Orbit to Follow Data. Click the blue +.
    • Play.


Note that the follow data option will follow the data from whatever filter is highlighted. This means that you can choose one cell, run the Extract Selection filter, and follow this cell. Note that you must keep visibility on for this cell. If needed, you can turn the cell's Opacity (Properties tab) to 1%, making it disappear. By turning visibility on for your whole dataset, you can follow the cell but display all of your data.


Interpolate Camera Position

We are going to move the camera along a straight line. We want to move the camera to follow the can.

    • Edit → Reset Session
    • Open the data set can.exo.
    • Apply.
    • +Y
    • View → Animation View
    • Add a camera. Change Orbit to Interpolate Camera Position. Click the blue +.
    • Left click on the white section of the camera row that just appeared.
    • An Animation Keyframes dialog will open.
    • Left click the top Position.
    • Use Current. OK
    • Play to the last timestep. Move the can dataset back into the center of the screen. Tip - Don't hit Reset.
    • Left click the bottom Position.
    • Use Current. OK.
    • OK
    • Play.


You can also create an intermediate destination for the can by going to the Animation Keyframes dialog, and selecting New. Then, follow the directions above. Experiment by adding more keyframes and different camera angles.

One way to create tracks in 3d space is to use Interpolate Camera Location, and place the control points onto a plane. Then, copy these control points, and then copy them into the 3d simulation you want to animate.


Follow Path

We are going to move the camera along a spline. Advanced operation.

    • Edit → Reset Session
    • Open the data set can.exo.
    • Apply.
    • +Y
    • View → Animation View
    • Add a camera. Change Orbit to Follow Path. Click the blue +.
    • Left click on the white section of the camera row that just appeared.
    • An Animation Keyframes dialog will open.
    • Left click on Path.
    • Click on Camera Position.
    • Now, in the 3d view, zoom out. Rotate the can. You will see a yellow circle with white spheres. Drag the spheres around.
    • OK.
    • OK.
  • Play.


One way to create tracks in 3d space is to use Interpolate Camera Location, and place the control points onto a plane. Then, copy these control points, and then copy them into the 3d simulation you want to animate.


Advanced animations new 2.png


Animating a Filter

In the previous example we showed how to manipulate the camera using the Animation View tools. In this example we will show how to animate a filter. Our goal is to move a slice through our dataset over time.


  • Lets start from scratch. One way is to go Edit/ Reset Session. Ok.
  • If you closed it, bring up the Animation View.
  • Open disk_out_ref.exo, all variables on, Apply.
  • Slice filter. Apply. Turn off the Show Plane.
  • In the Animation View, change Mode to Sequence, and number of frames to 400.
  • We want to create a track that is Slice, Slice Offset Values. Click the blue +.
  • Double click on the track. This will bring up a dialog, and will set the start and end.
  • Change the starting value to -8 and the ending value to 8.
  • Play.

Advanced animations new 10.png


Data Animation

In this example we will show how to animate your data set. Our goal is to show one data set, then fade into another dataset. This can be handy when one physics simulation runs for an early time period, and another physics simulation runs for the later time period.


  • Lets start from scratch. One way is to go File/ Disconnect. Ok.
  • If you closed it, bring up the Animation View.
  • Open can.exo, all variables on, Apply.
  • Open can.exo again, all variables on, Apply.
  • Select the upper can.exo, and change to color by DISPL. Last time step, Rescale to Data Range, first time step.
  • Select the lower can.exo, and chage the representation to Wireframe.

We now want to fade from the first version of the can to the second version of the can. This is done as follows:

  • On the Animation View, on the can.ex2 pulldown menu, select the upper can.ex2. Right of there, use the pulldown menu to select Opacity. Click the blue plus sign.
  • Do the same for the lower can.ex2.
  • Click on the upper can.ex2 white horizontal bar. Double click on the upper value, change it to 1. Double click the lower value, change it to 0. OK.
  • Play.

You can substitute Visibility for Opacity when you add tracks to the Animation View. Then, on one dataset, you can run visibility of 1 for half of your time, and run visibility of 1 for the other dataset for the second half of your time. Thus, you will show the first simulation for the first half of your animation, and the second simulation for the second half.


Warp Vector Filter

  • If your dataset has displacement data, but it is not using a variable name that ParaView recognizes, you can still animate your data. Choose the Filters/ Alphabetical/ Warp Vector filter.


Acknowledgements

Sandia National Laboratories is a multi-mission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC., a wholly owned subsidiary of Honeywell International, Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA-0003525.