Bugfix: yafray number of processors was not properly initialized, and
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 17 Feb 2008 22:11:05 +0000 (22:11 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 17 Feb 2008 22:11:05 +0000 (22:11 +0000)
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.

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

index b9d061b6a96f02965ac793e94abcc2744ba9634d..aa96d5d68202418df5936d44296de1921612cc6b 100644 (file)
@@ -281,7 +281,7 @@ typedef struct RenderData {
        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;
 
index 255ec4825e510e678a6931647075df9ffe748688..d0d9f7280d612e11a2f9028302466caca684d089 100644 (file)
@@ -369,8 +369,6 @@ class RenderData:
   @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 @@ class RenderData:
     @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.
index bf940512f670acaf13e591ac485eaaddc463d4b8..2d73d4fc8b74ab9976514e6c3d98475f1aa65c1d 100644 (file)
@@ -1378,18 +1378,6 @@ static PyObject *RenderData_getYafrayAntiAliasingThreshold( BPy_RenderData * sel
        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 @@ PyObject *RenderData_YafrayExposure( BPy_RenderData * self, PyObject * args )
                                              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 @@ static PyGetSetDef BPy_RenderData_getseters[] = {
         (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 @@ static PyMethodDef BPy_RenderData_methods[] = {
        {"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"},
index 99b4ddb4623fdcd876b2b33d36afa400ba281772..9c81c5a5fb7e0e423eeda442724e799c7814f46d 100644 (file)
@@ -2652,8 +2652,6 @@ static void render_panel_yafrayGlobal()
        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");
index db84ed01ab9436d41943e7ffe13b41e0a0c851b5..ac7d2703eb84a15751c36064fcfc3e96c88bcf25 100644 (file)
@@ -2017,7 +2017,7 @@ bool yafrayFileRender_t::executeYafray(const string &xmlpath)
 {
        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 @@ bool yafrayFileRender_t::executeYafray(const string &xmlpath)
                     << " \"" << 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;
index 560294e2ffa398fbc267cae3a1eda2f36f67ecfc..abfdb5ed5dc101a2352ed6f89f60cda4794ca19b 100644 (file)
@@ -186,7 +186,7 @@ bool yafrayPluginRender_t::initExport()
                        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 @@ bool yafrayPluginRender_t::writeRender()
        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;