Skip to content

Commit

Permalink
Remove Update Panel
Browse files Browse the repository at this point in the history
Blender 2.93 で[編集]タブが無くなった影響からエラーが出ているため、一時的にコメントアウト。
  • Loading branch information
samia-done committed Jun 16, 2021
1 parent 5f3fd36 commit bd99844
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/petit_armature_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
bl_info = {
"name": "Petit Armature Tools",
"author": "Samia",
"version": (0, 2),
"version": (0, 3),
"blender": (2, 80, 0),
"location": "View3D > Sidebar > Edit Tab",
"description": "Petit Armature Tools",
Expand Down Expand Up @@ -80,7 +80,7 @@ def register():
for cls in classes:
bpy.utils.register_class(cls)
bpy.types.Scene.PAT_ToolSettings = bpy.props.PointerProperty(type=pat_operator.PAT_ToolSettings)
pat_preferences.update_panel(None, bpy.context)
# pat_preferences.update_panel(None, bpy.context)

bpy.app.translations.register(__name__, get_translation_dict())

Expand Down
54 changes: 27 additions & 27 deletions src/petit_armature_tools/pat_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,35 @@ def get_update_candidate_branches(_, __):
# Define Panel classes for updating


def update_panel(self, context):
panels = (
pat_operator.VIEW3D_PT_edit_petit_armature_tools,
)
message = "Updating Panel locations has failed"
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[__package__].preferences.category if bpy.app.version < (2, 80) else context.preferences.addons[__package__].preferences.category
bpy.utils.register_class(panel)

except Exception as e:
print("\n[{}]\n{}\n\nError:\n{}".format(__name__, message, e))
pass
# def update_panel(self, context):
# panels = (
# pat_operator.VIEW3D_PT_edit_petit_armature_tools,
# )
# message = "Updating Panel locations has failed"
# 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[__package__].preferences.category if bpy.app.version < (2, 80) else context.preferences.addons[__package__].preferences.category
# bpy.utils.register_class(panel)
#
# except Exception as e:
# print("\n[{}]\n{}\n\nError:\n{}".format(__name__, message, e))
# pass


@make_annotations
class PAT_AddonPreferences(bpy.types.AddonPreferences):
bl_idname = __package__

category = bpy.props.StringProperty(
name="Tab Category",
description="Choose a name for the category of the panel",
default="Tools" if bpy.app.version < (2, 80) else "Edit",
update=update_panel
)
# category = bpy.props.StringProperty(
# name="Tab Category",
# description="Choose a name for the category of the panel",
# default="Tools" if bpy.app.version < (2, 80) else "Edit",
# update=update_panel
# )

# for add-on updater
updater_branch_to_update = bpy.props.EnumProperty(
Expand All @@ -77,8 +77,8 @@ def __init__(self):

def draw(self, context):
layout = self.layout
row = layout.row()
col = row.column()
col.label(text="Tab Category:")
col.prop(self, "category", text="")
# row = layout.row()
# col = row.column()
# col.label(text="Tab Category:")
# col.prop(self, "category", text="")
updater.draw_updater_ui(self)

0 comments on commit bd99844

Please sign in to comment.