# Animation & actor-\>SetMapper

**URL:** https://discourse.vtk.org/t/animation-actor-setmapper/5704
**Category:** Support
**Created:** [May 4, 2021, 4:42pm UTC](https://discourse.vtk.org/t/animation-actor-setmapper/5704 "2021-05-04T16:42:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nparent](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nparent/32/3305_2.png) [@nparent](https://discourse.vtk.org/u/nparent)
#### Post date: [May 4, 2021, 4:42pm UTC](https://discourse.vtk.org/t/animation-actor-setmapper/5704/1 "2021-05-04T16:42:22Z")

</div>

Hi,

I would like to create animations in which I change the vtkMapper of the actor.

Basically, I have a curve (rod) that I want to animate.  
It is named yarn and it evolves in time by calling yarn-\>step() and then I can get yarn positions.  
So basically, I create polyData (with vtkPoints, vtkCells) from my positions and I apply a vtkTubeFilter to give it some volume. And I end with the associated mapper and actor. That is good to visualize one frame.  
Afterward, I would like the animation, I have tried both solutions [timer](https://kitware.github.io/vtk-examples/site/Cxx/Animation/RotatingSphere/#download-and-build-rotatingsphere) and [animationCue](https://kitware.github.io/vtk-examples/site/Cxx/Animation/AnimateActors/), in which I recreate the mapper from my (new) yarn datas and then do actor-\>SetMapper(mapper) but then frame stay frozen on the first actor.  
Note that in both cases, I have applied yarn-\>step() with  
timer solution : vtkTimerCallback2::Execute(), so vtkTimerCallback2 has the member yarn.  
AnimationCue : ActorAnimator::Tick(…), and there is also in ActorAnimator the member yarn.

In brief, I think I need a way to update my actor but don’t know how…

Many thanks to future helpers!

---

<div class="post-metadata">

### Author: ![nparent](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nparent/32/3305_2.png) [@nparent](https://discourse.vtk.org/u/nparent)
#### Post date: [May 6, 2021, 3:07pm UTC](https://discourse.vtk.org/t/animation-actor-setmapper/5704/2 "2021-05-06T15:07:08Z")

</div>

Little up for this question ! Nobody ?
