diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-28 09:00:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-28 09:00:28 +0300 |
commit | a520e7c85c83536a81ba53f7c7c6dba665ebad96 (patch) | |
tree | f124b36e58453f4460faac33da14abe005d7665c /source/blender/editors/transform/transform.c | |
parent | 1261a29fc0f8c286d1ca7d435fdfccdcd12fd4ba (diff) |
Transform: center override
Hidden option to override transform center.
Needed for manipulators that define their own center.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index ca6e2267218..0ebf24b44ce 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2878,7 +2878,9 @@ static void initBend(TransInfo *t) t->flag |= T_NO_CONSTRAINT; //copy_v3_v3(t->center, ED_view3d_cursor3d_get(t->scene, t->view)); - calculateCenterCursor(t, t->center); + if ((t->flag & T_OVERRIDE_CENTER) == 0) { + calculateCenterCursor(t, t->center); + } calculateCenterGlobal(t, t->center, t->center_global); t->val = 0.0f; @@ -8513,9 +8515,11 @@ static void initTimeScale(TransInfo *t) /* recalculate center2d to use CFRA and mouse Y, since that's * what is used in time scale */ - t->center[0] = t->scene->r.cfra; - projectFloatView(t, t->center, center); - center[1] = t->mouse.imval[1]; + if ((t->flag & T_OVERRIDE_CENTER) == 0) { + t->center[0] = t->scene->r.cfra; + projectFloatView(t, t->center, center); + center[1] = t->mouse.imval[1]; + } /* force a reinit with the center2d used here */ initMouseInput(t, &t->mouse, center, t->mouse.imval, false); |