I am impressed by Panda3D!
I think it has the potential what I am looking for.
I am designing a some kind of Python teaching aid tool, where children presented to a Isometric 3D world, and (s)he can move around the actor by typing python command. The following code draft should explain it :
Kids can enter those codes in a separate Text Editor which resemble a REPL environment.
There, making a new superhero object being generated dynamically in the existing 3D world
It is somekind of Turtle/Logo application, but it just an interactive 3D world
I am not aware that Panda3D has anything prebuilt in its own API to do that, but it is simple enough to load an interactive console in a separate thread. A bare bones example with no error handling:
from direct.showbase.ShowBase import ShowBase
from direct.stdpy import threading
from code import InteractiveConsole
app = ShowBase()
ic = InteractiveConsole(globals())
ic_thread = threading.Thread(target=ic.interact)
ic_thread.start()
app.run()
See the code module docs for more information. You can subclass code.InteractiveInterpreter and make it as fancy as you like.
It use Python eval() to evaluate a one line Python code. And for a longer script, I use execfile to read an external script. The code editor was implemented using Tkinter. Working flawlessly in Windows 7, but failed to do so in OSX. I think I am gonna search for Tkinter replacement, as from what I’ve read, it’s not so much great running with multiple thread.
Thank you so much for Panda!
It really is … entertaining my week end