Close Panda3d

I have experienced a little problem today :slight_smile:

I’m trying to quit panda3d, while having python continue working.

i found a lot of stuff related to this in showbase, however currently it still blocks the mouse, and the sound continues running after i have called my functions.

the functions i call right now:

    base.enableMouse()
    
    # show mouse cursor
    wp = WindowProperties()
    wp.setCursorHidden(False)
    # does not exist panda 1.3.2 / but is reqired for osx-mouse movement
    try: wp.setMouseMode(WindowProperties.MRelative)
    except: pass
    base.win.requestProperties(wp)
    
    taskMgr.step()
    
    taskMgr.stop()
    
    base.disableAllAudio()
    
    base.closeWindow( base.win )
    
    base.userExit()
    
    base.shutdown()
    
    base.destroy()

any hints?

The audio thing is probably a bug in the OpenAL audio manager. I’m not sure I ever tested the shutdown code.

But is there a “official” command similar to directbase.DirectStart (something like directbase.DirectQuit?) to close everything?

Yup, sys.exit().

I’m pretty sure ShowBase has got its exitfunc registered in python’s atexit or something similar – so sys.exit should pretty much take care of everything.

EDIT: oh, I see you want to keep python running. That would be only possible if you’d destroy the taskmanager, to close down the run() call. Check ShowBase.py in the direct/src/showbase/ dir to see what things ShowBase initiates, and see what command shuts what down.