[Bf-blender-cvs] [97f6bff] master: Propagate Pose: Added 'Selected Keyframes' mode

Joshua Leung noreply at git.blender.org
Thu Apr 2 12:50:21 CEST 2015


Commit: 97f6bff45aa9259b9123272eacc03ba9bc4444d4
Author: Joshua Leung
Date:   Thu Apr 2 23:30:30 2015 +1300
Branches: master
https://developer.blender.org/rB97f6bff45aa9259b9123272eacc03ba9bc4444d4

Propagate Pose: Added 'Selected Keyframes' mode

This commit adds a new mode for the Propagate Pose tool. With this new option,
the Propagate Pose will copy the current pose over to all selected keyframes
after the current frame.

For reference, some of the other/existing options are: to copy it to each subsequent
keyframe with the same value (WHILE_HELD - the default), to the next keyframe,
or to the last keyframe.

===================================================================

M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/editors/armature/pose_slide.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 9de4017..6b9e4b8 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1933,6 +1933,10 @@ class VIEW3D_MT_pose_propagate(Menu):
 
         layout.separator()
 
+        layout.operator("pose.propagate", text="On Selected Keyframes").mode = 'SELECTED_KEYS'
+
+        layout.separator()
+
         layout.operator("pose.propagate", text="On Selected Markers").mode = 'SELECTED_MARKERS'
 
 
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c
index 5f9f24d..17ef62b 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -898,6 +898,8 @@ typedef enum ePosePropagate_Termination {
 	/* stop when we run out of keyframes */
 	POSE_PROPAGATE_BEFORE_END,
 	
+	/* only do on keyframes that are selected */
+	POSE_PROPAGATE_SELECTED_KEYS,
 	/* only do on the frames where markers are selected */
 	POSE_PROPAGATE_SELECTED_MARKERS
 } ePosePropagate_Termination;
@@ -1137,6 +1139,11 @@ static void pose_propagate_fcurve(wmOperator *op, Object *ob, FCurve *fcu,
 			if (ce == NULL)
 				continue;
 		}
+		else if (mode == POSE_PROPAGATE_SELECTED_KEYS) {
+			/* only allow if this keyframe is already selected - skip otherwise */
+			if (BEZSELECTED(bezt) == 0)
+				continue;
+		}
 		
 		/* just flatten handles, since values will now be the same either side... */
 		/* TODO: perhaps a fade-out modulation of the value is required here (optional once again)? */
@@ -1224,6 +1231,7 @@ void POSE_OT_propagate(wmOperatorType *ot)
 		{POSE_PROPAGATE_LAST_KEY, "LAST_KEY", 0, "To Last Keyframe", "Propagate pose to the last keyframe only (i.e. making action cyclic)"},
 		{POSE_PROPAGATE_BEFORE_FRAME, "BEFORE_FRAME", 0, "Before Frame", "Propagate pose to all keyframes between current frame and 'Frame' property"},
 		{POSE_PROPAGATE_BEFORE_END, "BEFORE_END", 0, "Before Last Keyframe", "Propagate pose to all keyframes from current frame until no more are found"},
+		{POSE_PROPAGATE_SELECTED_KEYS, "SELECTED_KEYS", 0, "On Selected Keyframes", "Propagate pose to all keyframes that are selected"},
 		{POSE_PROPAGATE_SELECTED_MARKERS, "SELECTED_MARKERS", 0, "On Selected Markers", "Propagate pose to all keyframes occurring on frames with Scene Markers after the current frame"},
 		{0, NULL, 0, NULL, NULL}};




More information about the Bf-blender-cvs mailing list