Use Object.pose_library instead of Object.dspl.pose_library

This commit is contained in:
2024-12-28 04:50:52 -06:00
parent edeaa12f5e
commit 592a9602d8
4 changed files with 40 additions and 37 deletions

14
gui.py
View File

@ -31,12 +31,18 @@ class DATA_PT_DSPLPanel(bpy.types.Panel):
# Attach or create pose library
pose_library_dspl = getDsplAction(context)
pose_library_action = getArmatureAction(context)
pose_library_legacy = getLegacyPoseLibrary(context)
if pose_library_dspl or pose_library_action:
if pose_library_dspl or pose_library_action or pose_library_legacy:
if pose_library_dspl and not pose_library_action:
active_pose_library = pose_library_dspl
armature_layout.template_ID(
arm_object.dspl, "pose_library", new="dspl.create_pose_library", unlink="dspl.unlink_pose_library")
arm_object, "pose_library", new="dspl.create_pose_library", unlink="dspl.unlink_pose_library")
elif pose_library_legacy and not pose_library_dspl:
active_pose_library = pose_library_legacy
armature_layout.template_ID(
arm_object, "pose_library", new="dspl.create_pose_library", unlink="dspl.unlink_pose_library")
elif pose_library_action and not pose_library_dspl:
active_pose_library = pose_library_action
@ -51,7 +57,7 @@ class DATA_PT_DSPLPanel(bpy.types.Panel):
elif pose_library_action and pose_library_dspl:
armature_layout.template_ID(
arm_object.dspl, "pose_library", new="dspl.create_pose_library")
arm_object, "pose_library", new="dspl.create_pose_library")
armature_layout.label(text="Double pose configuration!!")
armature_layout.label(text="You should not proceed")
armature_layout.operator(
@ -141,7 +147,7 @@ class DATA_PT_DSPLPanel(bpy.types.Panel):
armature_layout.label(
text="No Action or Pose Library detected")
armature_layout.template_ID(
arm_object.dspl, "pose_library", new="dspl.create_pose_library")
arm_object, "pose_library", new="dspl.create_pose_library")
else:
armature_layout.label(text="No armature or parent selected")