Skip to content

Commit

Permalink
Fix tile paint register exception on 2.93. Closes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
greisane committed Jun 3, 2021
1 parent 1758010 commit 303cdef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions material/tile_paint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 303cdef

Please sign in to comment.