AssertionError using DirectButton

Hi - I’m trying to create a DirectButton for a login screen. I want to use 4 separate images for the various button states, and I tried to follow the directions given in the Panda manual. I used egg-texture-cards to create an egg with all four images (.jpg’s) and then wrote the following code:

        # Add a button graphic to cover the cruddy popup marker
        maps = loader.loadModel('LoginListButton.egg')
        jobListButton = DirectButton(relief = None,
                                     geom = (maps.find('arrow_ready'),
                                     geom_scale = (geomScale, geomScale,
                                     frameSize = (0, w, -0.2, 0.9))

When I run my program, I receive the following error:

DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
Known pipe types:
(3 aux display modules not yet loaded.)
Assertion failed: !is_empty() at line 429 of panda/src/pgraph/nodePath.cxx
Traceback (most recent call last):
  File "", line 261, in ?
    interface = InterfaceTest()
  File "", line 54, in __init__
  File "", line 117, in initLoginScreen
  File "", line 234, in createLoginList
    frameSize = (0, w, -0.2, 0.9))
  File "C:\Panda3D-1.0.5\direct\src\gui\", line 61, in __init__
  File "C:\Panda3D-1.0.5\direct\src\gui\", line 236, in initialiseoptions
  File "C:\Panda3D-1.0.5\direct\src\gui\", line 118, in setGeom
    sort = GEOM_SORT_INDEX)
  File "C:\Panda3D-1.0.5\direct\src\gui\", line 556, in createcomponent
    widget = apply(widgetClass, widgetArgs, kw)
  File "C:\Panda3D-1.0.5\direct\src\gui\", line 49, in __init__
    self.assign(geom.copyTo(parent, self.sort))
  File "NodePath", line 12387, in copyTo
  File "NodePath", line 1260, in __overloaded_copyTo_ptrConstNodePath_ptrConstNodePath_int
AssertionError: !is_empty() at line 429 of panda/src/pgraph/nodePath.cxx

If I change the button’s ‘geom’ parameter to simply:

geom = maps,

then the buttons appear, but the textures constantly cycle through the 4 packaged in the egg.

Can anyone tell me what I’m doing wrong? Thanks for you help!

  • Ogel

When looking for geometry, use “**/” in your string to search down the hierarchy of nodes. like this:


The “**” is a wild card character that matches a sequence of zero or more nodes in the tree with any name.

Corrected the DirectButton section so it reflects this

I was searching this problem, and met up with this post, so instead of posting new, I thought I would ask here.

I followed the manual to a T

 egg-texture-cards -o button_maps.egg -p 240,240 button_ready.png button_click.png button_rollover.png button_disabled.png 

maps = loader.loadModel(‘button_maps.egg’)
b = DirectButton(geom = (maps.find(’/button_ready’),

… and got this error in the last 4 lines:


File “”, line 83, in start
self.button = DirectButton(geom = (maps.find(’**/button_ready’),
AttributeError: ‘NoneType’ object has no attribute ‘find’

In fact I tried using find before and always get the same message.
Can you please tell me what I am doing wrong? Thanks

OK. Dont bother. I started over fresh, and didn’t get an error. So I suppose there was some clash in code.