Remove node from loaded model

I’m trying to figure how to remove a node from a loaded model. I’m using the “ball-in-maze” sample, and wanted to remove the holes, for example. I changed the code from:

for i in range(6):
  trigger = self.maze.find("**/hole_collide" + str(i))
  trigger.node().setIntoCollideMask(BitMask32.bit(0))
  trigger.node().setName("loseTrigger")
  self.loseTriggers.append(trigger)

to:

for i in range(6):
  trigger = self.maze.find("**/hole_collide" + str(i))
  trigger.node().removeAllChildren();
  trigger.removeNode();

And the holes are still there. Also tried using the GeomNode removeAllGeoms call, no luck.
Suggestions?

The hole_collide# nodes in the .egg file are just collision meshes. Removing them won’t do anything but disable the collisions for that hole.

The actual holes are part of the geometry, I don’t think you could easily hide them. (Even if you could, you’d still leave a gap in the mesh unless you’d create new triangles to cover up the hole.)

I figured it would leave a knockout there, just trying to answer some “what-ifs” I’ve been given regarding changing a loaded model around.
So unless a given node or “thing” has been named in the mesh creation and then exported to a .egg file, it’s hard/impossible to just find & disable/hide/delete it?

Yeah, it needs to be a separate object. Otherwise you need to remove stuff on a vertex and triangle level, which is very hard to do.

There are ways to hide parts of a geom by using a texture with an alpha mask, though.