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)