optimization: manipulator was looping over all objects on redraw when the active...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 25 Jul 2013 08:36:35 +0000 (08:36 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 25 Jul 2013 08:36:35 +0000 (08:36 +0000)
source/blender/editors/transform/transform_orientations.c

index c6cc7bc133084493393535d5af79a05171081c7d..47a63bdb06399d91f029b030177e8139dfd0731e 100644 (file)
@@ -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;
                                }