psk io: unify change tab category

This commit is contained in:
Brendon Murphy 2016-08-15 22:03:40 +10:00
parent 344ae07195
commit 259988c4af
1 changed files with 27 additions and 0 deletions

View File

@ -2653,6 +2653,33 @@ def menu_func(self, context):
default_path = os.path.splitext(bpy.data.filepath)[0] + ".psk"
self.layout.operator(ExportUDKAnimData.bl_idname, text="Skeleton Mesh / Animation Data (.psk/.psa)").filepath = default_path
## Addons Preferences Update Panel
def update_panel(self, context):
try:
bpy.utils.unregister_class(Panel_UDKExport)
except:
pass
Panel_UDKExport.bl_category = context.user_preferences.addons[__name__].preferences.category
bpy.utils.register_class(Panel_UDKExport)
class PskAddonPreferences(bpy.types.AddonPreferences):
# this must match the addon name, use '__package__'
# when defining this in a submodule of a python package.
bl_idname = __name__
category = bpy.props.StringProperty(
name="Tab Category",
description="Choose a name for the category of the panel",
default="Import/Export",
update=update_panel)
def draw(self, context):
layout = self.layout
row = layout.row()
col = row.column()
col.label(text="Tab Category:")
col.prop(self, "category", text="")
#===========================================================================
# Entry
#===========================================================================