Skip to content
Snippets Groups Projects
Commit b6bc9f86 authored by Campbell Barton's avatar Campbell Barton
Browse files

Print3D: remove option to rename the category

This is unstable (unregisters panel types while in use).
parent 01370f87
No related branches found
No related tags found
No related merge requests found
...@@ -121,43 +121,6 @@ class Print3D_Scene_Props(PropertyGroup): ...@@ -121,43 +121,6 @@ class Print3D_Scene_Props(PropertyGroup):
) )
# Update panel category name
panels = (
ui.VIEW3D_PT_Print3D_Object,
ui.VIEW3D_PT_Print3D_Mesh,
)
def update_panels(self, context):
try:
for panel in panels:
if "bl_rna" in panel.__dict__:
bpy.utils.unregister_class(panel)
for panel in panels:
panel.bl_category = context.user_preferences.addons[__name__].preferences.category
bpy.utils.register_class(panel)
except Exception as e:
message = "3D Print Toolbox: Updating Panel locations has failed"
print("\n[{}]\n{}\n\nError:\n{}".format(__name__, message, e))
class Print3D_Preferences(AddonPreferences):
bl_idname = __name__
category = StringProperty(
name="Tab Category",
description="Choose a name for the category of the panel",
default="3D Printing",
update=update_panels,
)
def draw(self, context):
layout = self.layout
layout.prop(self, "category")
classes = ( classes = (
ui.VIEW3D_PT_Print3D_Object, ui.VIEW3D_PT_Print3D_Object,
ui.VIEW3D_PT_Print3D_Mesh, ui.VIEW3D_PT_Print3D_Mesh,
...@@ -187,7 +150,6 @@ classes = ( ...@@ -187,7 +150,6 @@ classes = (
operators.MESH_OT_Print3D_Export, operators.MESH_OT_Print3D_Export,
Print3D_Scene_Props, Print3D_Scene_Props,
Print3D_Preferences,
) )
...@@ -197,8 +159,6 @@ def register(): ...@@ -197,8 +159,6 @@ def register():
bpy.types.Scene.print_3d = PointerProperty(type=Print3D_Scene_Props) bpy.types.Scene.print_3d = PointerProperty(type=Print3D_Scene_Props)
update_panels(None, bpy.context)
def unregister(): def unregister():
for cls in classes: for cls in classes:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment