[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13737] trunk/blender/source/blender:

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Feb 17 23:11:05 CET 2008


Revision: 13737
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13737
Author:   blendix
Date:     2008-02-17 23:11:05 +0100 (Sun, 17 Feb 2008)

Log Message:
-----------

Bugfix: yafray number of processors was not properly initialized, and
could be 0, hanging yafray. This commits removes the separate yafray
number of processor setting and simply using the blender threads
button, there is no reason for a separate setting.

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_scene_types.h
    trunk/blender/source/blender/python/api2_2x/doc/Render.py
    trunk/blender/source/blender/python/api2_2x/sceneRender.c
    trunk/blender/source/blender/src/buttons_scene.c
    trunk/blender/source/blender/yafray/intern/export_File.cpp
    trunk/blender/source/blender/yafray/intern/export_Plugin.cpp

Modified: trunk/blender/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_scene_types.h	2008-02-17 21:34:56 UTC (rev 13736)
+++ trunk/blender/source/blender/makesdna/DNA_scene_types.h	2008-02-17 22:11:05 UTC (rev 13737)
@@ -281,7 +281,7 @@
 	int GIdepth, GIcausdepth, GIpixelspersample;
 	int GIphotoncount, GImixphotons;
 	float GIphotonradius;
-	int YF_numprocs, YF_raydepth, YF_AApasses, YF_AAsamples;
+	int YF_raydepth, YF_AApasses, YF_AAsamples, yfpad2;
 	float GIshadowquality, GIrefinement, GIpower, GIindirpower;
 	float YF_gamma, YF_exposure, YF_raybias, YF_AApixelsize, YF_AAthreshold;
 

Modified: trunk/blender/source/blender/python/api2_2x/doc/Render.py
===================================================================
--- trunk/blender/source/blender/python/api2_2x/doc/Render.py	2008-02-17 21:34:56 UTC (rev 13736)
+++ trunk/blender/source/blender/python/api2_2x/doc/Render.py	2008-02-17 22:11:05 UTC (rev 13737)
@@ -369,8 +369,6 @@
   @type yafrayAntiAliasingPixelSize: float [1.0, 2.0]
   @ivar yafrayAntiAliasingThreshold: Anti-aliasing threshold.
   @type yafrayAntiAliasingThreshold: float [0.05, 1.0]
-  @ivar yafrayNumberOfProcessors: Number of processors to use.
-  @type yafrayNumberOfProcessors: int [1, 8]
   @ivar yafrayGICache: Cache occlusion/irradiance samples (faster).
   @type yafrayGICache: boolean
   @ivar yafrayGICacheBumpNormals: Enable/disable bumpnormals for cache.
@@ -1118,15 +1116,6 @@
     @return: Current exposure adjustment for the scene.
     """
 
-  def yafrayProcessorCount(count = None):
-    """
-    Get/set number of processors to use.
-    @type count: int (optional)
-    @param count: must be between 1 - 8
-    @rtype: int (if prototype is empty)
-    @return: Current number of processors for the scene.
-    """
-
   def enableGameFrameStretch():
     """
     Enable stretch or squeeze the viewport to fill the display window.

Modified: trunk/blender/source/blender/python/api2_2x/sceneRender.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/sceneRender.c	2008-02-17 21:34:56 UTC (rev 13736)
+++ trunk/blender/source/blender/python/api2_2x/sceneRender.c	2008-02-17 22:11:05 UTC (rev 13737)
@@ -1378,18 +1378,6 @@
 	return M_Render_getFloat( self, self->renderContext->YF_AAthreshold );
 }
 
-/** YafRay - Number of processors to use */
-
-static int RenderData_setYafrayNumberOfProcessors( BPy_RenderData * self, PyObject * value )
-{
-	return M_Render_setInt( self, value, &self->renderContext->YF_numprocs, 1, 8 );
-}
-
-static PyObject *RenderData_getYafrayNumberOfProcessors( BPy_RenderData * self )
-{
-	return M_Render_getInt( self, self->renderContext->YF_numprocs );
-}
-
 /* YafRay - Cache occlusion/irradiance samples (faster) */
 
 static int RenderData_setYafrayGICache( BPy_RenderData * self, PyObject * value )
@@ -1666,14 +1654,6 @@
 					      YF_exposure, 0.0f, 10.0f );
 }
 
-PyObject *RenderData_YafrayProcessorCount( BPy_RenderData * self,
-					   PyObject * args )
-{
-	return M_Render_GetSetAttributeInt( args,
-					    &self->renderContext->YF_numprocs,
-					    1, 8 );
-}
-
 PyObject *RenderData_EnableGameFrameStretch( BPy_RenderData * self )
 {
 	self->scene->framing.type = SCE_GAMEFRAMING_SCALE;
@@ -2850,10 +2830,6 @@
 	 (getter)RenderData_getYafrayAntiAliasingThreshold, (setter)RenderData_setYafrayAntiAliasingThreshold,
 	 "Anti-aliasing threshold",
 	 NULL},
