I just installed Panda3D 1.8.1 on my Windows 8 x64 install and whenever I try and run ANY script, the following happens:
-The window opens and stays black momentarily
-then it proceeds to crash, no warning, and just says ppython.exe has stopped working
I’ve tried with this basic script from the manual:
from direct.showbase.ShowBase import ShowBase
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
app = MyApp()
app.run()
as well as a much longer script that I wrote derived from the Manual Hello World tutorial:
from math import pi, sin, cos
import socket
import sys
import time
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from direct.actor.Actor import Actor
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
# Create a TCP/IP socket
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect the socket to the port where the server is listening
self.server_address = ('192.168.0.10', 10000)
print >>sys.stderr, 'connecting'
self.sock.connect(self.server_address)
#Load the environment model
self.environ = self.loader.loadModel("models/environment")
#Reparent the model to render
self.environ.reparentTo(self.render)
#Apply scale and position transforms on the model.
self.environ.setScale(0.25, 0.25, 0.25)
self.environ.setPos(-8, 42, 0)
# Add the spinCameraTask procedure to the task manager.
self.taskMgr.add(self.spinCameraTask, "SpinCameraTask")
# Add pandaHand to task manager
self.taskMgr.add(self.pandaHand, "PandaHand")
# Load and transform the panda actor
self.pandaActor = Actor("models/panda-model", {"walk": "models/panda-walk4"})
self.pandaActor.setScale(0.005, 0.005, 0.005)
self.pandaActor.reparentTo(self.render)
# Loop its animation
self.pandaActor.loop("walk")
# pandaHand
def pandaHand(self, task):
#Receive data from RasPi
ADC_list_elements = 5
data = self.sock.recv((ADC_list_elements*5)-1)
print >>sys.stderr, data
#Transform data string into lof
# IR , FSR , -, -, -, SW3 , SW2 , SW1
# 0 1 2 3 4 5 6 7
y = [float(datum) for datum in data.split(',')]
#Set panda height equivalent to IR voltage
self.pandaActor.setPos(0,0,3.4-y[0])
#Set panda scale relative to FSR
self.pandaActor.setScale(0.005, 0.006-(0.001*y[1]), 0.005)
#Set orientation depending on button values (either 0.0 or 30.0*~4.96)
self.pandaActor.setHpr(180 if y[4]>4.0 else 0, 180 if y[3]>4.0 else 0, 180 if y[2]>4.0 else 0)
return Task.cont
# Define a procedure to move the camera
def spinCameraTask(self, task):
angleDegrees = task.time * 6.0;
angleRadians = angleDegrees * (pi/180.0)
self.camera.setPos(20*sin(angleRadians), -20.0*cos(angleRadians), 3)
self.camera.setHpr(angleDegrees, 0, 0)
return Task.cont
app = MyApp()
app.run()
Both of these work fine on my Ubuntu 12.10 x86 install but Panda3D just seems to catastrophically fail everytime I try and run it on Windows. Any good way of debugging this?