camera mysteriously disappears

What happened to The only thing I did was add the line

window-type none

to the Config.prc file and call base.openMainWindow()

With window-type none, it doesn’t open a window or a buffer at all. Since it doesn’t open a window, it can’t create a camera. You’ll have a camera as soon as you call base.openMainWindow().

Of course, isn’t actually a camera, it’s just a node that the camera is parented to. Arguably, it could create this node before it actually needs a camera. Or, for that matter, you could create your own empty node, and assign it to; then when you eventually open the window, ShowBase will use that node.


Something is still wrong.

To the end of Config.prc I added:

# Don't open main window on directstart import

window-type none

I created a file with the text

print 'IMPORTING!'
import direct.directbase.DirectStart
print 'OPENING!'
print 'RUNNING!'

I opened a command line window at the directory that has in it. I typed the command


The output was

DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
Known pipe types:
(3 aux display modules not yet loaded.)
:util(warning): Adjusting global clock's real time by -0.260938 seconds.

But it never opened the main window!

Ah, sorry. You will have to include the parameter (type = ‘onscreen’) when calling base.openMainWindow(). Otherwise the window type will still be ‘none’!