What happened to base.camera? The only thing I did was add the line
window-type none
to the Config.prc file and call base.openMainWindow()
What happened to base.camera? 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, base.camera 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 base.camera; then when you eventually open the window, ShowBase will use that node.
David
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 defertest.py with the text
print 'IMPORTING!'
import direct.directbase.DirectStart
print 'OPENING!'
base.openMainWindow()
print 'RUNNING!'
run()
I opened a command line window at the directory that has defertest.py in it. I typed the command
ppython defertest.py
The output was
IMPORTING!
DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
OPENING!
Known pipe types:
wglGraphicsPipe
(3 aux display modules not yet loaded.)
RUNNING!
: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’!
David