[Bf-extensions-cvs] [b70a37e] master: update archimesh: add rename tab category
meta-androcto
noreply at git.blender.org
Wed Aug 10 17:07:46 CEST 2016
Commit: b70a37e67c86e79fe1e1e4b7535ad4c28c87d89c
Author: meta-androcto
Date: Thu Aug 11 01:07:13 2016 +1000
Branches: master
https://developer.blender.org/rBAb70a37e67c86e79fe1e1e4b7535ad4c28c87d89c
update archimesh: add rename tab category
===================================================================
M archimesh/__init__.py
===================================================================
diff --git a/archimesh/__init__.py b/archimesh/__init__.py
index 114db79..35606f3 100644
--- a/archimesh/__init__.py
+++ b/archimesh/__init__.py
@@ -127,9 +127,47 @@ class AchmInfoMtMeshCustomMenuAdd(Menu):
# --------------------------------------------------------------
# Register all operators and panels
# --------------------------------------------------------------
-# Define menu
+## Addons Preferences Update Panel
+from bpy.types import (
+ AddonPreferences,
+ )
+from bpy.props import (
+ StringProperty,
+ )
+
+def update_panel(self, context):
+ try:
+ bpy.utils.unregister_class(achm_main_panel.ArchimeshMainPanel)
+ except:
+ pass
+ achm_main_panel.ArchimeshMainPanel.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(achm_main_panel.ArchimeshMainPanel)
+
+
+class Archi_Pref(AddonPreferences):
+ bl_idname = __name__
+ category = StringProperty(
+ name="Rename Tab Category",
+ description="Choose a name for the category of the panel",
+ default="Archimesh",
+ update=update_panel
+ )
+
+ def draw(self, context):
+ layout = self.layout
+ split_percent = 0.15
+
+ split = layout.split(percentage=split_percent)
+ col = split.column()
+ col.label(text="Rename Tab Category:")
+ col = split.column()
+ colrow = col.row()
+ colrow.alignment = 'LEFT'
+ colrow.prop(self, "category", text="")
+
+# Define menu
# noinspection PyUnusedLocal
def AchmMenu_func(self, context):
self.layout.menu("INFO_MT_mesh_custom_menu_add", icon="PLUGIN")
More information about the Bf-extensions-cvs
mailing list