# Problem updating 3D scene when data changes

**URL:** https://discourse.vtk.org/t/problem-updating-3d-scene-when-data-changes/8672
**Category:** Support
**Created:** [June 6, 2022, 10:21pm UTC](https://discourse.vtk.org/t/problem-updating-3d-scene-when-data-changes/8672 "2022-06-06T22:21:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![whereismymoney](https://discourse.vtk.org/user_avatar/discourse.vtk.org/whereismymoney/32/6859_2.png) [@whereismymoney](https://discourse.vtk.org/u/whereismymoney)
#### Post date: [June 6, 2022, 10:21pm UTC](https://discourse.vtk.org/t/problem-updating-3d-scene-when-data-changes/8672/1 "2022-06-06T22:21:37Z")

</div>

Hello we are migrating from VTK 6.0.0 to VTK 8.2.0, and encountering some problems.  
We have found that some problems can be fixed like this:  
renderer-\>RemoveActor(act);  
act-\>GetMapper()-\>Update();  
renderer-\>AddActor(act);  
It seems like the wrong way to go to remove the actor and then later add it back. I have tried alternatives such as  
renderer-\>Modified();  
act-\>GetMapper()-\>GetInput()-\>Modified();  
but they don’t work. Any help would be greatly appreciated.  
Thanks

---

<div class="post-metadata">

### Author: ![mau\_igna\_06](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mau_igna_06/32/8064_2.png) [@mau\_igna\_06](https://discourse.vtk.org/u/mau_igna_06)
#### Post date: [June 7, 2022, 9:52am UTC](https://discourse.vtk.org/t/problem-updating-3d-scene-when-data-changes/8672/2 "2022-06-07T09:52:08Z")

</div>

Try to check how Slicer did the posts in the past by looking at the commit history

---

<div class="post-metadata">

### Author: ![whereismymoney](https://discourse.vtk.org/user_avatar/discourse.vtk.org/whereismymoney/32/6859_2.png) [@whereismymoney](https://discourse.vtk.org/u/whereismymoney)
#### Post date: [June 8, 2022, 9:33pm UTC](https://discourse.vtk.org/t/problem-updating-3d-scene-when-data-changes/8672/3 "2022-06-08T21:33:21Z")

</div>

Thank you for the response. I will study that.  
Are there any VTK diagnostics available to help understand why renderer-\>RemoveActor(act) and then renderer-\>AddActor(act) are necessary for this fix to work? Presumably these two lines of code change something about the renderer and/or the actor. (I should mention we are using Qt 5.12.10)
