From 303cdef60cc3344b275de85d3b6e25b2750c61ee Mon Sep 17 00:00:00 2001 From: greisane Date: Thu, 3 Jun 2021 18:03:39 -0300 Subject: [PATCH] Fix tile paint register exception on 2.93. Closes #2 --- material/tile_paint.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/material/tile_paint.py b/material/tile_paint.py index 6acdd7d..787af8a 100644 --- a/material/tile_paint.py +++ b/material/tile_paint.py @@ -283,7 +283,7 @@ class GRET_OT_tileset_draw(bpy.types.Operator): uv_layer_name: bpy.props.StringProperty( name="UV Layer", description="Name of the target UV layer. Can change the default in addon preferences", - default="UVMap", + default="", ) index: bpy.props.IntProperty( options={'HIDDEN'}, @@ -458,6 +458,8 @@ def execute(self, context): def tool_paint(): def draw_settings(context, layout, tool): props = tool.operator_properties(GRET_OT_tileset_draw.bl_idname) + if not props.uv_layer_name and prefs.tileset_uv_layer_name: + props.uv_layer_name = prefs.tileset_uv_layer_name name = props.tileset image = bpy.data.images.get(name) tileset = tilesets.get(name) @@ -574,9 +576,6 @@ def clear_tilesets(): ) def register(settings): - # Don't know a better way of changing the default - GRET_OT_tileset_draw.__annotations__['uv_layer_name'][1]['default'] = prefs.tileset_uv_layer_name - for cls in classes: bpy.utils.register_class(cls)