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
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-04-18 03:47:47 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-04-18 03:47:47 +0400
commitd7e08f2d33207fdf76b1b597ef0de9dec26e3987 (patch)
treeb310235b1d441e160c50bbfb7eceadb090694339 /source/blender/freestyle/intern/python/BPy_Freestyle.cpp
parent11fc330f7ecfcb60bac3e29a83016ec7dfb85182 (diff)
Major documentation updates. The original Freestyle API reference
(http://freestyle.sourceforge.net/doc/html/index.html) has been incorporated into the Blender/Freestyle Python API implementation in the form of Sphinx-based embedded docstrings. Some C++-specific descriptions of classes and functions were revised so that they are suitable for Python programmers. Missing docstrings were filled, and sparse descriptions were extended. By means of the new documentation system for Blender, an up-to-date Freestyle Python API reference will be part of the Blender 2.5 documentation.
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_Freestyle.cpp')
-rw-r--r--source/blender/freestyle/intern/python/BPy_Freestyle.cpp43
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