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_IncreasingColorShader.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_IncreasingColorShader.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp index 063e5cd587d..3cf5800e77d 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp @@ -15,43 +15,44 @@ static char IncreasingColorShader___doc__[] = "\n" "[Color shader]\n" "\n" -".. method:: __init__(iRm, iGm, iBm, iAlpham, iRM, iGM, iBM, iAlphaM)\n" +".. method:: __init__(red_min, green_min, blue_min, alpha_min, red_max, green_max, blue_max, alpha_max)\n" "\n" " Builds an IncreasingColorShader object.\n" "\n" -" :arg iRm: The first color red component.\n" -" :type iRm: float\n" -" :arg iGm: The first color green component.\n" -" :type iGm: float\n" -" :arg iBm: The first color blue component.\n" -" :type iBm: float\n" -" :arg iAlpham: The first color alpha value.\n" -" :type iAlpham: float\n" -" :arg iRM: The second color red component.\n" -" :type iRM: float\n" -" :arg iGM: The second color green component.\n" -" :type iGM: float\n" -" :arg iBM: The second color blue component.\n" -" :type iBM: float\n" -" :arg iAlphaM: The second color alpha value.\n" -" :type iAlphaM: float\n" +" :arg red_min: The first color red component.\n" +" :type red_min: float\n" +" :arg green_min: The first color green component.\n" +" :type green_min: float\n" +" :arg blue_min: The first color blue component.\n" +" :type blue_min: float\n" +" :arg alpha_min: The first color alpha value.\n" +" :type alpha_min: float\n" +" :arg red_max: The second color red component.\n" +" :type red_max: float\n" +" :arg green_max: The second color green component.\n" +" :type green_max: float\n" +" :arg blue_max: The second color blue component.\n" +" :type blue_max: float\n" +" :arg alpha_max: The second color alpha value.\n" +" :type alpha_max: float\n" "\n" -".. method:: shade(s)\n" +".. method:: shade(stroke)\n" "\n" " Assigns a varying color to the stroke. The user specifies two\n" " colors A and B. The stroke color will change linearly from A to B\n" " between the first and the last vertex.\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 IncreasingColorShader___init__( BPy_IncreasingColorShader* self, PyObject *args) +static int IncreasingColorShader___init__(BPy_IncreasingColorShader* self, PyObject *args, PyObject *kwds) { + static const char *kwlist[] = {"red_min", "green_min", "blue_min", "alpha_min", + "red_max", "green_max", "blue_max", "alpha_max", NULL}; float f1, f2, f3, f4, f5, f6, f7, f8; - if(!( PyArg_ParseTuple(args, "ffffffff", &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8) )) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "ffffffff", (char **)kwlist, &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8)) return -1; - self->py_ss.ss = new StrokeShaders::IncreasingColorShader(f1, f2, f3, f4, f5, f6, f7, f8); return 0; } |