# Changing AnimationScene Playmode from a reader plugin?

**URL:** <https://discourse.vtk.org/t/changing-animationscene-playmode-from-a-reader-plugin/15806>\
**Category:** Development\
**Created:** [July 11, 2025, 2:35pm UTC](https://discourse.vtk.org/t/changing-animationscene-playmode-from-a-reader-plugin/15806 "2025-07-11T14:35:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manupio](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@Manupio](https://discourse.vtk.org/u/Manupio)\
**Post date:** [July 11, 2025, 2:35pm UTC](https://discourse.vtk.org/t/changing-animationscene-playmode-from-a-reader-plugin/15806/1 "2025-07-11T14:35:15Z")

</div>

I need to change the time step mode from within the C++ plugin of a reader. I can achieve the functionality I need with python, using this _python code_:

GetAnimationScene().PlayMode = ‘Snap To TimeSteps’

but I want it to trigger when a user clicks a button on the GUI part of the reader. Is this possible?

I’m flexible in how to get this working. In order of preference:

- Change play mode when user clicks “Refresh” button in reader GUI (Paraview)
- Change play mode when user clicks another button on a custom toolbar (i.e. can I create a custom button that runs my one-liner python code?)

It would be nice if I could access the AnimationScene / play mode from within the C++ plugin reader code.

Looking forward to your responses!

EDIT - added detail

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [July 11, 2025, 2:37pm UTC](https://discourse.vtk.org/t/changing-animationscene-playmode-from-a-reader-plugin/15806/2 "2025-07-11T14:37:22Z")

</div>

> [@Manupio](#):
>
> I want it to trigger when a user clicks a button on the GUI part of the reader. Is this possible?

It is possible to do from a (Qt) plugin, but not from reader UI.

---

<div class="post-metadata">

**Author:** ![Manupio](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@Manupio](https://discourse.vtk.org/u/Manupio)\
**Post date:** [July 11, 2025, 2:42pm UTC](https://discourse.vtk.org/t/changing-animationscene-playmode-from-a-reader-plugin/15806/3 "2025-07-11T14:42:20Z")

</div>

Thanks for the quick response! I assume I create a Qt plugin with a single button that triggers the functionality I want, either through python, i.e. the code I posted, or through C++, the Server layer that I can’t access from the reader? Do you know where I can find some examples or walkthrough of creating this?

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [July 11, 2025, 2:44pm UTC](https://discourse.vtk.org/t/changing-animationscene-playmode-from-a-reader-plugin/15806/4 "2025-07-11T14:44:13Z")

</div>

> [@Manupio](#):
>
> Do you know where I can find some examples or walkthrough of creating this?

[https://gitlab.kitware.com/paraview/paraview/-/tree/master/Examples/Plugins/GUIMyToolBar?ref\_type=heads](https://gitlab.kitware.com/paraview/paraview/-/tree/master/Examples/Plugins/GUIMyToolBar?ref_type=heads)

Wait, this is a question about ParaView right ? this is VTK discourse.

---

<div class="post-metadata">

**Author:** ![Manupio](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@Manupio](https://discourse.vtk.org/u/Manupio)\
**Post date:** [July 11, 2025, 2:53pm UTC](https://discourse.vtk.org/t/changing-animationscene-playmode-from-a-reader-plugin/15806/5 "2025-07-11T14:53:23Z")

</div>

You’re right! I’ve had dozens of questions about VTK, and the one problem that finally got me to create the account and post happened to be Paraview. I’m sorry. I’ll be on-topic next time. I really appreciate your help.
