Pose library: remove much of old pose library interface

Remove much of the old legacy pose library:
- Remove from the Pose & Armature menus.
- Remove from the default keymap.
- Pose Library panel in Armature properties: Add "(legacy)" to title.
- Add note that the functionality of that panel is obsolete, with a
  button that opens the manual on the chapter of the new pose library.
- Add button to convert the selected legacy pose library to pose assets.
- The rest of the functionality is greyed out to further communicate
  it's been deprecated. It's still functional, though.

Ref: T93405
This commit is contained in:
Sybren A. Stüvel 2022-04-04 14:34:58 +02:00
parent 068d2b0861
commit a824c076b7
3 changed files with 28 additions and 26 deletions

View File

@ -4463,10 +4463,6 @@ def km_pose(params):
("anim.keyframe_insert_menu", {"type": 'I', "value": 'PRESS'}, None),
("anim.keyframe_delete_v3d", {"type": 'I', "value": 'PRESS', "alt": True}, None),
("anim.keying_set_active_set", {"type": 'I', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None),
("poselib.browse_interactive", {"type": 'L', "value": 'PRESS', "alt": True}, None),
("poselib.pose_add", {"type": 'L', "value": 'PRESS', "shift": True}, None),
("poselib.pose_remove", {"type": 'L', "value": 'PRESS', "shift": True, "alt": True}, None),
("poselib.pose_rename", {"type": 'L', "value": 'PRESS', "shift": True, "ctrl": True}, None),
("pose.push", {"type": 'E', "value": 'PRESS', "ctrl": True}, None),
("pose.relax", {"type": 'E', "value": 'PRESS', "alt": True}, None),
("pose.breakdown", {"type": 'E', "value": 'PRESS', "shift": True}, None),

View File

@ -157,30 +157,53 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
bl_label = "Pose Library"
bl_label = "Pose Library (Legacy)"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return (context.object and context.object.type == 'ARMATURE' and context.object.pose)
@staticmethod
def get_manual_url():
url_fmt = "https://docs.blender.org/manual/en/%d.%d/animation/armatures/posing/editing/pose_library.html"
return url_fmt % bpy.app.version[:2]
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="This panel is a remainder of the old pose library,")
col.label(text="which was replaced by the Asset Browser.")
url = self.get_manual_url()
col.operator('wm.url_open', text="More Info", icon="WORLD").url = url
layout.separator()
ob = context.object
poselib = ob.pose_library
layout.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
col = layout.column(align=True)
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")
# Put the deprecated stuff in its own sub-layout.
dep_layout = layout.column()
dep_layout.active = False
# warning about poselib being in an invalid state
if poselib.fcurves and not poselib.pose_markers:
layout.label(icon='ERROR', text="Error: Potentially corrupt library, run 'Sanitize' operator to fix")
dep_layout.label(icon='ERROR', text="Error: Potentially corrupt library, run 'Sanitize' operator to fix")
# list of poses in pose library
row = layout.row()
row = dep_layout.row()
row.template_list("UI_UL_list", "pose_markers", poselib, "pose_markers",
poselib.pose_markers, "active_index", rows=5)
poselib.pose_markers, "active_index", rows=3)
# column of operators for active pose
# - goes beside list

View File

@ -3446,7 +3446,6 @@ class VIEW3D_MT_pose(Menu):
layout.separator()
layout.menu("VIEW3D_MT_pose_library")
layout.menu("VIEW3D_MT_pose_motion")
layout.menu("VIEW3D_MT_pose_group")
@ -3528,21 +3527,6 @@ class VIEW3D_MT_pose_propagate(Menu):
layout.operator("pose.propagate", text="On Selected Markers").mode = 'SELECTED_MARKERS'
class VIEW3D_MT_pose_library(Menu):
bl_label = "Pose Library"
def draw(self, _context):
layout = self.layout
layout.operator("poselib.browse_interactive", text="Browse Poses...")
layout.separator()
layout.operator("poselib.pose_add", text="Add Pose...")
layout.operator("poselib.pose_rename", text="Rename Pose...")
layout.operator("poselib.pose_remove", text="Remove Pose...")
class VIEW3D_MT_pose_motion(Menu):
bl_label = "Motion Paths"
@ -7683,7 +7667,6 @@ classes = (
VIEW3D_MT_pose_transform,
VIEW3D_MT_pose_slide,
VIEW3D_MT_pose_propagate,
VIEW3D_MT_pose_library,
VIEW3D_MT_pose_motion,
VIEW3D_MT_pose_group,
VIEW3D_MT_pose_ik,