Palette crashing in Blender 3.1
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
Yep. Can confirm. Exact same thing happening over here.
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. ^^

Thanks!
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.
I had this issue so downloaded Blender v2.8.0 and Sprytile is working fine! You can get all Blender versions here.
I too had this problem but blender 3.0.1 is completely fine
Happened to me, feels bad! Really can't wait to use it
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.
Can confirm - still has issues in 3.1 and 3.2
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
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.