From a824c076b7b2c052603b738c44e9b27d04f7d2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 4 Apr 2022 14:34:58 +0200 Subject: 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 --- .../startup/bl_ui/properties_data_armature.py | 33 ++++++++++++++++++---- release/scripts/startup/bl_ui/space_view3d.py | 17 ----------- 2 files changed, 28 insertions(+), 22 deletions(-) (limited to 'release/scripts/startup/bl_ui') diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index f8a2cbfed1e..e436fe0b18d 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -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 diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index a0336f7e7bf..3c663f1371a 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -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, -- cgit v1.2.3