Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormeta-androcto <meta.androcto1@gmail.com>2016-08-15 16:09:37 +0300
committermeta-androcto <meta.androcto1@gmail.com>2016-08-15 16:09:37 +0300
commitcbbfbd27c3ab4946fa7bc786e87d18105f68435f (patch)
tree3a29ff103cc63d4965ea5b7e3544be12342f2dcd
parent0a5503f6d929466e54c1d7b9742421913e01b4b8 (diff)
bsurfaces: unify change tab category
-rw-r--r--mesh_bsurfaces.py32
1 files changed, 31 insertions, 1 deletions
diff --git a/mesh_bsurfaces.py b/mesh_bsurfaces.py
index 7e7aaedb..0a5d724d 100644
--- a/mesh_bsurfaces.py
+++ b/mesh_bsurfaces.py
@@ -3682,7 +3682,36 @@ class CURVE_OT_SURFSK_first_points(bpy.types.Operator):
return {'FINISHED'}
+## Addons Preferences Update Panel
+def update_panel(self, context):
+ try:
+ bpy.utils.unregister_class(VIEW3D_PT_tools_SURFSK_mesh)
+ bpy.utils.unregister_class(VIEW3D_PT_tools_SURFSK_curve)
+ except:
+ pass
+ VIEW3D_PT_tools_SURFSK_mesh.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(VIEW3D_PT_tools_SURFSK_mesh)
+ VIEW3D_PT_tools_SURFSK_curve.bl_category = context.user_preferences.addons[__name__].preferences.category
+ bpy.utils.register_class(VIEW3D_PT_tools_SURFSK_curve)
+
+class BsurfPreferences(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="Tools",
+ 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="")
def register():
@@ -3692,7 +3721,7 @@ def register():
bpy.utils.register_class(GPENCIL_OT_SURFSK_edit_strokes)
bpy.utils.register_class(CURVE_OT_SURFSK_reorder_splines)
bpy.utils.register_class(CURVE_OT_SURFSK_first_points)
-
+ bpy.utils.register_class(BsurfPreferences)
bpy.types.Scene.SURFSK_cyclic_cross = bpy.props.BoolProperty(
@@ -3735,6 +3764,7 @@ def unregister():
bpy.utils.unregister_class(GPENCIL_OT_SURFSK_edit_strokes)
bpy.utils.unregister_class(CURVE_OT_SURFSK_reorder_splines)
bpy.utils.unregister_class(CURVE_OT_SURFSK_first_points)
+ bpy.utils.unregister_class(BsurfPreferences)
del bpy.types.Scene.SURFSK_precision
del bpy.types.Scene.SURFSK_keep_strokes