diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-07-12 15:18:34 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-07-12 15:18:34 +0400 |
commit | da0ea308665e4ccdddaf3ab97893de13362f1cf5 (patch) | |
tree | 9b27dba31d8689c283a4eae30975334e7f471617 /source/blender/editors/space_view3d/view3d_snap.c | |
parent | ce172d60ce2c65bc72ca13804b9ddda21c137aa5 (diff) |
Get rid of global originmat matrix from object.c
This matrix was used to store the space the object is in,
which then was accessed by snapping code. No reason to
keep it as a global variable (which isn't safe for threading,
unlikely it'll give issues now, but it's easy to avoid
issues early here).
Now made it so BKE_object_where_is_calc_ex will get an
optional parameter originmat and set this matrix in
solve_parent.
Original patch by self, minor changes by Campbell, thanks!
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_snap.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 1678487d8bf..e9aca8d4640 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -74,8 +74,6 @@ #include "view3d_intern.h" -extern float originmat[3][3]; /* XXX object.c */ - /* ************************************************** */ /* ********************* old transform stuff ******** */ /* *********** will get replaced with new transform * */ @@ -628,7 +626,8 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op)) vec[2] = -ob->obmat[3][2] + gridf * floorf(0.5f + ob->obmat[3][2] / gridf); if (ob->parent) { - BKE_object_where_is_calc(scene, ob); + float originmat[3][3]; + BKE_object_where_is_calc_ex(scene, NULL, ob, originmat); invert_m3_m3(imat, originmat); mul_m3_v3(imat, vec); @@ -751,7 +750,8 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op)) vec[2] = -ob->obmat[3][2] + curs[2]; if (ob->parent) { - BKE_object_where_is_calc(scene, ob); + float originmat[3][3]; + BKE_object_where_is_calc_ex(scene, NULL, ob, originmat); invert_m3_m3(imat, originmat); mul_m3_v3(imat, vec); |