removing added texture from actor

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

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

1 Like

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?