filter out run() in p3d file

This commit is contained in:
David Rose 2009-07-22 07:33:52 +00:00
parent 197a3bb210
commit e7a5487ea1
2 changed files with 8 additions and 5 deletions

View File

@ -2477,7 +2477,14 @@ class ShowBase(DirectObject.DirectObject):
self.startDirect(fWantDirect = fDirect, fWantTk = fTk, fWantWx = fWx)
def run(self):
self.taskMgr.run()
# This method only does anything when self.appRunner is None,
# which is to say, when we are not running from within a p3d
# file. When we *are* within a p3d file, the Panda runtime
# has to be responsible for running the main loop, so we can't
# allow the application to do it. This is a minor hack, but
# should work for 99% of the cases.
if self.appRunner is None:
self.taskMgr.run()
# A class to encapsulate information necessary for multiwindow support.

View File

@ -29,10 +29,6 @@ Options:
(this is preferable to having the module start itself immediately
upon importing).
Note that your main.py must *not* call run(). This call should
not be part of the p3d file--the Panda3D runtime must be free to
call it, not your code!
-c [py,pyc,pyo]
Specifies the compilation mode of python files. 'py' means to