Tuesday merger of bf-blender into orange branch.
[blender-staging.git] / source / blender / src / buttons_scene.c
index ff83a457d33f79cb642141290cbd6f125e5a1c07..0e76593aeafaee52a1eb845cc6ab665597d2fc1a 100644 (file)
@@ -347,7 +347,7 @@ static void sound_panel_sound(bSound *sound)
        
        // warning: abuse of texnr here! (ton didnt code!)
        buttons_active_id(&id, &idfrom);
-       std_libbuttons(block, 10, 160, 0, NULL, B_SOUNDBROWSE2, id, idfrom, &(G.buts->texnr), 1, 0, 0, 0, 0);
+       std_libbuttons(block, 10, 160, 0, NULL, B_SOUNDBROWSE2, ID_SO, 0, id, idfrom, &(G.buts->texnr), 1, 0, 0, 0, 0);
 
        if (sound) {
        
@@ -957,7 +957,7 @@ static char *imagetype_pup(void)
        char formatstring[1024];
        char appendstring[1024];
 
-       strcpy(formatstring, "Save image as: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d");
+       strcpy(formatstring, "Save image as: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d");
 
 #ifdef __sgi
        strcat(formatstring, "|%s %%x%d");      // add space for Movie
@@ -994,11 +994,10 @@ static char *imagetype_pup(void)
                        "HamX",           R_HAMX,
                        "Iris",           R_IRIS,
                        "Iris + Zbuffer", R_IRIZ,
-                       "Radiance HDR",   R_RADHDR,
+                       "Radiance HDR",   R_RADHDR
 #ifdef __sgi
-                       "Movie",          R_MOVIE,
+                       ,"Movie",          R_MOVIE
 #endif
-                       "Ftype",          R_FTYPE
                );
        } else {
                sprintf(string, formatstring,
@@ -1015,14 +1014,19 @@ static char *imagetype_pup(void)
                        "HamX",           R_HAMX,
                        "Iris",           R_IRIS,
                        "Iris + Zbuffer", R_IRIZ,
-                       "Radiance HDR",   R_RADHDR,
+                       "Radiance HDR",   R_RADHDR
 #ifdef __sgi
-                       "Movie",          R_MOVIE,
+                       ,"Movie",          R_MOVIE
 #endif
-                       "Ftype",          R_FTYPE
                );
        }
 
+#ifdef WITH_OPENEXR
+       strcpy(formatstring, "|%s %%x%d");
+       sprintf(appendstring, formatstring, "OpenEXR", R_OPENEXR);
+       strcat(string, appendstring);
+#endif
+       
        if (G.have_libtiff) {
                strcpy(formatstring, "|%s %%x%d");
                sprintf(appendstring, formatstring, "TIFF", R_TIFF);
@@ -1249,12 +1253,13 @@ static void render_panel_format(void)
 
 #ifdef __sgi
        yofs = 76;
-       uiDefButS(block, NUM,B_DIFF,"MaxSize:", 892,32,165,20, &G.scene->r.maximsize, 0.0, 500.0, 0, 0, "Maximum size per frame to save in an SGI movie");
-       uiDefButBitI(block, TOG, R_COSMO, 0,"Cosmo", 1059,32,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Attempt to save SGI movies using Cosmo hardware");
+       uiDefButS(block, NUM,B_DIFF,"MaxSize:",                 892,32,165,20, &G.scene->r.maximsize, 0.0, 500.0, 0, 0, "Maximum size per frame to save in an SGI movie");
+       uiDefButBitI(block, TOG, R_COSMO, 0,"Cosmo",    1059,32,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Attempt to save SGI movies using Cosmo hardware");
 #endif
 
+       
        uiDefButS(block, MENU,B_FILETYPEMENU,imagetype_pup(),   892,yofs,174,20, &G.scene->r.imtype, 0, 0, 0, 0, "Images are saved in this file format");
-       uiDefButBitI(block, TOG, R_MOVIECROP, B_DIFF, "Crop",          1068,yofs,51,20, &G.scene->r.mode, 0, 0, 0, 0, "Exclude border rendering from total image");
+       uiDefButBitI(block, TOG, R_MOVIECROP, B_DIFF, "Crop",   1068,yofs,51,20, &G.scene->r.mode, 0, 0, 0, 0, "Exclude border rendering from total image");
 
        yofs -= 22;
 
@@ -1288,7 +1293,23 @@ static void render_panel_format(void)
 #endif
                        uiDefBut(block, BUT,B_SELECTCODEC, "Set codec",  892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for AVI");
                }
+#ifdef WITH_OPENEXR
+       } 
+       else if (G.scene->r.imtype == R_OPENEXR ) {
+               if (G.scene->r.quality > 5) G.scene->r.quality = 0;
+               
+               uiBlockBeginAlign(block);
+               uiDefButBitS(block, TOG, R_OPENEXR_HALF, B_NOP,"Half",  892,yofs+44,60,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Use 16 bits float 'Half' type");
+               uiDefButBitS(block, TOG, R_OPENEXR_ZBUF, B_NOP,"Zbuf",  952,yofs+44,60,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Save the zbuffer as 32 bits unsigned int");
+               uiBlockEndAlign(block);
+               
+               uiDefButS(block, MENU,B_NOP, "Codec %t|None %x0|Pxr24 (lossy) %x1|ZIP (lossless) %x2|PIZ (lossless) %x3|RLE (lossless) %x4",  
+                                                                                                                       892,yofs,112,20, &G.scene->r.quality, 0, 0, 0, 0, "Set codec settings for OpenEXR");
+               
+#endif
        } else {
+               if(G.scene->r.quality < 5) G.scene->r.quality = 90;     /* restore from openexr */
+               
                uiDefButS(block, NUM,B_DIFF, "Quality:",           892,yofs,112,20, &G.scene->r.quality, 10.0, 100.0, 0, 0, "Quality setting for JPEG images, AVI Jpeg and SGI movies");
        }
        uiDefButS(block, NUM,B_FRAMEMAP,"Frs/sec:",   1006,yofs,113,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second");