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:
authorCampbell Barton <ideasman42@gmail.com>2012-01-17 21:08:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-17 21:08:32 +0400
commit47b9f5d8f83e330342fd22c5b56b2623bde06d8c (patch)
tree0446fc03fdfbc2d34c1fbfb1c80bb7ccae286675 /source/blender/editors/space_view3d/view3d_snap.c
parentb805334cc283ea0126f81078830a3d6dcea97e40 (diff)
parenta8081c1d2bb9115833493b011bb93d6c08112b2d (diff)
svn merge ^/trunk/blender -r43443:43461
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_snap.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 1ee0c03d5e5..2e8ddbbede4 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -564,7 +564,6 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
if(pchan->bone->layer & arm->layer) {
if((pchan->bone->flag & BONE_CONNECTED)==0) {
float nLoc[3];
- float inv_restmat[4][4];
/* get nearest grid point to snap to */
copy_v3_v3(nLoc, pchan->pose_mat[3]);
@@ -576,9 +575,8 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
/* Back in object space... */
mul_m4_v3(ob->imat, vec);
- /* get location of grid point in *rest* bone-space */
- invert_m4_m4(inv_restmat, pchan->bone->arm_mat);
- mul_m4_v3(inv_restmat, vec);
+ /* Get location of grid point in pose space. */
+ armature_loc_pose_to_bone(pchan, vec, vec);
/* adjust location */
if ((pchan->protectflag & OB_LOCK_LOCX)==0)
@@ -701,12 +699,9 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
if(pchan->bone->flag & BONE_SELECTED) {
if(pchan->bone->layer & arm->layer) {
if((pchan->bone->flag & BONE_CONNECTED)==0) {
- float inv_restmat[4][4];
-
- /* get location of cursor in *rest* bone-space */
- invert_m4_m4(inv_restmat, pchan->bone->arm_mat);
- mul_m4_v3(inv_restmat, vec);
-
+ /* Get position in pchan (pose) space. */
+ armature_loc_pose_to_bone(pchan, vec, vec);
+
/* copy new position */
if ((pchan->protectflag & OB_LOCK_LOCX)==0)
pchan->loc[0]= vec[0];