soc-2008-mxcurioni: merged changes to revision 15163
[blender-staging.git] / source / blender / python / api2_2x / sceneRender.c
index 44cc8f56a1a59198e29e31f118838e0216024c96..2174c435405ab1c46208eceaae38c6c12c589ddf 100644 (file)
@@ -478,9 +478,11 @@ PyObject *RenderData_Render( BPy_RenderData * self )
        }
 
        else { /* background mode (blender -b file.blend -P script) */
-               Render *re= RE_NewRender("Render");
+               Render *re= RE_NewRender(G.scene->id.name);
 
-               int end_frame = G.scene->r.efra; /* is of type short currently */
+
+
+               int end_frame = G.scene->r.efra;
 
                if (G.scene != self->scene)
                        return EXPP_ReturnPyObjError (PyExc_RuntimeError,
@@ -490,7 +492,7 @@ PyObject *RenderData_Render( BPy_RenderData * self )
 
                RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra);
 
-               G.scene->r.efra = (short)end_frame;
+               G.scene->r.efra = end_frame;
        }
 
        Py_RETURN_NONE;
@@ -571,7 +573,7 @@ PyObject *RenderData_RenderAnim( BPy_RenderData * self )
                set_scene( oldsce );
        }
        else { /* background mode (blender -b file.blend -P script) */
-               Render *re= RE_NewRender("Render");
+               Render *re= RE_NewRender(G.scene->id.name);
                
                if (G.scene != self->scene)
                        return EXPP_ReturnPyObjError (PyExc_RuntimeError,
@@ -2048,7 +2050,7 @@ static int RenderData_setIValueAttrClamp( BPy_RenderData *self, PyObject *value,
                break;
        case EXPP_RENDER_ATTR_BAKEMODE:
                min = RE_BAKE_LIGHT;
-               max = RE_BAKE_DISPLACEMENT;
+               max = RE_BAKE_SHADOW;
                size = 'h';
                param = &self->renderContext->bake_mode;
                break;
@@ -3781,6 +3783,7 @@ static PyObject *M_Render_BakeModesDict( void )
                PyConstant_Insert( d, "NORMALS", PyInt_FromLong( RE_BAKE_NORMALS ) );
                PyConstant_Insert( d, "TEXTURE", PyInt_FromLong( RE_BAKE_TEXTURE ) );
                PyConstant_Insert( d, "DISPLACEMENT", PyInt_FromLong( RE_BAKE_DISPLACEMENT ) );
+               PyConstant_Insert( d, "SHADOW", PyInt_FromLong( RE_BAKE_SHADOW ) );
        }
        return M;
 }