From 21c6309b26f177edc885560768f0d7c6bb9a9742 Mon Sep 17 00:00:00 2001 From: Nika Kutsniashvili Date: Fri, 17 May 2024 17:17:02 +0400 Subject: [PATCH 1/2] Use __package__ instead of __name__ --- source/create_widgets.py | 2 +- source/prefs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/create_widgets.py b/source/create_widgets.py index 9766554..e2bf948 100644 --- a/source/create_widgets.py +++ b/source/create_widgets.py @@ -9,7 +9,7 @@ from math import cos, sin, pi def create_widget(name): """Create an empty widget object and return the object""" - prefs = bpy.context.preferences.addons["add_camera_rigs"].preferences + prefs = bpy.context.preferences.addons[__package__].preferences widget_prefix = prefs.widget_prefix obj_name = widget_prefix + name scene = bpy.context.scene diff --git a/source/prefs.py b/source/prefs.py index bdb2a9d..26240cd 100644 --- a/source/prefs.py +++ b/source/prefs.py @@ -7,7 +7,7 @@ from bpy.props import StringProperty class AddCameraRigsPreferences(AddonPreferences): - bl_idname = 'add_camera_rigs' + bl_idname = __package__ # Widget prefix widget_prefix: StringProperty( -- 2.30.2 From fc210de5163837f6467b31504ada34f1c550dbb5 Mon Sep 17 00:00:00 2001 From: Nika Kutsniashvili Date: Fri, 17 May 2024 17:18:48 +0400 Subject: [PATCH 2/2] Fix: UI trying to access bone properties with wrong name --- source/ui_panels.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ui_panels.py b/source/ui_panels.py index 14f7ef6..0ffa5de 100644 --- a/source/ui_panels.py +++ b/source/ui_panels.py @@ -93,9 +93,9 @@ class ADD_CAMERA_RIGS_PT_camera_rig_ui(Panel, CameraRigMixin): if rig["rig_id"].lower() == "crane_rig": col = layout.column(align=True) col.label(text="Crane Arm:") - col.prop(pose_bones["Crane_height"], + col.prop(pose_bones["Crane_Height"], 'scale', index=1, text="Arm Height") - col.prop(pose_bones["Crane_arm"], + col.prop(pose_bones["Crane_Arm"], 'scale', index=1, text="Arm Length") # 2D rig stuff -- 2.30.2