bugfix
authorCampbell Barton <ideasman42@gmail.com>
Wed, 28 May 2008 00:44:41 +0000 (00:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 28 May 2008 00:44:41 +0000 (00:44 +0000)
* python api render() would clamp the endframe to a short.
* python api's render() and renderAnim() would not render compositing because the name they gave to RE_NewRender was NOT G.scene->id.name, added comments to
G.scene->id.name

source/blender/python/api2_2x/sceneRender.c
source/blender/render/intern/source/pipeline.c

index f54c2cd4e3bf595f0788340e38b4c904b036d3b6..bfad069f9434ad88ea467e02b8f48875ec510391 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,
index fb699f5b38273e7f085c3ff1b279604f4106e313..ebb52c491323d2f71141f43dd9781004c3c79b96 100644 (file)
@@ -993,6 +993,7 @@ RenderStats *RE_GetStats(Render *re)
        return &re->i;
 }
 
+/* Note, when rendering from a scene, ALWAYS use G.scene->id.name, else compositing wont work */
 Render *RE_NewRender(const char *name)
 {
        Render *re;