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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user