Removing a decal

Trying out some character options using decals.
I have a small bit of code that is called with 2 parameters : partName is something like “shirt” and texFile is a filename for a decal file.

The code works fine - I call it referring to various decals I set up and it replaces the texture stage with the new one.

I’m probably missing something obvious, but how do I completely get rid of the texture stage with the decal on it? (If the user decides way to go back to “bare” i.e. no decal at all? (see my comment in the code below).

	def setCostume(self, texName, texFile):
		ts = self.model.findTextureStage(texName)
		if ts == None:
			ts = TextureStage(texName)

		if texFile == "bare":
			ts = None # how to completely remove this texture stage?
		else:
			tex = loader.loadTexture(texFile + '.png')
			ts.setMode(TextureStage.MDecal)
			self.model.setTexture(ts, tex)

If I understand the manual correctly (see below), you should be able to remove the decal by calling “self.model.clearTexture(ts)”.

See the end of this page, and this API reference page, I believe.

Thx, that did the trick and it’s working great now.
Missed that part of those pages! :slight_smile: