Tomato Cycles: fix for wrong resolution used for rendering Render Layer node

Issue was caused by Cycles using render options from rendering scene, not
from active scene.

For now solved by passing render resolution inside RenderEngine structure.
This probably could be solved in more general way, like adding bindings

for RenderEngine->Render, which would avoid passing options like
is_animation, came_override and so via RenderEngine. Would think about
this a bit more and probably would do that.

The same issue happens in trunk as well, but not consider such a change
trunk-ready, would want to make more tests and probably clean the code
a little bit before commiting this into trunk.
This commit is contained in:
Sergey Sharybin
2012-07-27 12:16:23 +00:00
parent a63ffa9ae3
commit 5e90606b17
4 changed files with 16 additions and 3 deletions

View File

@@ -45,10 +45,10 @@ BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::UserPreferences b
b_v3d(PointerRNA_NULL), b_rv3d(PointerRNA_NULL)
{
/* offline render */
BL::RenderSettings r = b_scene.render();
width = (int)(r.resolution_x()*r.resolution_percentage()/100);
height = (int)(r.resolution_y()*r.resolution_percentage()/100);
width = b_engine.resolution_x();
height = b_engine.resolution_y();
background = true;
last_redraw_time = 0.0f;

View File

@@ -367,6 +367,14 @@ static void rna_def_render_engine(BlenderRNA *brna)
prop = RNA_def_property(srna, "tile_y", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "tile_y");
prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolution_x");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "resolution_y");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* registration */
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);

View File

@@ -92,6 +92,8 @@ typedef struct RenderEngine {
struct Render *re;
ListBase fullresult;
char *text;
int resolution_x, resolution_y;
} RenderEngine;
RenderEngine *RE_engine_create(RenderEngineType *type);

View File

@@ -341,6 +341,9 @@ int RE_engine_render(Render *re, int do_all)
engine->flag |= RE_ENGINE_PREVIEW;
engine->camera_override = re->camera_override;
engine->resolution_x = re->winx;
engine->resolution_y = re->winy;
if ((re->r.scemode & (R_NO_FRAME_UPDATE | R_PREVIEWBUTS)) == 0)
BKE_scene_update_for_newframe(re->main, re->scene, re->lay);