[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13411] trunk/blender/source/blender/ python/api2_2x: added function to get the full path for a rendered frame ( before its rendered)
Campbell Barton
ideasman42 at gmail.com
Sat Jan 26 16:38:06 CET 2008
Revision: 13411
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13411
Author: campbellbarton
Date: 2008-01-26 16:38:06 +0100 (Sat, 26 Jan 2008)
Log Message:
-----------
added function to get the full path for a rendered frame (before its rendered)
Modified Paths:
--------------
trunk/blender/source/blender/python/api2_2x/doc/Render.py
trunk/blender/source/blender/python/api2_2x/sceneRender.c
Modified: trunk/blender/source/blender/python/api2_2x/doc/Render.py
===================================================================
--- trunk/blender/source/blender/python/api2_2x/doc/Render.py 2008-01-26 11:29:44 UTC (rev 13410)
+++ trunk/blender/source/blender/python/api2_2x/doc/Render.py 2008-01-26 15:38:06 UTC (rev 13411)
@@ -432,6 +432,15 @@
sequences.
"""
+ def getFrameFilename( frame ):
+ """
+ Get the filename used for the remdered image.
+ @type frame: int
+ @param path: the frame to use in the filename, if no argument given, use the current frame.
+ @rtype: string
+ @return: Returns the filename that blender would render to, taking into account output path, extension and frame number.
+ """
+
def setBackbufPath(path):
"""
Set the path to a background image and load it.
Modified: trunk/blender/source/blender/python/api2_2x/sceneRender.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/sceneRender.c 2008-01-26 11:29:44 UTC (rev 13410)
+++ trunk/blender/source/blender/python/api2_2x/sceneRender.c 2008-01-26 15:38:06 UTC (rev 13411)
@@ -2201,6 +2201,19 @@
return 0;
}
+static PyObject *RenderData_getFrameFilename( BPy_RenderData * self, PyObject *args )
+{
+ char name[FILE_MAX];
+ int frame = self->renderContext->cfra;
+
+ if( !PyArg_ParseTuple( args, "|i", &( frame ) ) )
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected int argument or nothing" ) );
+
+ BKE_makepicstring(name, self->renderContext->pic, frame, self->renderContext->imtype);
+ return PyString_FromString( name );
+}
+
PyObject *RenderData_getBackbufPath( BPy_RenderData * self )
{
return PyString_FromString( self->renderContext->backbuf );
@@ -2726,6 +2739,9 @@
{"getRenderPath", ( PyCFunction ) RenderData_getRenderPath,
METH_NOARGS,
"() - get the path to directory where rendered images will go"},
+ {"getFrameFilename", ( PyCFunction ) RenderData_getFrameFilename,
+ METH_VARARGS,
+ "() - get the filename of the frame this will be rendered, taking into account extension and frame range"},
{"setBackbufPath", ( PyCFunction ) RenderData_SetBackbufPath,
METH_VARARGS,
"(string) - get/set the path to a background image and load it"},
More information about the Bf-blender-cvs
mailing list