psk io: unify change tab category
This commit is contained in:
parent
344ae07195
commit
259988c4af
|
@ -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
|
||||
#===========================================================================
|
||||
|
|
Loading…
Reference in New Issue