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>2013-02-23 05:12:23 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-02-23 05:12:23 +0400
commit68b0a8e39026ea2b391751406dc4bdb0a4ed958c (patch)
treecdf8a143a6cf2b832f49a31c2d3b7003f92eaa43 /source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp
parent0fb83d78faa99a8ea3fd396887b2b31a6a36a8cd (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_ColorVariationPatternShader.cpp')
-rw-r--r--source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp
index 2d48df78da1..d0451578f87 100644
--- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp
+++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorVariationPatternShader.cpp
@@ -27,24 +27,24 @@ static char ColorVariationPatternShader___doc__[] =
" repeted to fit the stroke.\n"
" :type stretch: bool\n"
"\n"
-".. method:: shade(s)\n"
+".. method:: shade(stroke)\n"
"\n"
" Applies a pattern to vary the original color. The new color is the\n"
" result of the multiplication of the pattern and the original color.\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 ColorVariationPatternShader___init__( BPy_ColorVariationPatternShader* self, PyObject *args)
+static int ColorVariationPatternShader___init__(BPy_ColorVariationPatternShader* self, PyObject *args, PyObject *kwds)
{
+ static const char *kwlist[] = {"pattern_name", "stretch", NULL};
const char *s;
PyObject *obj = 0;
-
- if(!( PyArg_ParseTuple(args, "s|O", &s, &obj) ))
- return -1;
- bool b = (obj) ? bool_from_PyBool(obj) : true;
- self->py_ss.ss = new StrokeShaders::ColorVariationPatternShader(s,b);
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|O!", (char **)kwlist, &s, &PyBool_Type, &obj))
+ return -1;
+ bool b = (!obj) ? true : bool_from_PyBool(obj);
+ self->py_ss.ss = new StrokeShaders::ColorVariationPatternShader(s, b);
return 0;
}