"Render to image editor" to render to Buttons Window as the last alternative:
authorJuho Vepsalainen <bebraw@gmail.com>
Tue, 3 Jul 2007 11:39:36 +0000 (11:39 +0000)
committerJuho Vepsalainen <bebraw@gmail.com>
Tue, 3 Jul 2007 11:39:36 +0000 (11:39 +0000)
"Render to image editor" renders to Buttons Window only if no other suitable
windows are available. Other window types are prioritized before Buttons
Window.

source/blender/src/drawimage.c

index 188f48bcdca1adb96d2255590b02a4b291b20eb7..dbf9f6fd8be29d0225f123408fe55c104b6f874c 100644 (file)
@@ -2105,20 +2105,31 @@ static void imagewindow_clear_display_cb(RenderResult *rr)
        }
 }
 
+/* returns biggest area that is not uv/image editor. Note that it uses buttons */
+/* window as the last possible alternative.                                                                       */
 static ScrArea *biggest_non_image_area(void)
 {
        ScrArea *sa, *big= NULL;
-       int size, maxsize= 0;
+       int size, maxsize= 0, bwmaxsize= 0;
+       short foundwin= 0;
        
        for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
-               if(sa->spacetype!=SPACE_IMAGE) {
+               if(sa->winx > 10 && sa->winy > 10) {
                        size= sa->winx*sa->winy;
-                       if(sa->winx > 10 && sa->winy > 10 && size > maxsize) {
+                       if(sa->spacetype == SPACE_BUTS) {
+                               if(foundwin == 0 && size > bwmaxsize) {
+                                       bwmaxsize= size;
+                                       big= sa;        
+                               }
+                       }
+                       else if(sa->spacetype != SPACE_IMAGE && size > maxsize) {
                                maxsize= size;
                                big= sa;
+                               foundwin= 1;
                        }
                }
        }
+               
        return big;
 }