# Animation Across Given Axis

**URL:** <https://vapor.discourse.group/t/animation-across-given-axis/491>\
**Category:** Uncategorized\
**Created:** [July 9, 2026, 4:59pm UTC](https://vapor.discourse.group/t/animation-across-given-axis/491 "2026-07-09T16:59:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elijah](https://avatars.discourse-cdn.com/v4/letter/e/2bfe46/32.png) [@elijah](https://vapor.discourse.group/u/elijah)\
**Post date:** [July 9, 2026, 4:59pm UTC](https://vapor.discourse.group/t/animation-across-given-axis/491/1 "2026-07-09T16:59:14Z")

</div>

Hi!

I have a 3D dataset and am displaying it with a slice across the XY plane. I would like to create an animation of the slice iterating through the z-layers to display the range of values. I do not see a way to do this in the GUI. Is this possible in the GUI or the Python version?

---

<div class="post-metadata">

**Author:** ![pearse](https://yyz2.discourse-cdn.com/free1/user_avatar/vapor.discourse.group/pearse/32/177_2.png) [@pearse](https://vapor.discourse.group/u/pearse)\
**Post date:** [July 13, 2026, 4:44pm UTC](https://vapor.discourse.group/t/animation-across-given-axis/491/2 "2026-07-13T16:44:20Z")

</div>

Yep! [I’ve had to do this manually in the past before](https://youtu.be/e5DO-gq-5XE?si=Lb_vhmc-pCbTAvZI&t=40), but it’s much easier with the Python API.

Try the following with your own session file. Tweak the SetSliceOffset() increment according to the dimension you are scanning.

```auto
from vapor import session, renderer, dataset
from vapor.animation import Animation
import os

ses = session.Session()
ses.Load("/glade/work/pearse/translateSlice/translateSlice.vs3")

slice = ses.GetRenderer("Slice")

anim = Animation(ses)
video_framerate = 30
transitions = 30
initial_offset = slice.GetSliceOffset()

for i in range(0, transitions, 1): 
    slice.SetSliceOffset(initial_offset + 500*i)
    print("Offset " + str(slice.GetSliceOffset()))
    anim.CaptureFrame()

anim.SaveMP4("test.mp4")

```
