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_PolygonalizationShader.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_PolygonalizationShader.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp index 2ea4bf14941..367d0004995 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp @@ -15,17 +15,17 @@ static char PolygonalizationShader___doc__[] = "\n" "[Geometry shader]\n" "\n" -".. method:: __init__(iError)\n" +".. method:: __init__(error)\n" "\n" " Builds a PolygonalizationShader object.\n" "\n" -" :arg iError: The error we want our polygonal approximation to have\n" +" :arg error: The error we want our polygonal approximation to have\n" " with respect to the original geometry. The smaller, the closer\n" " the new stroke is to the orinal one. This error corresponds to\n" " the maximum distance between the new stroke and the old one.\n" -" :type iError: float\n" +" :type error: float\n" "\n" -".. method:: shade(s)\n" +".. method:: shade(stroke)\n" "\n" " Modifies the Stroke geometry so that it looks more \"polygonal\".\n" " The basic idea is to start from the minimal stroke approximation\n" @@ -33,16 +33,16 @@ static char PolygonalizationShader___doc__[] = " to subdivide using the original stroke vertices until a certain\n" " error is reached.\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 PolygonalizationShader___init__( BPy_PolygonalizationShader* self, PyObject *args) +static int PolygonalizationShader___init__(BPy_PolygonalizationShader* self, PyObject *args, PyObject *kwds) { + static const char *kwlist[] = {"error", 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::PolygonalizationShader(f); return 0; } |