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.
This commit is contained in:
2013-02-23 01:12:23 +00:00
parent 0fb83d78fa
commit 68b0a8e390
51 changed files with 654 additions and 615 deletions

View File

@@ -16,39 +16,42 @@ static char SpatialNoiseShader___doc__[] =
"\n"
"[Geometry shader]\n"
"\n"
".. method:: __init__(iAmount, ixScale, nbOctave, smooth, pureRandom)\n"
".. method:: __init__(amount, scale, num_octaves, smooth, pure_random)\n"
"\n"
" Builds a SpatialNoiseShader object.\n"
"\n"
" :arg iAmount: The amplitude of the noise.\n"
" :type iAmount: float\n"
" :arg ixScale: The noise frequency.\n"
" :type ixScale: float\n"
" :arg nbOctave: The number of octaves\n"
" :type nbOctave: int\n"
" :arg amount: The amplitude of the noise.\n"
" :type amount: float\n"
" :arg scale: The noise frequency.\n"
" :type scale: float\n"
" :arg num_octaves: The number of octaves\n"
" :type num_octaves: int\n"
" :arg smooth: True if you want the noise to be smooth.\n"
" :type smooth: bool\n"
" :arg pureRandom: True if you don't want any coherence.\n"
" :type pureRandom: bool\n"
" :arg pure_random: True if you don't want any coherence.\n"
" :type pure_random: bool\n"
"\n"
".. method:: shade(s)\n"
".. method:: shade(stroke)\n"
"\n"
" Spatial Noise stroke shader. Moves the vertices to make the stroke\n"
" more noisy.\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 SpatialNoiseShader___init__( BPy_SpatialNoiseShader* self, PyObject *args)
static int SpatialNoiseShader___init__(BPy_SpatialNoiseShader* self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"amount", "scale", "num_octaves", "smooth", "pure_random", NULL};
float f1, f2;
int i3;
PyObject *obj4 = 0, *obj5 = 0;
if(!( PyArg_ParseTuple(args, "ffiOO", &f1, &f2, &i3, &obj4, &obj5) ))
return -1;
self->py_ss.ss = new SpatialNoiseShader(f1, f2, i3, bool_from_PyBool(obj4), bool_from_PyBool(obj5) );
if (!PyArg_ParseTupleAndKeywords(args, kwds, "ffiO!O!", (char **)kwlist,
&f1, &f2, &i3, &PyBool_Type, &obj4, &PyBool_Type, &obj5))
{
return -1;
}
self->py_ss.ss = new SpatialNoiseShader(f1, f2, i3, bool_from_PyBool(obj4), bool_from_PyBool(obj5));
return 0;
}