diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-23 05:12:23 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-23 05:12:23 +0400 |
commit | 68b0a8e39026ea2b391751406dc4bdb0a4ed958c (patch) | |
tree | cdf8a143a6cf2b832f49a31c2d3b7003f92eaa43 /source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp | |
parent | 0fb83d78faa99a8ea3fd396887b2b31a6a36a8cd (diff) |
Freestyle Python API improvements - part 7.
Fix for PyGetSetDef and proper handling of keyword arguments were done in
UnaryPredicate0D, UnaryPredicate1D, BinaryPredicate1D, and StrokeShader classes.
Style modules were updated accordingly. Additional code clean-up was also made.
Diffstat (limited to 'source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp index 79af155b728..f2dace8b4d5 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp @@ -15,17 +15,17 @@ static char GuidingLinesShader___doc__[] = "\n" "[Geometry shader]\n" "\n" -".. method:: __init__(iOffset)\n" +".. method:: __init__(offset)\n" "\n" " Builds a GuidingLinesShader object.\n" "\n" -" :arg iOffset: The line that replaces the stroke is initially in the\n" -" middle of the initial stroke bounding box. iOffset is the value\n" +" :arg offset: The line that replaces the stroke is initially in the\n" +" middle of the initial stroke bounding box. offset is the value\n" " of the displacement which is applied to this line along its\n" " normal.\n" -" :type iOffset: float\n" +" :type offset: float\n" "\n" -".. method:: shade(s)\n" +".. method:: shade(stroke)\n" "\n" " Shader to modify the Stroke geometry so that it corresponds to its\n" " main direction line. This shader must be used together with the\n" @@ -34,16 +34,16 @@ static char GuidingLinesShader___doc__[] = " stroke's pieces. The bigger the pieces are, the rougher the\n" " approximation is.\n" "\n" -" :arg s: A Stroke object.\n" -" :type s: :class:`Stroke`\n"; +" :arg stroke: A Stroke object.\n" +" :type stroke: :class:`Stroke`\n"; -static int GuidingLinesShader___init__( BPy_GuidingLinesShader* self, PyObject *args) +static int GuidingLinesShader___init__(BPy_GuidingLinesShader* self, PyObject *args, PyObject *kwds) { + static const char *kwlist[] = {"offset", NULL}; float f; - if(!( PyArg_ParseTuple(args, "f", &f) )) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) return -1; - self->py_ss.ss = new StrokeShaders::GuidingLinesShader(f); return 0; } |