# removing added texture from actor

**URL:** <https://discourse.vtk.org/t/removing-added-texture-from-actor/137>\
**Category:** Development\
**Created:** [January 25, 2019, 5:34pm UTC](https://discourse.vtk.org/t/removing-added-texture-from-actor/137 "2019-01-25T17:34:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pettaa123](https://discourse.vtk.org/user_avatar/discourse.vtk.org/pettaa123/32/218_2.png) [@pettaa123](https://discourse.vtk.org/u/pettaa123)\
**Post date:** [January 25, 2019, 5:34pm UTC](https://discourse.vtk.org/t/removing-added-texture-from-actor/137/1 "2019-01-25T17:34:30Z")

</div>

Hi there, i would like to remove a texture from an actor. I added the texture before, but dont know how to remove it then.  
cheers Peter

---

<div class="post-metadata">

**Author:** ![Michael](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael/32/16_2.png) [@Michael](https://discourse.vtk.org/u/Michael)\
**Post date:** [January 28, 2019, 9:28am UTC](https://discourse.vtk.org/t/removing-added-texture-from-actor/137/2 "2019-01-28T09:28:54Z")

</div>

Hi Peter,  
If you set your texture directly on vtkActor, using `SetTexture(nullptr)` will remove it.  
If you are adding a texture on vtkProperty (see vtkActor::GetProperty()), you will find the method `RemoveTexture`.  
Regards,  
Michael

---

<div class="post-metadata">

**Author:** ![pettaa123](https://discourse.vtk.org/user_avatar/discourse.vtk.org/pettaa123/32/218_2.png) [@pettaa123](https://discourse.vtk.org/u/pettaa123)\
**Post date:** [February 27, 2019, 8:10pm UTC](https://discourse.vtk.org/t/removing-added-texture-from-actor/137/3 "2019-02-27T20:10:23Z")

</div>

It worked, thanks. Additionaly I had to Dispose the Textureobject afterwards, otherwise i got null exception after some time using activiz.

If the textureobject would be used by another actor this procedure would be fatal? Can I reduce textureobjects referencecount instead by one before SetTexture(null), like this:  
int currentCount=actor.GetTexture.GetReferenceCount();  
actor.GetTexture.SetReferenceCount(currentCount-1);  
actor.SetTexture(null);

If I Dispose the actors textureobject before setting null, will the underlyinder imagedata also be deleted?
