forked from LeenkxTeam/LNXSDK
Tilesheets To Objects
This commit is contained in:
@ -292,39 +292,38 @@ class LNX_PT_TilesheetPanel(bpy.types.Panel):
|
|||||||
bl_label = "Leenkx Tilesheet"
|
bl_label = "Leenkx Tilesheet"
|
||||||
bl_space_type = "PROPERTIES"
|
bl_space_type = "PROPERTIES"
|
||||||
bl_region_type = "WINDOW"
|
bl_region_type = "WINDOW"
|
||||||
bl_context = "render"
|
bl_context = "object"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return context.object is not None and context.object.type == 'MESH'
|
return context.object is not None and context.object.type == 'MESH'
|
||||||
|
|
||||||
def draw_header(self, context):
|
|
||||||
obj = context.object
|
|
||||||
self.layout.prop(obj, "lnx_tilesheet_enabled", text="")
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
layout.use_property_split = True
|
layout.use_property_split = True
|
||||||
layout.use_property_decorate = False
|
layout.use_property_decorate = False
|
||||||
obj = context.object
|
obj = context.object
|
||||||
|
|
||||||
layout.enabled = obj.lnx_tilesheet_enabled
|
layout.prop(obj, "lnx_tilesheet_enabled", text="Enable Tilesheet")
|
||||||
|
|
||||||
|
body = layout.column()
|
||||||
|
body.enabled = obj.lnx_tilesheet_enabled
|
||||||
|
|
||||||
# Start action dropdown
|
# Start action dropdown
|
||||||
layout.prop_search(obj, "lnx_tilesheet_default_action", obj, "lnx_tilesheet_actionlist", text="Start Action")
|
body.prop_search(obj, "lnx_tilesheet_default_action", obj, "lnx_tilesheet_actionlist", text="Start Action")
|
||||||
|
|
||||||
row = layout.row()
|
row = body.row()
|
||||||
row.prop(obj, "lnx_tilesheet_flipx")
|
row.prop(obj, "lnx_tilesheet_flipx")
|
||||||
row.prop(obj, "lnx_tilesheet_flipy")
|
row.prop(obj, "lnx_tilesheet_flipy")
|
||||||
|
|
||||||
# Actions list
|
# Actions list
|
||||||
layout.separator()
|
body.separator()
|
||||||
layout.label(text="Actions")
|
body.label(text="Actions")
|
||||||
rows = 2
|
rows = 2
|
||||||
if len(obj.lnx_tilesheet_actionlist) > 1:
|
if len(obj.lnx_tilesheet_actionlist) > 1:
|
||||||
rows = 4
|
rows = 4
|
||||||
row = layout.row()
|
row = body.row()
|
||||||
row.template_list("LNX_UL_TilesheetActionList", "The_List", obj, "lnx_tilesheet_actionlist", obj, "lnx_tilesheet_actionlist_index", rows=rows)
|
row.template_list("LNX_UL_TilesheetActionList", "The_List", obj, "lnx_tilesheet_actionlist", obj, "lnx_tilesheet_actionlist_index", rows=rows)
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.operator("lnx_tilesheetactionlist.new_item", icon='ADD', text="")
|
col.operator("lnx_tilesheetactionlist.new_item", icon='ADD', text="")
|
||||||
@ -340,7 +339,7 @@ class LNX_PT_TilesheetPanel(bpy.types.Panel):
|
|||||||
# Selected action details (per-action properties)
|
# Selected action details (per-action properties)
|
||||||
if obj.lnx_tilesheet_actionlist_index >= 0 and len(obj.lnx_tilesheet_actionlist) > 0:
|
if obj.lnx_tilesheet_actionlist_index >= 0 and len(obj.lnx_tilesheet_actionlist) > 0:
|
||||||
adat = obj.lnx_tilesheet_actionlist[obj.lnx_tilesheet_actionlist_index]
|
adat = obj.lnx_tilesheet_actionlist[obj.lnx_tilesheet_actionlist_index]
|
||||||
box = layout.box()
|
box = body.box()
|
||||||
# Grid dimensions
|
# Grid dimensions
|
||||||
row = box.row()
|
row = box.row()
|
||||||
row.use_property_split = False
|
row.use_property_split = False
|
||||||
|
|||||||
Reference in New Issue
Block a user