diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-25 12:36:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-25 12:36:35 +0400 |
commit | aec8cff9ab730fdf525242ffbf1f4dcfd67c2bb1 (patch) | |
tree | 43920e6b461108502a8968b28fba27ec878f7d2f /source/blender/editors | |
parent | a15e9ca495df03bdbe84b37b033ba02dbf2089cb (diff) |
optimization: manipulator was looping over all objects on redraw when the active object was being used and it didn't need to.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index c6cc7bc1330..47a63bdb063 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -880,11 +880,14 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], else { /* we need the one selected object, if its not active */ ob = OBACT; - if (ob && !(ob->flag & SELECT)) ob = NULL; - - for (base = scene->base.first; base; base = base->next) { - if (TESTBASELIB(v3d, base)) { - if (ob == NULL) { + if (ob && (ob->flag & SELECT)) { + /* pass */ + } + else { + /* first selected */ + ob = NULL; + for (base = scene->base.first; base; base = base->next) { + if (TESTBASELIB(v3d, base)) { ob = base->object; break; } |