Animation: Removal of most of the old pose library
Remove most of the old (pre-3.0) pose library: - Remove The entire `editors/armature/pose_lib.c` file - Deprecate `Object::poselib` in DNA - Remove Operators marked as deprecated in T93405 - Remove RNA property `Object.pose_library` - Add comment to clarify that the call `BLO_read_id_address(reader, ob->id.lib, &ob->poselib);` handles deprecated data. Note that this functionality has been documented as deprecated since Blender 3.2. What remains of the old pose library: The DNA for action markers (`bAction::markers`) and the corresponding Python API. This will allow future versions of Blender to still convert old pose libraries to new ones (via the Pose Library panel in the Action editor). Manifest task: T93406
This commit is contained in:
parent
de9f32a666
commit
48b5dcdbe8
|
@ -154,97 +154,14 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
|
|||
sub.operator("pose.group_deselect", text="Deselect")
|
||||
|
||||
|
||||
class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
|
||||
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='URL').url = url
|
||||
|
||||
layout.separator()
|
||||
|
||||
ob = context.object
|
||||
poselib = ob.pose_library
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
|
||||
|
||||
if poselib:
|
||||
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.
|
||||
|
||||
dep_layout = layout.column()
|
||||
dep_layout.active = False
|
||||
|
||||
# warning about poselib being in an invalid state
|
||||
if poselib.fcurves and not poselib.pose_markers:
|
||||
dep_layout.label(
|
||||
icon='ERROR',
|
||||
text="Error: Potentially corrupt library, run 'Sanitize' operator to fix",
|
||||
)
|
||||
|
||||
# list of poses in pose library
|
||||
row = dep_layout.row()
|
||||
row.template_list("UI_UL_list", "pose_markers", poselib, "pose_markers",
|
||||
poselib.pose_markers, "active_index", rows=3)
|
||||
|
||||
# column of operators for active pose
|
||||
# - goes beside list
|
||||
col = row.column(align=True)
|
||||
|
||||
# invoke should still be used for 'add', as it is needed to allow
|
||||
# add/replace options to be used properly
|
||||
col.operator("poselib.pose_add", icon='ADD', text="")
|
||||
|
||||
col.operator_context = 'EXEC_DEFAULT' # exec not invoke, so that menu doesn't need showing
|
||||
|
||||
pose_marker_active = poselib.pose_markers.active
|
||||
|
||||
if pose_marker_active is not None:
|
||||
col.operator("poselib.pose_remove", icon='REMOVE', text="")
|
||||
col.operator(
|
||||
"poselib.apply_pose",
|
||||
icon='ZOOM_SELECTED',
|
||||
text="",
|
||||
).pose_index = poselib.pose_markers.active_index
|
||||
|
||||
col.operator("poselib.action_sanitize", icon='HELP', text="") # XXX: put in menu?
|
||||
|
||||
if pose_marker_active is not None:
|
||||
col.operator("poselib.pose_move", icon='TRIA_UP', text="").direction = 'UP'
|
||||
col.operator("poselib.pose_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
|
||||
|
||||
|
||||
class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
|
||||
bl_label = "Inverse Kinematics"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
bl_options = {"DEFAULT_CLOSED"}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
ob = context.object
|
||||
return (ob and ob.pose)
|
||||
return ob and ob.pose
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
@ -341,7 +258,6 @@ classes = (
|
|||
DATA_PT_skeleton,
|
||||
DATA_MT_bone_group_context_menu,
|
||||
DATA_PT_bone_groups,
|
||||
DATA_PT_pose_library,
|
||||
DATA_PT_motion_paths,
|
||||
DATA_PT_motion_paths_display,
|
||||
DATA_PT_display,
|
||||
|
|
|
@ -851,6 +851,8 @@ static void object_blend_read_lib(BlendLibReader *reader, ID *id)
|
|||
|
||||
BLO_read_id_address(reader, ob->id.lib, &ob->parent);
|
||||
BLO_read_id_address(reader, ob->id.lib, &ob->track);
|
||||
|
||||
/* XXX deprecated - old pose library, deprecated in Blender 3.5. */
|
||||
BLO_read_id_address(reader, ob->id.lib, &ob->poselib);
|
||||
|
||||
/* 2.8x drops support for non-empty dupli instances. */
|
||||
|
|
|
@ -33,7 +33,6 @@ set(SRC
|
|||
pose_backup.cc
|
||||
pose_edit.c
|
||||
pose_group.c
|
||||
pose_lib.c
|
||||
pose_lib_2.c
|
||||
pose_select.c
|
||||
pose_slide.c
|
||||
|
|
|
@ -201,21 +201,6 @@ LinkData *poseAnim_mapping_getNextFCurve(ListBase *fcuLinks, LinkData *prev, con
|
|||
/** \name PoseLib
|
||||
* \{ */
|
||||
|
||||
/* pose_lib.c */
|
||||
|
||||
void POSELIB_OT_new(struct wmOperatorType *ot);
|
||||
void POSELIB_OT_unlink(struct wmOperatorType *ot);
|
||||
|
||||
void POSELIB_OT_action_sanitize(struct wmOperatorType *ot);
|
||||
|
||||
void POSELIB_OT_pose_add(struct wmOperatorType *ot);
|
||||
void POSELIB_OT_pose_remove(struct wmOperatorType *ot);
|
||||
void POSELIB_OT_pose_rename(struct wmOperatorType *ot);
|
||||
void POSELIB_OT_pose_move(struct wmOperatorType *ot);
|
||||
|
||||
void POSELIB_OT_browse_interactive(struct wmOperatorType *ot);
|
||||
void POSELIB_OT_apply_pose(struct wmOperatorType *ot);
|
||||
|
||||
/* pose_lib_2.c */
|
||||
|
||||
void POSELIB_OT_apply_pose_asset(struct wmOperatorType *ot);
|
||||
|
|
|
@ -114,21 +114,9 @@ void ED_operatortypes_armature(void)
|
|||
WM_operatortype_append(POSE_OT_propagate);
|
||||
|
||||
/* POSELIB */
|
||||
WM_operatortype_append(POSELIB_OT_browse_interactive);
|
||||
WM_operatortype_append(POSELIB_OT_apply_pose);
|
||||
WM_operatortype_append(POSELIB_OT_apply_pose_asset);
|
||||
WM_operatortype_append(POSELIB_OT_blend_pose_asset);
|
||||
|
||||
WM_operatortype_append(POSELIB_OT_pose_add);
|
||||
WM_operatortype_append(POSELIB_OT_pose_remove);
|
||||
WM_operatortype_append(POSELIB_OT_pose_rename);
|
||||
WM_operatortype_append(POSELIB_OT_pose_move);
|
||||
|
||||
WM_operatortype_append(POSELIB_OT_new);
|
||||
WM_operatortype_append(POSELIB_OT_unlink);
|
||||
|
||||
WM_operatortype_append(POSELIB_OT_action_sanitize);
|
||||
|
||||
/* POSE SLIDING */
|
||||
WM_operatortype_append(POSE_OT_push);
|
||||
WM_operatortype_append(POSE_OT_relax);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -278,9 +278,6 @@ static void outliner_add_object_contents(SpaceOutliner *space_outliner,
|
|||
outliner_add_element(space_outliner, &te->subtree, ob, te, TSE_ANIM_DATA, 0);
|
||||
}
|
||||
|
||||
/* FIXME: add a special type for this. */
|
||||
outliner_add_element(space_outliner, &te->subtree, ob->poselib, te, TSE_SOME_ID, 0);
|
||||
|
||||
outliner_add_element(space_outliner, &te->subtree, ob->data, te, TSE_SOME_ID, 0);
|
||||
|
||||
if (ob->pose) {
|
||||
|
|
|
@ -266,8 +266,8 @@ typedef struct Object {
|
|||
/** Old animation system, deprecated for 2.5. */
|
||||
struct Ipo *ipo DNA_DEPRECATED;
|
||||
/* struct Path *path; */
|
||||
struct bAction *action DNA_DEPRECATED; /* XXX deprecated... old animation system */
|
||||
struct bAction *poselib;
|
||||
struct bAction *action DNA_DEPRECATED; /* XXX deprecated... old animation system */
|
||||
struct bAction *poselib DNA_DEPRECATED; /* Pre-Blender 3.0 pose library, deprecated in 3.5. */
|
||||
/** Pose data, armature objects only. */
|
||||
struct bPose *pose;
|
||||
/** Pointer to objects data - an 'ID' or NULL. */
|
||||
|
|
|
@ -3750,15 +3750,6 @@ static void rna_def_object(BlenderRNA *brna)
|
|||
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_GPencil_update");
|
||||
|
||||
/* pose */
|
||||
prop = RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "poselib");
|
||||
RNA_def_property_struct_type(prop, "Action");
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Pose Library",
|
||||
"Deprecated, will be removed in Blender 3.3. "
|
||||
"Action used as a pose library for armatures");
|
||||
|
||||
prop = RNA_def_property(srna, "pose", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "pose");
|
||||
RNA_def_property_struct_type(prop, "Pose");
|
||||
|
|
Loading…
Reference in New Issue