diff options
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_Freestyle.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_Freestyle.cpp | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp index 3e8572d07ae..082ca32ddc7 100644 --- a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp +++ b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp @@ -31,19 +31,38 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////////////////// +//------------------------ MODULE FUNCTIONS ---------------------------------- -//static PyObject *Freestyle_testOutput( BPy_Freestyle * self ); -static PyObject *Freestyle_getCurrentScene( PyObject *self ); +#include "FRS_freestyle.h" +#include "bpy_rna.h" /* pyrna_struct_CreatePyObject() */ + +static char Freestyle_getCurrentScene___doc__[] = +".. function:: getCurrentScene()\n" +"\n" +" Returns the current scene.\n" +"\n" +" :return: The current scene.\n" +" :rtype: :class:`bpy.types.Scene`\n"; + +static PyObject *Freestyle_getCurrentScene( PyObject *self ) +{ + if (!freestyle_scene) { + PyErr_SetString(PyExc_TypeError, "current scene not available"); + return NULL; + } + PointerRNA ptr_scene; + RNA_pointer_create(NULL, &RNA_Scene, freestyle_scene, &ptr_scene); + return pyrna_struct_CreatePyObject(&ptr_scene); +} -/*-----------------------Freestyle module doc strings--------------------------*/ +/*-----------------------Freestyle module docstring----------------------------*/ static char module_docstring[] = "The Blender Freestyle module\n\n"; /*-----------------------Freestyle module method def---------------------------*/ static PyMethodDef module_functions[] = { -// {"testOutput", ( PyCFunction ) Freestyle_testOutput, METH_NOARGS, "() - Return Curve Data name"}, - {"getCurrentScene", ( PyCFunction ) Freestyle_getCurrentScene, METH_NOARGS, "() - Return the current scene."}, + {"getCurrentScene", ( PyCFunction ) Freestyle_getCurrentScene, METH_NOARGS, Freestyle_getCurrentScene___doc__}, {NULL, NULL, 0, NULL} }; @@ -101,20 +120,6 @@ PyObject *Freestyle_Init( void ) /////////////////////////////////////////////////////////////////////////////////////////// -#include "FRS_freestyle.h" -#include "bpy_rna.h" /* pyrna_struct_CreatePyObject() */ - -static PyObject *Freestyle_getCurrentScene( PyObject *self ) -{ - if (!freestyle_scene) { - PyErr_SetString(PyExc_TypeError, "current scene not available"); - return NULL; - } - PointerRNA ptr_scene; - RNA_pointer_create(NULL, &RNA_Scene, freestyle_scene, &ptr_scene); - return pyrna_struct_CreatePyObject(&ptr_scene); -} - #ifdef __cplusplus } #endif |