Hi everyone! I’m having a bit of trouble trying to get a script I’m working on to function on the equivalent version of Panda3D when using Python3.
This code works perfectly on Python2, but completely falls apart when used with Python3.
The error:
“UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xa4 in position 2: invalid start byte”
Thanks!
from direct.showbase.ShowBase import ShowBase
from panda3d.core import *
class compressExampleA(ShowBase):
def __init__(self):
ShowBase.__init__(self)
self.scene = self.loader.loadModel("panda")
self.scene.reparentTo(self.render)
self.scene.setScale(0.25)
self.scene.setPos(-8, 42, 0)
ss = StringStream()
self.scene.writeBamStream(ss)
ssdata = ss.getData()
data = compressString(ssdata, 1) # Why won't this work on Python 3?
print (data)
app = compressExampleA()
app.run()