[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49290] branches/soc-2011-tomato: Tomato Cycles: fix for wrong resolution used for rendering Render Layer node

Sergey Sharybin sergey.vfx at gmail.com
Fri Jul 27 14:16:25 CEST 2012


Revision: 49290
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49290
Author:   nazgul
Date:     2012-07-27 12:16:23 +0000 (Fri, 27 Jul 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/cycles/blender/blender_session.cpp
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_render.c
    branches/soc-2011-tomato/source/blender/render/extern/include/RE_engine.h
    branches/soc-2011-tomato/source/blender/render/intern/source/external_engine.c

Modified: branches/soc-2011-tomato/intern/cycles/blender/blender_session.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/blender/blender_session.cpp	2012-07-27 11:56:36 UTC (rev 49289)
+++ branches/soc-2011-tomato/intern/cycles/blender/blender_session.cpp	2012-07-27 12:16:23 UTC (rev 49290)
@@ -45,10 +45,10 @@
   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;
 

Modified: branches/soc-2011-tomato/source/blender/makesrna/intern/rna_render.c
===================================================================
--- branches/soc-2011-tomato/source/blender/makesrna/intern/rna_render.c	2012-07-27 11:56:36 UTC (rev 49289)
+++ branches/soc-2011-tomato/source/blender/makesrna/intern/rna_render.c	2012-07-27 12:16:23 UTC (rev 49290)
@@ -367,6 +367,14 @@
 	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);

Modified: branches/soc-2011-tomato/source/blender/render/extern/include/RE_engine.h
===================================================================
--- branches/soc-2011-tomato/source/blender/render/extern/include/RE_engine.h	2012-07-27 11:56:36 UTC (rev 49289)
+++ branches/soc-2011-tomato/source/blender/render/extern/include/RE_engine.h	2012-07-27 12:16:23 UTC (rev 49290)
@@ -92,6 +92,8 @@
 	struct Render *re;
 	ListBase fullresult;
 	char *text;
+
+	int resolution_x, resolution_y;
 } RenderEngine;
 
 RenderEngine *RE_engine_create(RenderEngineType *type);

Modified: branches/soc-2011-tomato/source/blender/render/intern/source/external_engine.c
===================================================================
--- branches/soc-2011-tomato/source/blender/render/intern/source/external_engine.c	2012-07-27 11:56:36 UTC (rev 49289)
+++ branches/soc-2011-tomato/source/blender/render/intern/source/external_engine.c	2012-07-27 12:16:23 UTC (rev 49290)
@@ -341,6 +341,9 @@
 		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);
 




More information about the Bf-blender-cvs mailing list