Patch by matd (on irc).
authorMartin Poirier <theeth@yahoo.com>
Sun, 7 Feb 2010 18:06:12 +0000 (18:06 +0000)
committerMartin Poirier <theeth@yahoo.com>
Sun, 7 Feb 2010 18:06:12 +0000 (18:06 +0000)
Disables save buffers and full sample when render border is turned on (render doesn't work otherwise because save buffers doesn't support border rendering).

release/scripts/ui/properties_render.py
source/blender/makesrna/intern/rna_scene.c
source/blender/render/intern/source/pipeline.c

index ea12e4d42c4308f5ddee5c9e211c6dd0dcd556f9..c7f8ddd052cfe7440f6e0ef82e1c62624d30fb55 100644 (file)
@@ -222,8 +222,8 @@ class RENDER_PT_performance(RenderButtonsPanel):
             col = split.column()
         col.label(text="Memory:")
         sub = col.column()
+        sub.enabled = not (rd.use_border or rd.full_sample) 
         sub.prop(rd, "save_buffers")
-        sub.enabled = not rd.full_sample
         sub = col.column()
         sub.active = rd.use_compositing
         sub.prop(rd, "free_image_textures")
@@ -454,7 +454,9 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
 
         col = split.column()
         col.row().prop(rd, "antialiasing_samples", expand=True)
-        col.prop(rd, "full_sample")
+        sub = col.row() 
+        sub.enabled = not rd.use_border
+        sub.prop(rd, "full_sample")
 
         if wide_ui:
             col = split.column()
index f99946b63a6077422e754ad09762f4186e8a8f6e..11aff7922c7e13724592fcdeb0318b87f71a76bd 100644 (file)
@@ -352,10 +352,19 @@ static int rna_SceneRenderData_threads_get(PointerRNA *ptr)
 }
 
 static int rna_SceneRenderData_save_buffers_get(PointerRNA *ptr)
+{
+       RenderData *rd= (RenderData*)ptr->data;
+       if(rd->mode & R_BORDER)
+               return 0;
+       else
+               return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
+}
+
+static int rna_SceneRenderData_full_sample_get(PointerRNA *ptr)
 {
        RenderData *rd= (RenderData*)ptr->data;
 
-       return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0;
+       return (rd->scemode & R_FULL_SAMPLE) && !(rd->mode & R_BORDER);
 }
 
 static void rna_SceneRenderData_file_format_set(PointerRNA *ptr, int value)
@@ -2175,7 +2184,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
        
        prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER);
-       RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size.");
+       RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size. Note, this disables save_buffers and full_sample.");
        RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
 
        prop= RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE);
@@ -2268,6 +2277,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
        
        prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE);
+       RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_full_sample_get", NULL);
        RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing.");
        RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
        
index db8d7e317a08b948814eca8b37185384ec5dff61..f679b35c627dfa5ed7f618901188222799762a53 100644 (file)
@@ -1227,6 +1227,13 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *
 #ifdef WITH_OPENEXR
        if(re->r.scemode & R_FULL_SAMPLE)
                re->r.scemode |= R_EXR_TILE_FILE;       /* enable automatic */
+
+       /* Until use_border is made compatible with save_buffers/full_sample, render without the later instead of not rendering at all.*/
+       if(re->r.mode & R_BORDER) 
+       {
+               re->r.scemode &= ~(R_EXR_TILE_FILE|R_FULL_SAMPLE);
+       }
+
 #else
        /* can't do this without openexr support */
        re->r.scemode &= ~(R_EXR_TILE_FILE|R_FULL_SAMPLE);
@@ -2608,10 +2615,6 @@ static int is_rendering_allowed(Render *re)
                        re->error(re->erh, "No border area selected.");
                        return 0;
                }
-               if(re->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) {
-                       re->error(re->erh, "Border render and Buffer-save not supported yet");
-                       return 0;
-               }
        }
        
        if(re->r.scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) {