diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-02-22 13:50:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-02-22 13:50:45 +0300 |
commit | 4dbf6cf204270579180b4811055740649ab2a4e7 (patch) | |
tree | 5fed6d2398980a274e0612ad2dcb18497ffb5fcc /source/blender/python | |
parent | ac5caa8536a4e587e00240a73d6104546a7224ad (diff) |
adding access to missing bake variables from python
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/api2_2x/doc/Render.py | 6 | ||||
-rw-r--r-- | source/blender/python/api2_2x/sceneRender.c | 23 |
2 files changed, 24 insertions, 5 deletions
diff --git a/source/blender/python/api2_2x/doc/Render.py b/source/blender/python/api2_2x/doc/Render.py index d0d9f7280d6..42fd5b564fe 100644 --- a/source/blender/python/api2_2x/doc/Render.py +++ b/source/blender/python/api2_2x/doc/Render.py @@ -390,11 +390,15 @@ class RenderData: @ivar bakeClear: When enabled, baking clears the image first. @type bakeClear: bool @ivar bakeToActive: When enabled, selected objects are baked onto the active object. - @type bakeToActive: bool + @type bakeToActive: bool + @ivar bakeNormalizeAO: Normalize AO bake values. + @type bakeNormalizeAO: bool @ivar bakeMargin: The pixel distance to extend baked pixels past the boundry (reduces bleeding when mipmapping) @type bakeMargin: int @ivar bakeDist: The distance in blender units to use when bakeToActive is enabled and geomtry does not overlap. @type bakeDist: float + @ivar bakeBias: The distance in blender units to bias faces further away from the object. + @type bakeBias: float """ def currentFrame(frame = None): diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c index 428a4e82548..62ddd5a33bb 100644 --- a/source/blender/python/api2_2x/sceneRender.c +++ b/source/blender/python/api2_2x/sceneRender.c @@ -90,7 +90,8 @@ enum rend_constants { EXPP_RENDER_ATTR_BAKEMARGIN, EXPP_RENDER_ATTR_BAKEMODE, EXPP_RENDER_ATTR_BAKEDIST, - EXPP_RENDER_ATTR_BAKENORMALSPACE + EXPP_RENDER_ATTR_BAKENORMALSPACE, + EXPP_RENDER_ATTR_BAKEBIAS }; #define EXPP_RENDER_ATTR_CFRA 2 @@ -1860,6 +1861,9 @@ static PyObject *RenderData_getFloatAttr( BPy_RenderData *self, void *type ) case EXPP_RENDER_ATTR_BAKEDIST: param = self->renderContext->bake_maxdist; break; + case EXPP_RENDER_ATTR_BAKEBIAS: + param = self->renderContext->bake_biasdist; + break; default: return EXPP_ReturnPyObjError( PyExc_RuntimeError, "undefined type constant in RenderData_getFloatAttr" ); @@ -1893,13 +1897,16 @@ static int RenderData_setFloatAttrClamp( BPy_RenderData *self, PyObject *value, max = 120.0f; param = &self->renderContext->frs_sec_base; break; - case EXPP_RENDER_ATTR_BAKEDIST: min = 0.0f; max = 10.0f; param = &self->renderContext->bake_maxdist; break; - + case EXPP_RENDER_ATTR_BAKEBIAS: + min = 0.0f; + max = 10.0f; + param = &self->renderContext->bake_biasdist; + break; default: return EXPP_ReturnIntError( PyExc_RuntimeError, "undefined type constant in RenderData_setFloatAttrClamp" ); @@ -2870,6 +2877,10 @@ static PyGetSetDef BPy_RenderData_getseters[] = { (getter)RenderData_getBakeMode, (setter)RenderData_setBakeMode, "Bake selection to active", (void *)R_BAKE_TO_ACTIVE}, + {"bakeNormalizeAO", + (getter)RenderData_getBakeMode, (setter)RenderData_setBakeMode, + "Bake selection to active", + (void *)R_BAKE_NORMALIZE_AO}, {"bakeMargin", (getter)RenderData_getIValueAttr, (setter)RenderData_setIValueAttrClamp, "number of pixels to use as a margin for the edges of the image", @@ -2884,7 +2895,11 @@ static PyGetSetDef BPy_RenderData_getseters[] = { (void *)EXPP_RENDER_ATTR_BAKENORMALSPACE}, {"bakeDist", (getter)RenderData_getFloatAttr, (setter)RenderData_setFloatAttrClamp, - "Distance in blender units", + "Distance (in blender units)", + (void *)EXPP_RENDER_ATTR_BAKEDIST}, + {"bakeBias", + (getter)RenderData_getFloatAttr, (setter)RenderData_setFloatAttrClamp, + "Bias towards faces further away from the object (in blender units)", (void *)EXPP_RENDER_ATTR_BAKEDIST}, {NULL,NULL,NULL,NULL,NULL} }; |