Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-01-26 18:38:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-01-26 18:38:06 +0300
commit78cedbd1f993a5ddd1687e6c49fef58d72d63beb (patch)
treee74c7684409ac4d0631ccaad964bab4e8d77a71b /source
parentd677e30a04f4983441119acdaa560c93227ed7ef (diff)
added function to get the full path for a rendered frame (before its rendered)
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/doc/Render.py9
-rw-r--r--source/blender/python/api2_2x/sceneRender.c16
2 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/doc/Render.py b/source/blender/python/api2_2x/doc/Render.py
index 7ab3d7b90a9..ddcc5a239af 100644
--- a/source/blender/python/api2_2x/doc/Render.py
+++ b/source/blender/python/api2_2x/doc/Render.py
@@ -432,6 +432,15 @@ class RenderData:
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.
diff --git a/source/blender/python/api2_2x/sceneRender.c b/source/blender/python/api2_2x/sceneRender.c
index ec160ddf4ce..f5861995073 100644
--- a/source/blender/python/api2_2x/sceneRender.c
+++ b/source/blender/python/api2_2x/sceneRender.c
@@ -2201,6 +2201,19 @@ static int RenderData_setRenderPath( BPy_RenderData * self, PyObject * value )
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 @@ static PyMethodDef BPy_RenderData_methods[] = {
{"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"},