Sprytile icon indicating copy to clipboard operation
Sprytile copied to clipboard

Palette crashing in Blender 3.1

Open lunathir opened this issue 4 years ago • 8 comments

Whenever I attempt to move the palette, change the palette size, or almost anything else with Sprytile, it seems that the tile palette disappears. When that happens, drawing with Sprytile is impossible until you go into the Blender icon, click System then Reload Scripts, or you restart the program. Under Blender 3.1, Linux Mint, Sprytile 0.5.25.

Moving palette:

Python: Traceback (most recent call last):
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_gui.py", line 205, in modal
    ret_val = self.handle_ui(context, event)
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_gui.py", line 399, in handle_ui
    self.set_zoom_level(context, zoom_shift)
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_gui.py", line 276, in set_zoom_level
    context.scene.sprytile_ui.palette_pos[0] = display_offset.x
TypeError: expected an int type

location: <unknown location>:-1

Scaling palette:

Python: Traceback (most recent call last):
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_gui.py", line 205, in modal
    ret_val = self.handle_ui(context, event)
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_gui.py", line 399, in handle_ui
    self.set_zoom_level(context, zoom_shift)
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_gui.py", line 276, in set_zoom_level
    context.scene.sprytile_ui.palette_pos[0] = display_offset.x
TypeError: expected an int type

location: <unknown location>:-1

Selecting a tile:

Python: Traceback (most recent call last):
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_gui.py", line 205, in modal
    ret_val = self.handle_ui(context, event)
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_gui.py", line 489, in handle_ui
    tilegrid.tile_selection[0] = sel_min.x
TypeError: expected an int type

location: <unknown location>:-1

Attempting to draw while palette is gone:

Python: Traceback (most recent call last):
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_modal.py", line 608, in modal
    self.exit_modal(event, context)
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_modal.py", line 924, in exit_modal
    self.call_tool(event, False, context)
  File "/home/lunathir/.config/blender/3.1/scripts/addons/SpryTile/sprytile_modal.py", line 712, in call_tool
    build_preview=self.draw_preview,
  File "/home/lunathir/.steam/debian-installation/steamapps/common/Blender/3.1/scripts/modules/bpy_types.py", line 772, in __getattribute__
    return super().__getattribute__(attr)
AttributeError: 'VIEW3D_OP_SprytileModalTool' object has no attribute 'draw_preview'

location: <unknown location>:-1

lunathir avatar Mar 12 '22 18:03 lunathir

Yep. Can confirm. Exact same thing happening over here.

RiskyVector avatar Apr 21 '22 02:04 RiskyVector

Have the same kind of problem. Impossible to even start to use sprytile. Any idea why? Thanks!

I asked on twitter too, if someone want to answer there : https://twitter.com/FogRyu/status/1519784961666134019?s=20&t=LkC71A5rt9JEImwO2XoFWw

Cauz I'm usually not on Github at all, so I guess i'll miss any answer. ^^

image

Thanks!

FogRyu avatar Apr 28 '22 21:04 FogRyu

Just to let peoples know, someone told me on discord that Sprytile don't work on Blender 3.1 yet. So you should be able to use it with Blender 3.0. I'll try that when I have the time.

FogRyu avatar Apr 29 '22 06:04 FogRyu

I had this issue so downloaded Blender v2.8.0 and Sprytile is working fine! You can get all Blender versions here.

madebyluque avatar May 05 '22 17:05 madebyluque

I too had this problem but blender 3.0.1 is completely fine

LeonStansfield avatar May 07 '22 16:05 LeonStansfield

Happened to me, feels bad! Really can't wait to use it

mad-wizard avatar Jun 09 '22 23:06 mad-wizard

I fixed it by casting the tile selections to integers in sprytile_gui.py, it looks like Blender vector use floats but tile selection is expecting an integer which causes the error.

tilegrid.tile_selection[0] = int(sel_min.x) tilegrid.tile_selection[1] = int(sel_min.y) tilegrid.tile_selection[2] = int((sel_max.x - sel_min.x) + 1) tilegrid.tile_selection[3] = int((sel_max.y - sel_min.y) + 1)

I think the draw_preview error is only because of the initial error as I don't get that error anymore after fixing the first error in sprytile_gui.py.

jbrenneckejones avatar Jun 16 '22 07:06 jbrenneckejones

Can confirm - still has issues in 3.1 and 3.2

TheBricktop avatar Aug 21 '22 10:08 TheBricktop

I just released an updated fork of Sprytile that fixes this issue. https://github.com/ionthedev/ReSprytile

The new versions of Blender need the preview windows' positional data to be converted to an integer.

Working for 3.4.0

ionthedev avatar May 04 '23 17:05 ionthedev

lol, at least four* people in this issue fixed the problem independently, completely ignoring each other ) way to collaborate, guys 👍

*one of them did not publish the fork, so the 3rd guy had to re-do it... so like half-independently.

makc avatar May 07 '23 21:05 makc