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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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"},
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user