Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2011-02-04 14:43:30 +0300
committerJoshua Leung <aligorith@gmail.com>2011-02-04 14:43:30 +0300
commitdeefe528215440466992c61e44297fedd5ba9b46 (patch)
treed2f42cd5d058b44836f2959bb46169547f852960 /source/blender/editors/armature
parent2ef93b1d9226db3ea09d67e207650bddfcda98a2 (diff)
Quick Animation Feature: Paste Pose "Selection Mask" option
After discussions with ZanQdo, it was agreed that the current workflow for making a pose symmetrical was a bit too cumbersome, especially when auto-keying was enabled, requiring pasting the flipped pose on another frame so that the changes could be merged back in without overwriting the "good" half of the rig. This option for the Paste Pose operator makes things easier, by adding an option which will make the pose only get pasted on to selected bones instead of overriding the entire pose. By default this option is turned off, but can be easily enabled either from the toolbar (operator properties) or through the F6 popup. The intended workflow with this option for making a rig symmetrical is now: 1) Copy pose 2) Select "bad" bones 3) Paste Flipped 4) Enable "On Selected Only" for the operator If there is sufficient interest, this option can even be enabled by default. But, we'll see about that later
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/poseobject.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 2913f001d48..6115f322d08 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -932,6 +932,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op)
Object *ob= ED_object_pose_armature(CTX_data_active_object(C));
bPoseChannel *chan, *pchan;
int flip= RNA_boolean_get(op->ptr, "flipped");
+ int selOnly= RNA_boolean_get(op->ptr, "selected_mask");
/* sanity checks */
if ELEM(NULL, ob, ob->pose)
@@ -945,17 +946,28 @@ static int pose_paste_exec (bContext *C, wmOperator *op)
/* Safely merge all of the channels in the buffer pose into any existing pose */
for (chan= g_posebuf->chanbase.first; chan; chan=chan->next) {
if (chan->flag & POSE_KEY) {
- /* get the name - if flipping, we must flip this first */
char name[32];
+ short paste_ok;
+
+ /* get the name - if flipping, we must flip this first */
if (flip)
flip_side_name(name, chan->name, 0); /* 0 = don't strip off number extensions */
else
BLI_strncpy(name, chan->name, sizeof(name));
- /* only copy when channel exists, poses are not meant to add random channels to anymore */
+ /* only copy when:
+ * 1) channel exists - poses are not meant to add random channels to anymore
+ * 2) if selection-masking is on, channel is selected - only selected bones get pasted on, allowing making both sides symmetrical
+ */
pchan= get_pose_channel(ob->pose, name);
- if (pchan) {
+ if (selOnly)
+ paste_ok= ((pchan) && (pchan->bone->flag & BONE_SELECTED));
+ else
+ paste_ok= ((pchan != NULL));
+
+ /* continue? */
+ if (paste_ok) {
/* only loc rot size
* - only copies transform info for the pose
*/
@@ -1098,6 +1110,7 @@ void POSE_OT_paste (wmOperatorType *ot)
/* properties */
RNA_def_boolean(ot->srna, "flipped", 0, "Flipped on X-Axis", "Paste the stored pose flipped on to current pose");
+ RNA_def_boolean(ot->srna, "selected_mask", 0, "On Selected Only", "Only paste the stored post on to selected bones in the current pose");
}
/* ********************************************** */