From 68b0a8e39026ea2b391751406dc4bdb0a4ed958c Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Sat, 23 Feb 2013 01:12:23 +0000 Subject: 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. --- .../python/StrokeShader/BPy_ColorNoiseShader.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp') diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp index d005e8ccfe8..3e0f864f468 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp @@ -15,29 +15,29 @@ static char ColorNoiseShader___doc__[] = "\n" "[Color shader]\n" "\n" -".. method:: __init__(iAmplitude, iPeriod)\n" +".. method:: __init__(amplitude, period)\n" "\n" " Builds a ColorNoiseShader object.\n" "\n" -" :arg iAmplitude: The amplitude of the noise signal.\n" -" :type iAmplitude: float\n" -" :arg iPeriod: The period of the noise signal.\n" -" :type iPeriod: float\n" +" :arg amplitude: The amplitude of the noise signal.\n" +" :type amplitude: float\n" +" :arg period: The period of the noise signal.\n" +" :type period: float\n" "\n" -".. method:: shade(s)\n" +".. method:: shade(stroke)\n" "\n" " Shader to add noise to the stroke colors.\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 ColorNoiseShader___init__( BPy_ColorNoiseShader* self, PyObject *args) +static int ColorNoiseShader___init__(BPy_ColorNoiseShader* self, PyObject *args, PyObject *kwds) { + static const char *kwlist[] = {"amplitude", "period", NULL}; float f1, f2; - if(!( PyArg_ParseTuple(args, "ff", &f1, &f2) )) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2)) return -1; - self->py_ss.ss = new StrokeShaders::ColorNoiseShader(f1, f2); return 0; } -- cgit v1.2.3