Node name lost when using Collide Polyset

When I have a node () in a .egg with a name and with " { Polyset keep descend }", the node’s name is removed and instead applied to the generated CollisionNode. Here is a simple example demonstrating the issue:

minimalCollideTest.egg

<CoordinateSystem> { Z-up }

<Comment> { "Egg laid by Chicken for Blender, version R91" }

<Group> ThisIsMyNodeName {
  <Transform> {
    <Matrix4> {
      1.000000 0.000000 0.000000 0.000000
      0.000000 1.000000 0.000000 0.000000
      0.000000 0.000000 1.000000 0.000000
      0.000000 0.000000 -5.000000 1.000000
    }
  }
  <Collide> { Polyset keep descend }
  <VertexPool> Plane {
    <Vertex> 0 {
      1.0 0.999999940395 -5.0
    }
    <Vertex> 1 {
      -0.999999642372 1.00000035763 -5.0
    }
    <Vertex> 2 {
      -1.00000011921 -0.999999821186 -5.0
    }
    <Vertex> 3 {
      1.0 -1.0 -5.0
    }
  }
  <Polygon> {
    <Normal> { 0.000000 -0.000000 1.000000
    }
    <VertexRef> { 0 1 2 3 <Ref> { Plane } }
  }
}

nodeNameTest.py

import direct.directbase.DirectStart
from pandac.PandaModules import *
from direct.gui.OnscreenText import OnscreenText

level = loader.loadModel('minimalCollideTest.egg')
level.reparentTo(render)
level.ls()

Here’s the output generated by the above example:

DirectStart: Starting the game.
Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
ModelRoot minimalCollideTest.egg
  PandaNode 
    PandaNode  T:m(pos 0 0 -5)
      CollisionNode ThisIsMyNodeName (1 solids) (hidden)
      GeomNode  (1 geoms)

Is there any way to attach a name to the innermost PandaNode in the tree above, instead of having the name stolen by the CollisionNode?

As far as I know…The innermost PandaNode is due to this part of code:

<Transform> { 
    <Matrix4> { 
      1.000000 0.000000 0.000000 0.000000 
      0.000000 1.000000 0.000000 0.000000 
      0.000000 0.000000 1.000000 0.000000 
      0.000000 0.000000 -5.000000 1.000000 
    } 
  } 

if you don’t use the " { Polyset keep descend }" part, then the name will be for GeomNode.
By using it the name will be for CollisionNode and then PandaNode will get its strange name from the last line of the previous part of code

0.000000 0.000000 -5.000000 1.000000

where it gets its name from the first three values (it may represent a position of something)
By the way…I use Chicken R81 and it don’t give this whole part
I hope I could be helpfull for you

You are correct that the GeomNode gets the name when the Collide tag isn’t present. The PandaNode actually has no name, though… the T:m(pos 0 0 -5) is just added by NodePath.ls() to show the transform of the node.

Still, I’d like to know why the behavior changes when is added, and if there’s any way to name a node that contains both the CollisionNode and the GeomNode.

In general, if there’s a node that you want to keep specifically, you can put the { 1 } flag within the entry, and that will tell the egg loader to create a ModelNode for that node.

Otherwise it is free to optimize away nodes that it things are irrelevant.

David