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_ConstantColorShader.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_ConstantColorShader.cpp')
-rw-r--r--source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp
index d0f4c365a80..61d46f58f26 100644
--- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp
+++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp
@@ -15,33 +15,33 @@ static char ConstantColorShader___doc__[] =
"\n"
"[Color shader]\n"
"\n"
-".. method:: __init__(iR, iG, iB, iAlpha=1.0)\n"
+".. method:: __init__(red, green, blue, alpha=1.0)\n"
"\n"
" Builds a ConstantColorShader object.\n"
"\n"
-" :arg iR: The red component.\n"
-" :type iR: float\n"
-" :arg iG: The green component.\n"
-" :type iG: float\n"
-" :arg iB: The blue component.\n"
-" :type iB: float\n"
-" :arg iAlpha: The alpha value.\n"
-" :type iAlpha: float\n"
+" :arg red: The red component.\n"
+" :type red: float\n"
+" :arg green: The green component.\n"
+" :type green: float\n"
+" :arg blue: The blue component.\n"
+" :type blue: float\n"
+" :arg alpha: The alpha value.\n"
+" :type alpha: float\n"
"\n"
-".. method:: shade(s)\n"
+".. method:: shade(stroke)\n"
"\n"
" Assigns a constant color to every vertex of the Stroke.\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 ConstantColorShader___init__( BPy_ConstantColorShader* self, PyObject *args)
+static int ConstantColorShader___init__(BPy_ConstantColorShader* self, PyObject *args, PyObject *kwds)
{
+ static const char *kwlist[] = {"red", "green", "blue", "alpha", NULL};
float f1, f2, f3, f4 = 1.0;
- if(!( PyArg_ParseTuple(args, "fff|f", &f1, &f2, &f3, &f4) ))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "fff|f", (char **)kwlist, &f1, &f2, &f3, &f4))
return -1;
-
self->py_ss.ss = new StrokeShaders::ConstantColorShader(f1, f2, f3, f4);
return 0;
}