Hi, extremely amateur programmer here.
After being able to get a program to run successfully entirely in main.py, I wanted to move most of the code to another file which I could import later, so I could boot into a menu, and then the main game.
However, Environment.egg.pz does not render after I moved the code, and I am instead treated to a blank screen.
I can confirm that the model is loaded and attached to render with render.ls(). I have also confirmed it renders when loaded from main.py.
from direct.showbase.ShowBase import ShowBase from gamecode.game.single import * class gameBase(ShowBase): def __init__(self): ShowBase.__init__(self) base.disableMouse() noServer(self, "environment") app = gameBase() app.run()
def noServer(self, map): #enables physics #base.enableParticles() #Load the enviroment self.scene = self.loader.loadModel(map) self.scene.reparentTo(self.render) #self.scene.setPos(-12, 250, -25) #Set up the player Player = self.loader.loadModel("testboxes.bam") camera.reparentTo(Player) #A bunch of stuff commented out for testing
What I see when I run main.py: