2

Unfortunately I'm a beginner in Python and Panda3D. What I did so far is trying out the Panda3D functionality and building some example worlds with the code ending like this:

base = ShowBase()
world = World()
base.run()

Is it possible to start Panda3D in another thread while letting the main thread calculate motion data for objects in the Panda3D world? So the main task of the program is the calculation and additionally the Panda3D world should graphically show the progress.

I tried to let the separate thread execute the code above but both my main thread calculation (Segmentation fault) and the Panda3D window (black windows, no respond) crash.

class myThread (threading.Thread):
    def __init__(self):
        threading.Thread.__init__(self)

    def run(self):
        base = ShowBase()
        world = World()
        base.run()

t1 = myThread()
t1.start()

How can both of them run at the same time so that communication between both threads is possible?

pythom2
  • 21
  • 2

1 Answers1

0

Are you using direct.stdpy and not the python threading package?

See https://docs.panda3d.org/1.10/python/programming/threading