Rendering window freezes immediately and is unresponsive


Just started panda3d and I encoutered a problem, that I don’t understand:
Whenever I run the code below, the rendering window appears but is immediately unresponsive and remains it. I’m using python 3.10.9 with the spyder IDE and panda3d 1.10.13. I’m working on a fujitsu esprimo d956/e94+.

Thanks for any help!

#load configuration .prc file
from panda3d.core import loadPrcFile

# #load config manager and print config vars
from panda3d.core import ConfigVariableManager

#open panda 3d window
from direct.showbase.ShowBase import ShowBase

#create basic game class, i.e. "blueprint" for creating game objects
class game(ShowBase):
    def __init__(self):
        super().__init__() #make built-in variables accesible to game class 
        box = self.loader.loadModel("C:\\Users\leco10\Anaconda3\envs\panda3denv\Lib\site-packages\panda3d\models\box")   #loader is built in, load box library model into game class
        box.reparentTo(self.render) #make it visible by giving it to render
#create instance of game
game_instance = game()

Hi, welcome to the community!

For loadModel, Panda accepts a Unix-style path only, so of the form:

box = self.loader.loadModel("/c/Users/leco10/Anaconda3/envs/panda3denv/Lib/site-packages/panda3d/models/box")

Or simply this, since the models directory is added to the model-path automatically:

box = self.loader.loadModel("box")

Oh thanks! That solved it :slight_smile: