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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2022-04-07 12:27:19 +0300
committerSybren A. Stüvel <sybren@blender.org>2022-04-07 12:27:23 +0300
commit6d1fbd249b7114c21926e630a1d8fcf8966c8379 (patch)
treecb5f8c520fa547ffedd9a6a684e7adda1a596299 /release/scripts/startup/bl_ui/properties_data_armature.py
parent951e43bee81ebc96da588f872816a98babc70d9a (diff)
Pose Library: avoid errors in the legacy panel when the add-on is disabled
Avoid errors in the legacy Pose Library panel (in Armature properties) when the Pose Library add-on is disabled. It's unfortunate that a built-in panel now has knowledge of an add-on. Then again, it's temporary (one or two Blender releases), and it now uses feature detection instead of just assuming the add-on is enabled.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_armature.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_armature.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index 5228c459d8c..6980f07eba4 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -188,8 +188,12 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
col.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
if poselib:
- col.operator('poselib.convert_old_object_poselib',
- text="Convert to Pose Assets", icon="ASSET_MANAGER")
+ if hasattr(bpy.types, 'POSELIB_OT_convert_old_object_poselib'):
+ col.operator('poselib.convert_old_object_poselib',
+ text="Convert to Pose Assets", icon="ASSET_MANAGER")
+ else:
+ col.label(text="Enable the Pose Library add-on to convert", icon="ERROR")
+ col.label(text="this legacy pose library to pose assets.", icon="BLANK1")
# Put the deprecated stuff in its own sub-layout.
@@ -226,7 +230,6 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
).pose_index = poselib.pose_markers.active_index
col.operator("poselib.action_sanitize", icon='HELP', text="") # XXX: put in menu?
- col.operator("poselib.convert_old_poselib", icon='ASSET_MANAGER', text="")
if pose_marker_active is not None:
col.operator("poselib.pose_move", icon='TRIA_UP', text="").direction = 'UP'