Post by Stefán Freyr on Mar 26, 2009 5:20:40 GMT -5
Hi.
I realize this is a bit late but maybe someone can make use of this anyway.
I came across a really cool package that is making testing much more pleasant for me. It's an integrated Python interpreter console that you can include in your application. This enables you to manipulate your world in real-time from within your Panda3D application.
Here's the link: www.panda3d.net/phpbb2/viewtopic.php?t=2135
But be warned, the documentation there is not really that accurate it seems (unless I'm just misunderstanding things). For example, he says somewhere that you can just use Esc to toggle the console but this isn't true unless you create that keyboard binding yourself.
Here's how I used this component:
1) Download the ZIP file from the above page (current version).
2) Unzip into your project directory (or src directory if you're using such a thing)
- this will create a directory named interactiveConsole
3) Change the name of that directory to ic (just for convenience)
4) Use it in your application like so (following is the beginning of my World.py):
Hope this benefits someone.
- Stefan.
I realize this is a bit late but maybe someone can make use of this anyway.
I came across a really cool package that is making testing much more pleasant for me. It's an integrated Python interpreter console that you can include in your application. This enables you to manipulate your world in real-time from within your Panda3D application.
Here's the link: www.panda3d.net/phpbb2/viewtopic.php?t=2135
But be warned, the documentation there is not really that accurate it seems (unless I'm just misunderstanding things). For example, he says somewhere that you can just use Esc to toggle the console but this isn't true unless you create that keyboard binding yourself.
Here's how I used this component:
1) Download the ZIP file from the above page (current version).
2) Unzip into your project directory (or src directory if you're using such a thing)
- this will create a directory named interactiveConsole
3) Change the name of that directory to ic (just for convenience)
4) Use it in your application like so (following is the beginning of my World.py):
from direct.showbase.DirectObject import DirectObject
from ic.interactiveConsole import pandaConsole, INPUT_CONSOLE, INPUT_GUI, OUTPUT_PYTHON, OUTPUT_IRC
class World(DirectObject):
def __init__(self):
# INPUT_CONSOLE: enables the commandline text input
# INPUT_GUI: create the panda3d interface for the console
# OUTPUT_PYTHON: enables the python code executer
# OUTPUT_IRC: enables the irc backend
self.console = pandaConsole( INPUT_CONSOLE|INPUT_GUI|OUTPUT_PYTHON, locals() )
# start out hidden
self.console.toggle()
self.accept("escape", self.console.toggle)
Hope this benefits someone.
- Stefan.