diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-20 19:06:46 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-20 19:06:46 +0400 |
commit | 874c29cea8e6f9bc411fccf2d6f4cb07e94328d0 (patch) | |
tree | 5971e577cf7c02e05a1e37b5ad058c71a6744877 /source/blender/editors/armature/poseobject.c | |
parent | 7555bfa793a2b0fc187c6211c56986f35b2d7b09 (diff) | |
parent | c5bc4e4fb1a33eda8c31f2ea02e91f32f74c8fa5 (diff) |
2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
Diffstat (limited to 'source/blender/editors/armature/poseobject.c')
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 09edc5549c1..3d8d446c579 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1237,7 +1237,6 @@ static short pose_select_same_layer (Object *ob) return changed; } - void pose_select_grouped (Scene *scene, short nr) { short changed = 0; @@ -1669,9 +1668,7 @@ void pose_special_editmenu(Scene *scene) pose_clear_paths(ob); } else if(nr==5) { - rest_pose(ob->pose); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - BIF_undo_push("Clear User Transform Pose"); + pose_clear_user_transforms(scene, ob); } else if(nr==6) { pose_relax(); @@ -1682,3 +1679,29 @@ void pose_special_editmenu(Scene *scene) #endif } +/* Restore selected pose-bones to 'action'-defined pose */ +void pose_clear_user_transforms(Scene *scene, Object *ob) +{ + bArmature *arm= ob->data; + bPoseChannel *pchan; + + if (ob->pose == NULL) + return; + + /* find selected bones */ + for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + if (pchan->bone && (pchan->bone->flag & BONE_SELECTED) && (pchan->bone->layer & arm->layer)) { + /* just clear the BONE_UNKEYED flag, allowing this bone to get overwritten by actions again */ + pchan->bone->flag &= ~BONE_UNKEYED; + } + } + + /* clear pose locking flag + * - this will only clear the user-defined pose in the selected bones, where BONE_UNKEYED has been cleared + */ + ob->pose->flag |= POSE_DO_UNLOCK; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + BIF_undo_push("Clear User Transform"); +} + |