A bunch of fixes for Pose Library while checking on T51607
* Display a warning above the pose list if the pose library is in an invalid state (i.e. when it has keyframes but no pose-markers associated with those keyframes). This warning prompts users to run the "Sanitize Pose Library Action" operator, which should fix up such issues. * "Sanitize" operator now creates unique names for each newly create pose marker it generates, including the frame on which it found the pose
This commit is contained in:
parent
cd3b3e4a57
commit
085ed00e42
|
@ -178,6 +178,10 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
|
||||||
layout.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
|
layout.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
|
||||||
|
|
||||||
if poselib:
|
if poselib:
|
||||||
|
# warning about poselib being in an invalid state
|
||||||
|
if len(poselib.fcurves) > 0 and len(poselib.pose_markers) == 0:
|
||||||
|
layout.label(icon='ERROR', text="Error: Potentially corrupt library, run 'Sanitize' operator to fix")
|
||||||
|
|
||||||
# list of poses in pose library
|
# list of poses in pose library
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_list("UI_UL_list", "pose_markers", poselib, "pose_markers",
|
row.template_list("UI_UL_list", "pose_markers", poselib, "pose_markers",
|
||||||
|
|
|
@ -328,7 +328,7 @@ static int poselib_sanitize_exec(bContext *C, wmOperator *op)
|
||||||
/* add pose to poselib */
|
/* add pose to poselib */
|
||||||
marker = MEM_callocN(sizeof(TimeMarker), "ActionMarker");
|
marker = MEM_callocN(sizeof(TimeMarker), "ActionMarker");
|
||||||
|
|
||||||
BLI_strncpy(marker->name, "Pose", sizeof(marker->name));
|
BLI_snprintf(marker->name, sizeof(marker->name), "F%d Pose", (int)ak->cfra);
|
||||||
|
|
||||||
marker->frame = (int)ak->cfra;
|
marker->frame = (int)ak->cfra;
|
||||||
marker->flag = -1;
|
marker->flag = -1;
|
||||||
|
|
Loading…
Reference in New Issue