Cleaning Out The TextureStages

Is there a way to clear all textures that where added to a model through the texture stage?

Thus returning the model to its original textured self, before the other textures where added in.

I’m going to be very unhappy with our furry four legged engine if it doesn’t have a quick function or method for dumping the added texture stages. :cry:

On the other hand, if our fluffy spotted Panda can do this, I just might let it have a crack or two at my GF. :laughing:

You could iterate over the texture stages on a node and remove the ones that are not TextureStage.getDefault().

Actually I found the cure! Yeeeaaaahhh!!! :laughing:

I dove into the Python API ref with a guess. And the guess was… Clearing the texture stage would have a name probably like “clearTexture.”

Guess what? I was RIGHT!!! “Whoot!!” :laughing:

Forgive me, but Panda’s Python API Ref is tough to read, so I consider it a win if I’m able to dig in there and get some useful function or method out; that’s why I’m “tickled pink” right now. :slight_smile:

I’m use to well written API explanations like this:

Function - getDir(arg1, arg2);

This function returns the direction of an object.  getDir takes two arguments.  Arg1 must be the object name (string value).  Arg2 is true or false (1 or 0).  getDir will return the opposite direction of facing if Arg2 is 1 (true).

“Ghod”, I still can’t believe I had the balls to go into the Python API Ref. 8)

That made my day. :laughing:

But I guess this means the Panda gets my GF… :blush:

I have a good idea about how to make sure resources are dumped and cleaned out when they are not needed for the game. I just remembered P3D has a third call besides, detachNode() and reparentTo(). That third call will free up resources, of course after all tasks are stopped and all references are severed.

What I need to know in order to go about doing this is… Does P3D have a function for truly restarting an application or will you the programmer have to “hard nose” code it? Because if it’s the latter, then resources really can’t be completely liquidated because you’ll need them again once you reset the game by resetting variables and recreating the first instances and so on; unless Panda “re-pulls” the data.

If P3D had a function for restarting the game and refreshing resources, which is the former, then completely dispatching resources the way I would like to would not be a problem.

First engine I’ve worked with that has no reset app, so this will be new to me.