-	{"yafrayNumberOfProcessors",
-	 (getter)RenderData_getYafrayNumberOfProcessors, (setter)RenderData_setYafrayNumberOfProcessors,
-	 "Number of processors to use",
-	 NULL},
 	{"yafrayGICache",
 	 (getter)RenderData_getYafrayGICache, (setter)RenderData_setYafrayGICache,
 	 "Cache occlusion/irradiance samples (faster)",
@@ -3125,9 +3101,6 @@
 	{"yafrayExposure", ( PyCFunction ) RenderData_YafrayExposure,
 	 METH_VARARGS,
 	 "(float) - get/set exposure adjustment, 0 is off"},
-	{"yafrayProcessorCount",
-	 ( PyCFunction ) RenderData_YafrayProcessorCount, METH_VARARGS,
-	 "(int) - get/set number of processors to use"},
 	{"enableGameFrameStretch",
 	 ( PyCFunction ) RenderData_EnableGameFrameStretch, METH_NOARGS,
 	 "(l) - enble stretch or squeeze the viewport to fill the display window"},

Modified: trunk/blender/source/blender/src/buttons_scene.c
===================================================================
--- trunk/blender/source/blender/src/buttons_scene.c	2008-02-17 21:34:56 UTC (rev 13736)
+++ trunk/blender/source/blender/src/buttons_scene.c	2008-02-17 22:11:05 UTC (rev 13737)
@@ -2652,8 +2652,6 @@
 	uiDefButF(block, NUMSLI, B_DIFF, "Gam ", 5,10,150,20, &G.scene->r.YF_gamma, 0.001, 5.0, 0, 0, "Gamma correction, 1 is off");
 	uiDefButF(block, NUMSLI, B_DIFF, "Exp ", 160,10,150,20,&G.scene->r.YF_exposure, 0.0, 10.0, 0, 0, "Exposure adjustment, 0 is off");
         
-	uiDefButI(block, NUM, B_DIFF, "Processors:", 160,60,150,20, &G.scene->r.YF_numprocs, 1.0, 8.0, 10, 10, "Number of processors to use");
-
 	/*AA Settings*/
 	uiDefButBitS(block, TOGN, 1, B_REDR, "Auto AA", 5,140,150,20, &G.scene->r.YF_AA, 
 					0, 0, 0, 0, "Set AA using OSA and GI quality, disable for manual control");

Modified: trunk/blender/source/blender/yafray/intern/export_File.cpp
===================================================================
--- trunk/blender/source/blender/yafray/intern/export_File.cpp	2008-02-17 21:34:56 UTC (rev 13736)
+++ trunk/blender/source/blender/yafray/intern/export_File.cpp	2008-02-17 22:11:05 UTC (rev 13737)
@@ -2017,7 +2017,7 @@
 {
 	ostr.str("");
 	if (re->r.mode & R_BORDER) {
-		ostr << command_path << "yafray -c " << re->r.YF_numprocs
+		ostr << command_path << "yafray -c " << re->r.threads
 		     << " -r " << (2.f*re->r.border.xmin - 1.f)
 		     << ":"    << (2.f*re->r.border.xmax - 1.f)
 		     << ":"    << (2.f*re->r.border.ymin - 1.f)
@@ -2025,7 +2025,7 @@
 		     << " \"" << xmlpath << "\"";
 	}
 	else
-		ostr << command_path << "yafray -c " << re->r.YF_numprocs << " \"" << xmlpath << "\"";
+		ostr << command_path << "yafray -c " << re->r.threads << " \"" << xmlpath << "\"";
 	
 	string command = ostr.str();
 	cout << "COMMAND: " << command << endl;

Modified: trunk/blender/source/blender/yafray/intern/export_Plugin.cpp
===================================================================
--- trunk/blender/source/blender/yafray/intern/export_Plugin.cpp	2008-02-17 21:34:56 UTC (rev 13736)
+++ trunk/blender/source/blender/yafray/intern/export_Plugin.cpp	2008-02-17 22:11:05 UTC (rev 13737)
@@ -186,7 +186,7 @@
 			cerr << "Error loading yafray plugin: " << PIL_dynlib_get_error_as_string(handle) << endl;
 			return false;
 		}
-		yafrayGate = constructor(re->r.YF_numprocs, YafrayPluginPath());
+		yafrayGate = constructor(re->r.threads, YafrayPluginPath());
 		
 		cout << "YafRay plugin loaded" << endl;
 		plugin_loaded = true;
@@ -246,7 +246,7 @@
 	params["bias"] = yafray::parameter_t(re->r.YF_raybias);
 	params["clamp_rgb"] = yafray::parameter_t((re->r.YF_clamprgb==0) ? "on" : "off");
 	// lynx request
-	params["threads"] = yafray::parameter_t((int)re->r.YF_numprocs);
+	params["threads"] = yafray::parameter_t((int)re->r.threads);
 	blenderYafrayOutput_t output(re);
 	yafrayGate->render(params, output);
 	cout << "render finished" << endl;





More information about the Bf-blender-cvs mailing list