boskee / Minecraft

Simple Minecraft-inspired program using Python and Pyglet
MIT License
207 stars 33 forks source link

'ImageData' object has no attribute 'texture' #109

Closed brwinner5350 closed 4 years ago

brwinner5350 commented 4 years ago

Hi. I am currently running Windows 10 with Python 3.8.1 and I'm getting an error. Here's my logs:

2020-03-04 17:35:42 [MainThread] [INFO] Starting pyCraft... 2020-03-04 17:35:42 [MainThread] [INFO] Mod loader has identified 0 mods to load Traceback (most recent call last): File "main.py", line 165, in main(options) File "main.py", line 135, in main pyglet.app.run() File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\app__init__.py", line 144, in run event_loop.run() File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\app\base.py", line 175, in run self._run() File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\app\base.py", line 187, in _run timeout = self.idle() File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\app\base.py", line 314, in idle window.dispatch_event('on_draw') File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\window__init__.py", line 1330, in dispatch_event if EventDispatcher.dispatch_event(self, args) != False: File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\event.py", line 416, in dispatch_event if handler(args): File "F:\views.py", line 437, in on_draw self.draw_panorama() File "F:\views.py", line 327, in draw_panorama glBindTexture(self.panorama[i].texture.target, self.panorama[i].texture.id) AttributeError: 'ImageData' object has no attribute 'texture'

I tried this on another computer and got the same error. Any ideas on what it could be?

I appreciate any help.

Edit: I do realize this is an older project, and may not work with the newest versions of Python.

r58Playz commented 4 years ago

Change that line to: glBindTexture(self.panorama[i].get_texture().target, self.panorama[i]. get_texture().id) and the next line to: glEnable(self.panorama[i].get_texture().target)

On Wed, Mar 4, 2020 at 3:50 PM DarkJakDeveloper notifications@github.com wrote:

Hi. I am currently running Windows 10 with Python 3.8.1 and I'm getting an error. Here's my logs:

2020-03-04 17:35:42 [MainThread] [INFO] Starting pyCraft... 2020-03-04 17:35:42 [MainThread] [INFO] Mod loader has identified 0 mods to load Traceback (most recent call last): File "main.py", line 165, in main(options) File "main.py", line 135, in main pyglet.app.run() File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\app init.py", line 144, in run event_loop.run() File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\app\base.py", line 175, in run self._run() File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\app\base.py", line 187, in

run timeout = self.idle() File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\app\base.py", line 314, in idle window.dispatch_event('on_draw') File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\window_init.py", line 1330, in dispatch_event if EventDispatcher.dispatch_event(self, args) != False: File "C:\Users\mnqge\AppData\Local\Programs\Python\Python38\lib\site-packages\pyglet\event.py", line 416, in dispatch_event if handler(args): File "F:\views.py", line 437, in on_draw self.draw_panorama() File "F:\views.py", line 327, in draw_panorama glBindTexture(self.panorama[i].texture.target, self.panorama[i].texture.id ) AttributeError: 'ImageData' object has no attribute 'texture'

I tried this on another computer and got the same error. Any ideas on what it could be?

I appreciate any help.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/boskee/Minecraft/issues/109?email_source=notifications&email_token=AKZAPOAWXGLTC6WCU6SG5ZTRF3SMPA5CNFSM4LB6H3X2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ISTMETQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZAPOEPDOBCYEFUZJEPAUTRF3SMPANCNFSM4LB6H3XQ .

brwinner5350 commented 4 years ago

Thanks, I'll try that now.

brwinner5350 commented 4 years ago

Well, this fixed that issue, but now essentially every button I click is an error. I'll have to try something else. However, thanks for your help!