Render issues and base.disableMouse()

Hello everyone,

I was creating a very small and easy sample window with just three cubes in it…

#!/usr/bin/env python
#coding: iso-8859-1

#Basic Panda imports 
import direct.directbase.DirectStart
from pandac.PandaModules import *

base.setBackgroundColor(0.2, 0.2, 0.5)
#base.disableMouse()

#Set the framerate meter
base.setFrameRateMeter(True)

#Camera Pos
camera.setPos(0.0, -20.0, 10.0)
camera.lookAt(0.0, 0.0, 0.0)

#Root Node
root = render.attachNewNode("Root")
root.setPos(0.0, 0.0, 0.0)

#Three Cubes
cubes = []
for x in [-3.0, 0.0, 3.0]:
	cube = loader.loadModelCopy("cube.egg")
	cube.setPos(x, 0.0, 0.0)
	cube.reparentTo(root)
	cubes += [ cube ]
run()

This code, however in my machine does not work. Shows the window, the background color and the fps meter, but no cubes.
The curious thing is that if I uncomment this line of code in my script

base.disableMouse()

Then everything is fine and I can see my cubes again. Not sure about it but it seems kind of odd here.

Its been a while since I’ve touched Panda. Maybe I’m doing something wrong?

Thank you very much,

Italo F. Capasso B.
Aka “Edwood Grant”

base.disablemouse() is just a bit of an unlucky named function.
it doesnt disable the mouse but the default mouse-based camera movement.
as long as this movement is active you cant set positions for the camera via code. that’s why you need to disable it before setting new positions.
oh and… welcome back to panda :slight_smile:

Thanks a lot Thomas, certainly it is a misleading function :stuck_out_tongue:
And also thanks for the welcome back, I keep using many engines, but I always come back to this one, Panda3D its just to B-E-A-utiful. :smiley:

This time ill have something to show for sure like in…September - November at least, this time is my final University project, so I must deliver something cool :stuck_out_tongue:. And I believe Panda3D is the perfect tool for the job. :smiley:

Cheers,
Italo F. Capasso B.
Aka “Edwood Grant”