diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/freestyle/intern/python/StrokeShader | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/freestyle/intern/python/StrokeShader')
36 files changed, 1325 insertions, 1320 deletions
diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp index 1fa26efdbce..7ee1372aa22 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.cpp @@ -31,77 +31,78 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char BackboneStretcherShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`BackboneStretcherShader`\n" -"\n" -"[Geometry shader]\n" -"\n" -".. method:: __init__(amount=2.0)\n" -"\n" -" Builds a BackboneStretcherShader object.\n" -"\n" -" :arg amount: The stretching amount value.\n" -" :type amount: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Stretches the stroke at its two extremities and following the\n" -" respective directions: v(1)v(0) and v(n-1)v(n).\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`BackboneStretcherShader`\n" + "\n" + "[Geometry shader]\n" + "\n" + ".. method:: __init__(amount=2.0)\n" + "\n" + " Builds a BackboneStretcherShader object.\n" + "\n" + " :arg amount: The stretching amount value.\n" + " :type amount: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Stretches the stroke at its two extremities and following the\n" + " respective directions: v(1)v(0) and v(n-1)v(n).\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int BackboneStretcherShader___init__(BPy_BackboneStretcherShader *self, PyObject *args, PyObject *kwds) +static int BackboneStretcherShader___init__(BPy_BackboneStretcherShader *self, + PyObject *args, + PyObject *kwds) { - static const char *kwlist[] = {"amount", NULL}; - float f = 2.0; + static const char *kwlist[] = {"amount", NULL}; + float f = 2.0; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|f", (char **)kwlist, &f)) - return -1; - self->py_ss.ss = new StrokeShaders::BackboneStretcherShader(f); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|f", (char **)kwlist, &f)) + return -1; + self->py_ss.ss = new StrokeShaders::BackboneStretcherShader(f); + return 0; } /*-----------------------BPy_BackboneStretcherShader type definition ------------------------------*/ PyTypeObject BackboneStretcherShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "BackboneStretcherShader", /* tp_name */ - sizeof(BPy_BackboneStretcherShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - BackboneStretcherShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)BackboneStretcherShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "BackboneStretcherShader", /* tp_name */ + sizeof(BPy_BackboneStretcherShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + BackboneStretcherShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)BackboneStretcherShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.h index 037a06725c1..c37d330e4a7 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BackboneStretcherShader.h @@ -32,19 +32,17 @@ extern "C" { extern PyTypeObject BackboneStretcherShader_Type; #define BPy_BackboneStretcherShader_Check(v) \ - (PyObject_IsInstance((PyObject *)v, (PyObject *)&BackboneStretcherShader_Type)) + (PyObject_IsInstance((PyObject *)v, (PyObject *)&BackboneStretcherShader_Type)) /*---------------------------Python BPy_BackboneStretcherShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_BackboneStretcherShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_BACKBONESTRETCHERSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp index 4bb86a0bb0e..ff5b98cf912 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.cpp @@ -31,79 +31,78 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char BezierCurveShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`BezierCurveShader`\n" -"\n" -"[Geometry shader]\n" -"\n" -".. method:: __init__(error=4.0)\n" -"\n" -" Builds a BezierCurveShader object.\n" -"\n" -" :arg error: The error we're allowing for the approximation. This\n" -" error is the max distance allowed between the new curve and the\n" -" original geometry.\n" -" :type error: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Transforms the stroke backbone geometry so that it corresponds to a\n" -" Bezier Curve approximation of the original backbone geometry.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`BezierCurveShader`\n" + "\n" + "[Geometry shader]\n" + "\n" + ".. method:: __init__(error=4.0)\n" + "\n" + " Builds a BezierCurveShader object.\n" + "\n" + " :arg error: The error we're allowing for the approximation. This\n" + " error is the max distance allowed between the new curve and the\n" + " original geometry.\n" + " :type error: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Transforms the stroke backbone geometry so that it corresponds to a\n" + " Bezier Curve approximation of the original backbone geometry.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; static int BezierCurveShader___init__(BPy_BezierCurveShader *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"error", NULL}; - float f = 4.0; + static const char *kwlist[] = {"error", NULL}; + float f = 4.0; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|f", (char **)kwlist, &f)) - return -1; - self->py_ss.ss = new StrokeShaders::BezierCurveShader(f); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|f", (char **)kwlist, &f)) + return -1; + self->py_ss.ss = new StrokeShaders::BezierCurveShader(f); + return 0; } /*-----------------------BPy_BezierCurveShader type definition ------------------------------*/ PyTypeObject BezierCurveShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "BezierCurveShader", /* tp_name */ - sizeof(BPy_BezierCurveShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - BezierCurveShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)BezierCurveShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "BezierCurveShader", /* tp_name */ + sizeof(BPy_BezierCurveShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + BezierCurveShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)BezierCurveShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.h index ea289bbbf62..b38fcec838d 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BezierCurveShader.h @@ -31,19 +31,18 @@ extern "C" { extern PyTypeObject BezierCurveShader_Type; -#define BPy_BezierCurveShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&BezierCurveShader_Type)) +#define BPy_BezierCurveShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&BezierCurveShader_Type)) /*---------------------------Python BPy_BezierCurveShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_BezierCurveShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_BEZIERCURVESHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.cpp index 91a95d054cd..2984f52203d 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.cpp @@ -33,94 +33,96 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char BlenderTextureShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`BlenderTextureShader`\n" -"\n" -"[Texture shader]\n" -"\n" -".. method:: __init__(texture)\n" -"\n" -" Builds a BlenderTextureShader object.\n" -"\n" -" :arg texture: A line style texture slot or a shader node tree to define\n" -" a set of textures.\n" -" :type texture: :class:`bpy.types.LineStyleTextureSlot` or\n" -" :class:`bpy.types.ShaderNodeTree`\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Assigns a blender texture slot to the stroke shading in order to\n" -" simulate marks.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`BlenderTextureShader`\n" + "\n" + "[Texture shader]\n" + "\n" + ".. method:: __init__(texture)\n" + "\n" + " Builds a BlenderTextureShader object.\n" + "\n" + " :arg texture: A line style texture slot or a shader node tree to define\n" + " a set of textures.\n" + " :type texture: :class:`bpy.types.LineStyleTextureSlot` or\n" + " :class:`bpy.types.ShaderNodeTree`\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Assigns a blender texture slot to the stroke shading in order to\n" + " simulate marks.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int BlenderTextureShader___init__(BPy_BlenderTextureShader *self, PyObject *args, PyObject *kwds) +static int BlenderTextureShader___init__(BPy_BlenderTextureShader *self, + PyObject *args, + PyObject *kwds) { - static const char *kwlist[] = {"texture", NULL}; - PyObject *obj; - MTex *_mtex; - bNodeTree *_nodetree; + static const char *kwlist[] = {"texture", NULL}; + PyObject *obj; + MTex *_mtex; + bNodeTree *_nodetree; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O", (char **)kwlist, &obj)) - return -1; - _mtex = (MTex *)PyC_RNA_AsPointer(obj, "LineStyleTextureSlot"); - if (_mtex) { - self->py_ss.ss = new StrokeShaders::BlenderTextureShader(_mtex); - return 0; - } - PyErr_Clear(); - _nodetree = (bNodeTree *)PyC_RNA_AsPointer(obj, "ShaderNodeTree"); - if (_nodetree) { - self->py_ss.ss = new StrokeShaders::BlenderTextureShader(_nodetree); - return 0; - } - PyErr_Format(PyExc_TypeError, - "expected either 'LineStyleTextureSlot' or 'ShaderNodeTree', " - "found '%.200s' instead", Py_TYPE(obj)->tp_name); - return -1; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O", (char **)kwlist, &obj)) + return -1; + _mtex = (MTex *)PyC_RNA_AsPointer(obj, "LineStyleTextureSlot"); + if (_mtex) { + self->py_ss.ss = new StrokeShaders::BlenderTextureShader(_mtex); + return 0; + } + PyErr_Clear(); + _nodetree = (bNodeTree *)PyC_RNA_AsPointer(obj, "ShaderNodeTree"); + if (_nodetree) { + self->py_ss.ss = new StrokeShaders::BlenderTextureShader(_nodetree); + return 0; + } + PyErr_Format(PyExc_TypeError, + "expected either 'LineStyleTextureSlot' or 'ShaderNodeTree', " + "found '%.200s' instead", + Py_TYPE(obj)->tp_name); + return -1; } /*-----------------------BPy_BlenderTextureShader type definition ------------------------------*/ PyTypeObject BlenderTextureShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "BlenderTextureShader", /* tp_name */ - sizeof(BPy_BlenderTextureShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - BlenderTextureShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)BlenderTextureShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "BlenderTextureShader", /* tp_name */ + sizeof(BPy_BlenderTextureShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + BlenderTextureShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)BlenderTextureShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.h index 7fdc3b4f9fd..35335ffc023 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_BlenderTextureShader.h @@ -27,26 +27,24 @@ extern "C" { #endif - /////////////////////////////////////////////////////////////////////////////////////////// #include <Python.h> extern PyTypeObject BlenderTextureShader_Type; -#define BPy_BlenderTextureShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&BlenderTextureShader_Type)) +#define BPy_BlenderTextureShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&BlenderTextureShader_Type)) /*---------------------------Python BPy_BlenderTextureShader structure definition-----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_BlenderTextureShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_BLENDERTEXTURESHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp index 33734313857..98b50f2112c 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp @@ -32,95 +32,95 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char CalligraphicShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`CalligraphicShader`\n" -"\n" -"[Thickness Shader]\n" -"\n" -".. method:: __init__(thickness_min, thickness_max, orientation, clamp)\n" -"\n" -" Builds a CalligraphicShader object.\n" -"\n" -" :arg thickness_min: The minimum thickness in the direction\n" -" perpendicular to the main direction.\n" -" :type thickness_min: float\n" -" :arg thickness_max: The maximum thickness in the main direction.\n" -" :type thickness_max: float\n" -" :arg orientation: The 2D vector giving the main direction.\n" -" :type orientation: :class:`mathutils.Vector`\n" -" :arg clamp: If true, the strokes are drawn in black when the stroke\n" -" direction is between -90 and 90 degrees with respect to the main\n" -" direction and drawn in white otherwise. If false, the strokes\n" -" are always drawn in black.\n" -" :type clamp: bool\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Assigns thicknesses to the stroke vertices so that the stroke looks\n" -" like made with a calligraphic tool, i.e. the stroke will be the\n" -" thickest in a main direction, and the thinest in the direction\n" -" perpendicular to this one, and an interpolation inbetween.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`CalligraphicShader`\n" + "\n" + "[Thickness Shader]\n" + "\n" + ".. method:: __init__(thickness_min, thickness_max, orientation, clamp)\n" + "\n" + " Builds a CalligraphicShader object.\n" + "\n" + " :arg thickness_min: The minimum thickness in the direction\n" + " perpendicular to the main direction.\n" + " :type thickness_min: float\n" + " :arg thickness_max: The maximum thickness in the main direction.\n" + " :type thickness_max: float\n" + " :arg orientation: The 2D vector giving the main direction.\n" + " :type orientation: :class:`mathutils.Vector`\n" + " :arg clamp: If true, the strokes are drawn in black when the stroke\n" + " direction is between -90 and 90 degrees with respect to the main\n" + " direction and drawn in white otherwise. If false, the strokes\n" + " are always drawn in black.\n" + " :type clamp: bool\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Assigns thicknesses to the stroke vertices so that the stroke looks\n" + " like made with a calligraphic tool, i.e. the stroke will be the\n" + " thickest in a main direction, and the thinest in the direction\n" + " perpendicular to this one, and an interpolation inbetween.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int CalligraphicShader___init__(BPy_CalligraphicShader *self, PyObject *args, PyObject *kwds) +static int CalligraphicShader___init__(BPy_CalligraphicShader *self, + PyObject *args, + PyObject *kwds) { - static const char *kwlist[] = {"thickness_min", "thickness_max", "orientation", "clamp", NULL}; - double d1, d2; - float f3[2]; - PyObject *obj4 = 0; + static const char *kwlist[] = {"thickness_min", "thickness_max", "orientation", "clamp", NULL}; + double d1, d2; + float f3[2]; + PyObject *obj4 = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "ddO&O!", (char **)kwlist, - &d1, &d2, convert_v2, f3, &PyBool_Type, &obj4)) - { - return -1; - } - Vec2f v(f3[0], f3[1]); - self->py_ss.ss = new CalligraphicShader(d1, d2, v, bool_from_PyBool(obj4)); - return 0; + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "ddO&O!", (char **)kwlist, &d1, &d2, convert_v2, f3, &PyBool_Type, &obj4)) { + return -1; + } + Vec2f v(f3[0], f3[1]); + self->py_ss.ss = new CalligraphicShader(d1, d2, v, bool_from_PyBool(obj4)); + return 0; } /*-----------------------BPy_CalligraphicShader type definition ------------------------------*/ PyTypeObject CalligraphicShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "CalligraphicShader", /* tp_name */ - sizeof(BPy_CalligraphicShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - CalligraphicShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)CalligraphicShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "CalligraphicShader", /* tp_name */ + sizeof(BPy_CalligraphicShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + CalligraphicShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)CalligraphicShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.h index 1932e5e4dc2..8acb1215980 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.h @@ -35,15 +35,13 @@ extern PyTypeObject CalligraphicShader_Type; /*---------------------------Python BPy_CalligraphicShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_CalligraphicShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_CALLIGRAPHICSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp index 3e5da7289fa..8de33188639 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.cpp @@ -31,78 +31,77 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char ColorNoiseShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ColorNoiseShader`\n" -"\n" -"[Color shader]\n" -"\n" -".. method:: __init__(amplitude, period)\n" -"\n" -" Builds a ColorNoiseShader object.\n" -"\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(stroke)\n" -"\n" -" Shader to add noise to the stroke colors.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ColorNoiseShader`\n" + "\n" + "[Color shader]\n" + "\n" + ".. method:: __init__(amplitude, period)\n" + "\n" + " Builds a ColorNoiseShader object.\n" + "\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(stroke)\n" + "\n" + " Shader to add noise to the stroke colors.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; static int ColorNoiseShader___init__(BPy_ColorNoiseShader *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"amplitude", "period", NULL}; - float f1, f2; + static const char *kwlist[] = {"amplitude", "period", NULL}; + float 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; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2)) + return -1; + self->py_ss.ss = new StrokeShaders::ColorNoiseShader(f1, f2); + return 0; } /*-----------------------BPy_ColorNoiseShader type definition ------------------------------*/ PyTypeObject ColorNoiseShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "ColorNoiseShader", /* tp_name */ - sizeof(BPy_ColorNoiseShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ColorNoiseShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ColorNoiseShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "ColorNoiseShader", /* tp_name */ + sizeof(BPy_ColorNoiseShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + ColorNoiseShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)ColorNoiseShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.h index 0ee5964641d..054479d916d 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ColorNoiseShader.h @@ -31,19 +31,18 @@ extern "C" { extern PyTypeObject ColorNoiseShader_Type; -#define BPy_ColorNoiseShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&ColorNoiseShader_Type)) +#define BPy_ColorNoiseShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&ColorNoiseShader_Type)) /*---------------------------Python BPy_ColorNoiseShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_ColorNoiseShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_COLORNOISESHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp index 99dc4a07370..6dbbd1396d9 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.cpp @@ -31,82 +31,83 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char ConstantColorShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ConstantColorShader`\n" -"\n" -"[Color shader]\n" -"\n" -".. method:: __init__(red, green, blue, alpha=1.0)\n" -"\n" -" Builds a ConstantColorShader object.\n" -"\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(stroke)\n" -"\n" -" Assigns a constant color to every vertex of the Stroke.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ConstantColorShader`\n" + "\n" + "[Color shader]\n" + "\n" + ".. method:: __init__(red, green, blue, alpha=1.0)\n" + "\n" + " Builds a ConstantColorShader object.\n" + "\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(stroke)\n" + "\n" + " Assigns a constant color to every vertex of the Stroke.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int ConstantColorShader___init__(BPy_ConstantColorShader *self, PyObject *args, PyObject *kwds) +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; + static const char *kwlist[] = {"red", "green", "blue", "alpha", NULL}; + float f1, f2, f3, f4 = 1.0; - 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; + 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; } /*-----------------------BPy_ConstantColorShader type definition ------------------------------*/ PyTypeObject ConstantColorShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "ConstantColorShader", /* tp_name */ - sizeof(BPy_ConstantColorShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ConstantColorShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ConstantColorShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "ConstantColorShader", /* tp_name */ + sizeof(BPy_ConstantColorShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + ConstantColorShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)ConstantColorShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.h index ad0ddeb23f2..36b59e6493e 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantColorShader.h @@ -31,19 +31,18 @@ extern "C" { extern PyTypeObject ConstantColorShader_Type; -#define BPy_ConstantColorShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&ConstantColorShader_Type)) +#define BPy_ConstantColorShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&ConstantColorShader_Type)) /*---------------------------Python BPy_ConstantColorShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_ConstantColorShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_CONSTANTCOLORSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp index 511ac47b74b..c226cc0df25 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.cpp @@ -31,76 +31,77 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char ConstantThicknessShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ConstantThicknessShader`\n" -"\n" -"[Thickness shader]\n" -"\n" -".. method:: __init__(thickness)\n" -"\n" -" Builds a ConstantThicknessShader object.\n" -"\n" -" :arg thickness: The thickness that must be assigned to the stroke.\n" -" :type thickness: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Assigns an absolute constant thickness to every vertex of the Stroke.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ConstantThicknessShader`\n" + "\n" + "[Thickness shader]\n" + "\n" + ".. method:: __init__(thickness)\n" + "\n" + " Builds a ConstantThicknessShader object.\n" + "\n" + " :arg thickness: The thickness that must be assigned to the stroke.\n" + " :type thickness: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Assigns an absolute constant thickness to every vertex of the Stroke.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int ConstantThicknessShader___init__(BPy_ConstantThicknessShader *self, PyObject *args, PyObject *kwds) +static int ConstantThicknessShader___init__(BPy_ConstantThicknessShader *self, + PyObject *args, + PyObject *kwds) { - static const char *kwlist[] = {"thickness", NULL}; - float f; + static const char *kwlist[] = {"thickness", NULL}; + float f; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) - return -1; - self->py_ss.ss = new StrokeShaders::ConstantThicknessShader(f); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) + return -1; + self->py_ss.ss = new StrokeShaders::ConstantThicknessShader(f); + return 0; } /*-----------------------BPy_ConstantThicknessShader type definition ------------------------------*/ PyTypeObject ConstantThicknessShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "ConstantThicknessShader", /* tp_name */ - sizeof(BPy_ConstantThicknessShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ConstantThicknessShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ConstantThicknessShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "ConstantThicknessShader", /* tp_name */ + sizeof(BPy_ConstantThicknessShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + ConstantThicknessShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)ConstantThicknessShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.h index d07ab7250f9..3a11ab9c9a0 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstantThicknessShader.h @@ -32,19 +32,17 @@ extern "C" { extern PyTypeObject ConstantThicknessShader_Type; #define BPy_ConstantThicknessShader_Check(v) \ - (PyObject_IsInstance((PyObject *)v, (PyObject *)&ConstantThicknessShader_Type)) + (PyObject_IsInstance((PyObject *)v, (PyObject *)&ConstantThicknessShader_Type)) /*---------------------------Python BPy_ConstantThicknessShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_ConstantThicknessShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_CONSTANTTHICKNESSSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp index f50d496b03a..22a67c65df8 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.cpp @@ -31,83 +31,83 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char ConstrainedIncreasingThicknessShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ConstrainedIncreasingThicknessShader`\n" -"\n" -"[Thickness shader]\n" -"\n" -".. method:: __init__(thickness_min, thickness_max, ratio)\n" -"\n" -" Builds a ConstrainedIncreasingThicknessShader object.\n" -"\n" -" :arg thickness_min: The minimum thickness.\n" -" :type thickness_min: float\n" -" :arg thickness_max: The maximum thickness.\n" -" :type thickness_max: float\n" -" :arg ratio: The thickness/length ratio that we don't want to exceed. \n" -" :type ratio: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Same as the :class:`IncreasingThicknessShader`, but here we allow\n" -" the user to control the thickness/length ratio so that we don't get\n" -" fat short lines.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > " + ":class:`ConstrainedIncreasingThicknessShader`\n" + "\n" + "[Thickness shader]\n" + "\n" + ".. method:: __init__(thickness_min, thickness_max, ratio)\n" + "\n" + " Builds a ConstrainedIncreasingThicknessShader object.\n" + "\n" + " :arg thickness_min: The minimum thickness.\n" + " :type thickness_min: float\n" + " :arg thickness_max: The maximum thickness.\n" + " :type thickness_max: float\n" + " :arg ratio: The thickness/length ratio that we don't want to exceed. \n" + " :type ratio: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Same as the :class:`IncreasingThicknessShader`, but here we allow\n" + " the user to control the thickness/length ratio so that we don't get\n" + " fat short lines.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int ConstrainedIncreasingThicknessShader___init__(BPy_ConstrainedIncreasingThicknessShader *self, - PyObject *args, PyObject *kwds) +static int ConstrainedIncreasingThicknessShader___init__( + BPy_ConstrainedIncreasingThicknessShader *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"thickness_min", "thickness_max", "ratio", NULL}; - float f1, f2, f3; + static const char *kwlist[] = {"thickness_min", "thickness_max", "ratio", NULL}; + float f1, f2, f3; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "fff", (char **)kwlist, &f1, &f2, &f3)) - return -1; - self->py_ss.ss = new StrokeShaders::ConstrainedIncreasingThicknessShader(f1, f2, f3); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "fff", (char **)kwlist, &f1, &f2, &f3)) + return -1; + self->py_ss.ss = new StrokeShaders::ConstrainedIncreasingThicknessShader(f1, f2, f3); + return 0; } /*-----------------------BPy_ConstrainedIncreasingThicknessShader type definition ------------------------------*/ PyTypeObject ConstrainedIncreasingThicknessShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "ConstrainedIncreasingThicknessShader", /* tp_name */ - sizeof(BPy_ConstrainedIncreasingThicknessShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ConstrainedIncreasingThicknessShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ConstrainedIncreasingThicknessShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "ConstrainedIncreasingThicknessShader", /* tp_name */ + sizeof(BPy_ConstrainedIncreasingThicknessShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + ConstrainedIncreasingThicknessShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)ConstrainedIncreasingThicknessShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h index 2c53ee40db4..907355ea69c 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ConstrainedIncreasingThicknessShader.h @@ -32,19 +32,17 @@ extern "C" { extern PyTypeObject ConstrainedIncreasingThicknessShader_Type; #define BPy_ConstrainedIncreasingThicknessShader_Check(v) \ - (PyObject_IsInstance((PyObject *)v, (PyObject *)&ConstrainedIncreasingThicknessShader_Type)) + (PyObject_IsInstance((PyObject *)v, (PyObject *)&ConstrainedIncreasingThicknessShader_Type)) /*---------------------------Python BPy_ConstrainedIncreasingThicknessShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_ConstrainedIncreasingThicknessShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_CONSTRAINEDINCREASINGTHICKNESSSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp index 79566195633..a3cf272a1ab 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.cpp @@ -31,84 +31,85 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char GuidingLinesShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`GuidingLinesShader`\n" -"\n" -"[Geometry shader]\n" -"\n" -".. method:: __init__(offset)\n" -"\n" -" Builds a GuidingLinesShader object.\n" -"\n" -" :arg offset: The line that replaces the stroke is initially in the\n" -" middle of the initial stroke bounding box. offset is the value\n" -" of the displacement which is applied to this line along its\n" -" normal.\n" -" :type offset: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Shader to modify the Stroke geometry so that it corresponds to its\n" -" main direction line. This shader must be used together with the\n" -" splitting operator using the curvature criterion. Indeed, the\n" -" precision of the approximation will depend on the size of the\n" -" stroke's pieces. The bigger the pieces are, the rougher the\n" -" approximation is.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`GuidingLinesShader`\n" + "\n" + "[Geometry shader]\n" + "\n" + ".. method:: __init__(offset)\n" + "\n" + " Builds a GuidingLinesShader object.\n" + "\n" + " :arg offset: The line that replaces the stroke is initially in the\n" + " middle of the initial stroke bounding box. offset is the value\n" + " of the displacement which is applied to this line along its\n" + " normal.\n" + " :type offset: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Shader to modify the Stroke geometry so that it corresponds to its\n" + " main direction line. This shader must be used together with the\n" + " splitting operator using the curvature criterion. Indeed, the\n" + " precision of the approximation will depend on the size of the\n" + " stroke's pieces. The bigger the pieces are, the rougher the\n" + " approximation is.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int GuidingLinesShader___init__(BPy_GuidingLinesShader *self, PyObject *args, PyObject *kwds) +static int GuidingLinesShader___init__(BPy_GuidingLinesShader *self, + PyObject *args, + PyObject *kwds) { - static const char *kwlist[] = {"offset", NULL}; - float f; + static const char *kwlist[] = {"offset", NULL}; + float f; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) - return -1; - self->py_ss.ss = new StrokeShaders::GuidingLinesShader(f); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) + return -1; + self->py_ss.ss = new StrokeShaders::GuidingLinesShader(f); + return 0; } /*-----------------------BPy_GuidingLinesShader type definition ------------------------------*/ PyTypeObject GuidingLinesShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "GuidingLinesShader", /* tp_name */ - sizeof(BPy_GuidingLinesShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - GuidingLinesShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)GuidingLinesShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "GuidingLinesShader", /* tp_name */ + sizeof(BPy_GuidingLinesShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + GuidingLinesShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)GuidingLinesShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.h index 1603efce35a..217acbc4648 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_GuidingLinesShader.h @@ -31,19 +31,18 @@ extern "C" { extern PyTypeObject GuidingLinesShader_Type; -#define BPy_GuidingLinesShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&GuidingLinesShader_Type)) +#define BPy_GuidingLinesShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&GuidingLinesShader_Type)) /*---------------------------Python BPy_GuidingLinesShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_GuidingLinesShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_GUIDINGLINESSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp index a27092d9c61..bc0bc5bd721 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp @@ -31,93 +31,103 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char IncreasingColorShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`IncreasingColorShader`\n" -"\n" -"[Color shader]\n" -"\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 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(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 stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`IncreasingColorShader`\n" + "\n" + "[Color shader]\n" + "\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 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(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 stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int IncreasingColorShader___init__(BPy_IncreasingColorShader *self, PyObject *args, PyObject *kwds) +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; + 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_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; + 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; } /*-----------------------BPy_IncreasingColorShader type definition ------------------------------*/ PyTypeObject IncreasingColorShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "IncreasingColorShader", /* tp_name */ - sizeof(BPy_IncreasingColorShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - IncreasingColorShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)IncreasingColorShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "IncreasingColorShader", /* tp_name */ + sizeof(BPy_IncreasingColorShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + IncreasingColorShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)IncreasingColorShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.h index 812b8df1271..d7d1d053efd 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.h @@ -31,19 +31,18 @@ extern "C" { extern PyTypeObject IncreasingColorShader_Type; -#define BPy_IncreasingColorShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&IncreasingColorShader_Type)) +#define BPy_IncreasingColorShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&IncreasingColorShader_Type)) /*---------------------------Python BPy_IncreasingColorShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_IncreasingColorShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_INCREASINGCOLORSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp index 34b62b02a39..324f1c1a40b 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.cpp @@ -31,82 +31,83 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char IncreasingThicknessShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`IncreasingThicknessShader`\n" -"\n" -"[Thickness shader]\n" -"\n" -".. method:: __init__(thickness_A, thickness_B)\n" -"\n" -" Builds an IncreasingThicknessShader object.\n" -"\n" -" :arg thickness_A: The first thickness value.\n" -" :type thickness_A: float\n" -" :arg thickness_B: The second thickness value.\n" -" :type thickness_B: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Assigns thicknesses values such as the thickness increases from a\n" -" thickness value A to a thickness value B between the first vertex\n" -" to the midpoint vertex and then decreases from B to a A between\n" -" this midpoint vertex and the last vertex. The thickness is\n" -" linearly interpolated from A to B.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`IncreasingThicknessShader`\n" + "\n" + "[Thickness shader]\n" + "\n" + ".. method:: __init__(thickness_A, thickness_B)\n" + "\n" + " Builds an IncreasingThicknessShader object.\n" + "\n" + " :arg thickness_A: The first thickness value.\n" + " :type thickness_A: float\n" + " :arg thickness_B: The second thickness value.\n" + " :type thickness_B: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Assigns thicknesses values such as the thickness increases from a\n" + " thickness value A to a thickness value B between the first vertex\n" + " to the midpoint vertex and then decreases from B to a A between\n" + " this midpoint vertex and the last vertex. The thickness is\n" + " linearly interpolated from A to B.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int IncreasingThicknessShader___init__(BPy_IncreasingThicknessShader *self, PyObject *args, PyObject *kwds) +static int IncreasingThicknessShader___init__(BPy_IncreasingThicknessShader *self, + PyObject *args, + PyObject *kwds) { - static const char *kwlist[] = {"thickness_A", "thickness_B", NULL}; - float f1, f2; + static const char *kwlist[] = {"thickness_A", "thickness_B", NULL}; + float f1, f2; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2)) - return -1; - self->py_ss.ss = new StrokeShaders::IncreasingThicknessShader(f1, f2); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2)) + return -1; + self->py_ss.ss = new StrokeShaders::IncreasingThicknessShader(f1, f2); + return 0; } /*-----------------------BPy_IncreasingThicknessShader type definition ------------------------------*/ PyTypeObject IncreasingThicknessShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "IncreasingThicknessShader", /* tp_name */ - sizeof(BPy_IncreasingThicknessShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - IncreasingThicknessShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)IncreasingThicknessShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "IncreasingThicknessShader", /* tp_name */ + sizeof(BPy_IncreasingThicknessShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + IncreasingThicknessShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)IncreasingThicknessShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.h index 08c2a067d13..28636263813 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingThicknessShader.h @@ -32,19 +32,17 @@ extern "C" { extern PyTypeObject IncreasingThicknessShader_Type; #define BPy_IncreasingThicknessShader_Check(v) \ - (PyObject_IsInstance((PyObject *)v, (PyObject *)&IncreasingThicknessShader_Type)) + (PyObject_IsInstance((PyObject *)v, (PyObject *)&IncreasingThicknessShader_Type)) /*---------------------------Python BPy_IncreasingThicknessShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_IncreasingThicknessShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_INCREASINGTHICKNESSSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp index 3444272d77a..273e41a7b9f 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.cpp @@ -31,83 +31,84 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char PolygonalizationShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`PolygonalizationShader`\n" -"\n" -"[Geometry shader]\n" -"\n" -".. method:: __init__(error)\n" -"\n" -" Builds a PolygonalizationShader object.\n" -"\n" -" :arg error: The error we want our polygonal approximation to have\n" -" with respect to the original geometry. The smaller, the closer\n" -" the new stroke is to the orinal one. This error corresponds to\n" -" the maximum distance between the new stroke and the old one.\n" -" :type error: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Modifies the Stroke geometry so that it looks more \"polygonal\".\n" -" The basic idea is to start from the minimal stroke approximation\n" -" consisting in a line joining the first vertex to the last one and\n" -" to subdivide using the original stroke vertices until a certain\n" -" error is reached.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`PolygonalizationShader`\n" + "\n" + "[Geometry shader]\n" + "\n" + ".. method:: __init__(error)\n" + "\n" + " Builds a PolygonalizationShader object.\n" + "\n" + " :arg error: The error we want our polygonal approximation to have\n" + " with respect to the original geometry. The smaller, the closer\n" + " the new stroke is to the orinal one. This error corresponds to\n" + " the maximum distance between the new stroke and the old one.\n" + " :type error: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Modifies the Stroke geometry so that it looks more \"polygonal\".\n" + " The basic idea is to start from the minimal stroke approximation\n" + " consisting in a line joining the first vertex to the last one and\n" + " to subdivide using the original stroke vertices until a certain\n" + " error is reached.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int PolygonalizationShader___init__(BPy_PolygonalizationShader *self, PyObject *args, PyObject *kwds) +static int PolygonalizationShader___init__(BPy_PolygonalizationShader *self, + PyObject *args, + PyObject *kwds) { - static const char *kwlist[] = {"error", NULL}; - float f; + static const char *kwlist[] = {"error", NULL}; + float f; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) - return -1; - self->py_ss.ss = new StrokeShaders::PolygonalizationShader(f); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) + return -1; + self->py_ss.ss = new StrokeShaders::PolygonalizationShader(f); + return 0; } /*-----------------------BPy_PolygonalizationShader type definition ------------------------------*/ PyTypeObject PolygonalizationShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "PolygonalizationShader", /* tp_name */ - sizeof(BPy_PolygonalizationShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - PolygonalizationShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)PolygonalizationShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "PolygonalizationShader", /* tp_name */ + sizeof(BPy_PolygonalizationShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + PolygonalizationShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)PolygonalizationShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.h index dc314c29294..e44ca1caa51 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_PolygonalizationShader.h @@ -32,19 +32,17 @@ extern "C" { extern PyTypeObject PolygonalizationShader_Type; #define BPy_PolygonalizationShader_Check(v) \ - (PyObject_IsInstance((PyObject *)v, (PyObject *)&PolygonalizationShader_Type)) + (PyObject_IsInstance((PyObject *)v, (PyObject *)&PolygonalizationShader_Type)) /*---------------------------Python BPy_PolygonalizationShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_PolygonalizationShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_POLYGONALIZATIONSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp index cb8af522798..8769433123a 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.cpp @@ -31,76 +31,75 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char SamplingShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`SamplingShader`\n" -"\n" -"[Geometry shader]\n" -"\n" -".. method:: __init__(sampling)\n" -"\n" -" Builds a SamplingShader object.\n" -"\n" -" :arg sampling: The sampling to use for the stroke resampling.\n" -" :type sampling: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Resamples the stroke.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`SamplingShader`\n" + "\n" + "[Geometry shader]\n" + "\n" + ".. method:: __init__(sampling)\n" + "\n" + " Builds a SamplingShader object.\n" + "\n" + " :arg sampling: The sampling to use for the stroke resampling.\n" + " :type sampling: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Resamples the stroke.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; static int SamplingShader___init__(BPy_SamplingShader *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"sampling", NULL}; - float f; + static const char *kwlist[] = {"sampling", NULL}; + float f; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) - return -1; - self->py_ss.ss = new StrokeShaders::SamplingShader(f); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) + return -1; + self->py_ss.ss = new StrokeShaders::SamplingShader(f); + return 0; } /*-----------------------BPy_SamplingShader type definition ------------------------------*/ PyTypeObject SamplingShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "SamplingShader", /* tp_name */ - sizeof(BPy_SamplingShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - SamplingShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)SamplingShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "SamplingShader", /* tp_name */ + sizeof(BPy_SamplingShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + SamplingShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)SamplingShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.h index e474e836f11..50dbae6916e 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SamplingShader.h @@ -31,19 +31,18 @@ extern "C" { extern PyTypeObject SamplingShader_Type; -#define BPy_SamplingShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&SamplingShader_Type)) +#define BPy_SamplingShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&SamplingShader_Type)) /*---------------------------Python BPy_SamplingShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_SamplingShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_SAMPLINGSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp index 870af96caf2..72d5799412f 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp @@ -31,102 +31,106 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char SmoothingShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`SmoothingShader`\n" -"\n" -"[Geometry shader]\n" -"\n" -".. method:: __init__(num_iterations=100, factor_point=0.1,\n" -" factor_curvature=0.0, factor_curvature_difference=0.2,\n" -" aniso_point=0.0, aniso_normal=0.0, aniso_curvature=0.0,\n" -" carricature_factor=1.0)\n" -"\n" -" Builds a SmoothingShader object.\n" -"\n" -" :arg num_iterations: The number of iterations.\n" -" :type num_iterations: int\n" -" :arg factor_point: 0.1\n" -" :type factor_point: float\n" -" :arg factor_curvature: 0.0\n" -" :type factor_curvature: float\n" -" :arg factor_curvature_difference: 0.2\n" -" :type factor_curvature_difference: float\n" -" :arg aniso_point: 0.0\n" -" :type aniso_point: float\n" -" :arg aniso_normal: 0.0\n" -" :type aniso_normal: float\n" -" :arg aniso_curvature: 0.0\n" -" :type aniso_curvature: float\n" -" :arg carricature_factor: 1.0\n" -" :type carricature_factor: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Smoothes the stroke by moving the vertices to make the stroke\n" -" smoother. Uses curvature flow to converge towards a curve of\n" -" constant curvature. The diffusion method we use is anisotropic to\n" -" prevent the diffusion across corners.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`SmoothingShader`\n" + "\n" + "[Geometry shader]\n" + "\n" + ".. method:: __init__(num_iterations=100, factor_point=0.1,\n" + " factor_curvature=0.0, factor_curvature_difference=0.2,\n" + " aniso_point=0.0, aniso_normal=0.0, aniso_curvature=0.0,\n" + " carricature_factor=1.0)\n" + "\n" + " Builds a SmoothingShader object.\n" + "\n" + " :arg num_iterations: The number of iterations.\n" + " :type num_iterations: int\n" + " :arg factor_point: 0.1\n" + " :type factor_point: float\n" + " :arg factor_curvature: 0.0\n" + " :type factor_curvature: float\n" + " :arg factor_curvature_difference: 0.2\n" + " :type factor_curvature_difference: float\n" + " :arg aniso_point: 0.0\n" + " :type aniso_point: float\n" + " :arg aniso_normal: 0.0\n" + " :type aniso_normal: float\n" + " :arg aniso_curvature: 0.0\n" + " :type aniso_curvature: float\n" + " :arg carricature_factor: 1.0\n" + " :type carricature_factor: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Smoothes the stroke by moving the vertices to make the stroke\n" + " smoother. Uses curvature flow to converge towards a curve of\n" + " constant curvature. The diffusion method we use is anisotropic to\n" + " prevent the diffusion across corners.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; static int SmoothingShader___init__(BPy_SmoothingShader *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"num_iterations", "factor_point", "factor_curvature", - "factor_curvature_difference", "aniso_point", "aniso_normal", - "aniso_curvature", "carricature_factor", NULL}; - int i1 = 100; - double d2 = 0.1, d3 = 0.0, d4 = 0.2, d5 = 0.0, d6 = 0.0, d7 = 0.0, d8 = 1.0; + static const char *kwlist[] = {"num_iterations", + "factor_point", + "factor_curvature", + "factor_curvature_difference", + "aniso_point", + "aniso_normal", + "aniso_curvature", + "carricature_factor", + NULL}; + int i1 = 100; + double d2 = 0.1, d3 = 0.0, d4 = 0.2, d5 = 0.0, d6 = 0.0, d7 = 0.0, d8 = 1.0; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iddddddd", (char **)kwlist, - &i1, &d2, &d3, &d4, &d5, &d6, &d7, &d8)) - { - return -1; - } - self->py_ss.ss = new SmoothingShader(i1, d2, d3, d4, d5, d6, d7, d8); - return 0; + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "|iddddddd", (char **)kwlist, &i1, &d2, &d3, &d4, &d5, &d6, &d7, &d8)) { + return -1; + } + self->py_ss.ss = new SmoothingShader(i1, d2, d3, d4, d5, d6, d7, d8); + return 0; } /*-----------------------BPy_SmoothingShader type definition ------------------------------*/ PyTypeObject SmoothingShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "SmoothingShader", /* tp_name */ - sizeof(BPy_SmoothingShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - SmoothingShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)SmoothingShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "SmoothingShader", /* tp_name */ + sizeof(BPy_SmoothingShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + SmoothingShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)SmoothingShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.h index 35f046a6d4f..4b553d76770 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.h @@ -31,19 +31,18 @@ extern "C" { extern PyTypeObject SmoothingShader_Type; -#define BPy_SmoothingShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&SmoothingShader_Type)) +#define BPy_SmoothingShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&SmoothingShader_Type)) /*---------------------------Python BPy_SmoothingShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_SmoothingShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHONSMOOTHINGSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp index 5f1c1cb7b0d..f45d97047eb 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp @@ -32,90 +32,100 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char SpatialNoiseShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`SpatialNoiseShader`\n" -"\n" -"[Geometry shader]\n" -"\n" -".. method:: __init__(amount, scale, num_octaves, smooth, pure_random)\n" -"\n" -" Builds a SpatialNoiseShader object.\n" -"\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 pure_random: True if you don't want any coherence.\n" -" :type pure_random: bool\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Spatial Noise stroke shader. Moves the vertices to make the stroke\n" -" more noisy.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`SpatialNoiseShader`\n" + "\n" + "[Geometry shader]\n" + "\n" + ".. method:: __init__(amount, scale, num_octaves, smooth, pure_random)\n" + "\n" + " Builds a SpatialNoiseShader object.\n" + "\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 pure_random: True if you don't want any coherence.\n" + " :type pure_random: bool\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Spatial Noise stroke shader. Moves the vertices to make the stroke\n" + " more noisy.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int SpatialNoiseShader___init__(BPy_SpatialNoiseShader *self, PyObject *args, PyObject *kwds) +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; + static const char *kwlist[] = {"amount", "scale", "num_octaves", "smooth", "pure_random", NULL}; + float f1, f2; + int i3; + PyObject *obj4 = 0, *obj5 = 0; - 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; + 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; } /*-----------------------BPy_SpatialNoiseShader type definition ------------------------------*/ PyTypeObject SpatialNoiseShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "SpatialNoiseShader", /* tp_name */ - sizeof(BPy_SpatialNoiseShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - SpatialNoiseShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)SpatialNoiseShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "SpatialNoiseShader", /* tp_name */ + sizeof(BPy_SpatialNoiseShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + SpatialNoiseShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)SpatialNoiseShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.h index 73fd0c32f45..7e5e644c46f 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.h @@ -31,19 +31,18 @@ extern "C" { extern PyTypeObject SpatialNoiseShader_Type; -#define BPy_SpatialNoiseShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&SpatialNoiseShader_Type)) +#define BPy_SpatialNoiseShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&SpatialNoiseShader_Type)) /*---------------------------Python BPy_SpatialNoiseShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_SpatialNoiseShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_SPATIALNOISESHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.cpp index 8f7c3728be4..3d76d71bab6 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.cpp @@ -31,76 +31,77 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char StrokeTextureStepShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`StrokeTextureStepShader`\n" -"\n" -"[Texture shader]\n" -"\n" -".. method:: __init__(step)\n" -"\n" -" Builds a StrokeTextureStepShader object.\n" -"\n" -" :arg step: The spacing along the stroke.\n" -" :type step: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Assigns a spacing factor to the texture coordinates of the Stroke.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`StrokeTextureStepShader`\n" + "\n" + "[Texture shader]\n" + "\n" + ".. method:: __init__(step)\n" + "\n" + " Builds a StrokeTextureStepShader object.\n" + "\n" + " :arg step: The spacing along the stroke.\n" + " :type step: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Assigns a spacing factor to the texture coordinates of the Stroke.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int StrokeTextureStepShader___init__(BPy_StrokeTextureStepShader *self, PyObject *args, PyObject *kwds) +static int StrokeTextureStepShader___init__(BPy_StrokeTextureStepShader *self, + PyObject *args, + PyObject *kwds) { - static const char *kwlist[] = {"step", NULL}; - float step = 0.1; + static const char *kwlist[] = {"step", NULL}; + float step = 0.1; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &step)) - return -1; - self->py_ss.ss = new StrokeShaders::StrokeTextureStepShader(step); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &step)) + return -1; + self->py_ss.ss = new StrokeShaders::StrokeTextureStepShader(step); + return 0; } /*-----------------------BPy_StrokeTextureStepShader type definition ------------------------------*/ PyTypeObject StrokeTextureStepShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "StrokeTextureStepShader", /* tp_name */ - sizeof(BPy_StrokeTextureStepShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - StrokeTextureStepShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)StrokeTextureStepShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "StrokeTextureStepShader", /* tp_name */ + sizeof(BPy_StrokeTextureStepShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + StrokeTextureStepShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)StrokeTextureStepShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.h index 97522da52fd..d53ca139b2b 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_StrokeTextureStepShader.h @@ -33,19 +33,18 @@ extern "C" { extern PyTypeObject StrokeTextureStepShader_Type; -#define BPy_StrokeTextureStepShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&StrokeTextureStepShader_Type)) +#define BPy_StrokeTextureStepShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&StrokeTextureStepShader_Type)) /*---------------------------Python BPy_StrokeTextureStepShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_StrokeTextureStepShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_STROKETEXTURESTEPSHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp index 3ba2cec4dae..56f04fb9c88 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.cpp @@ -31,78 +31,79 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char ThicknessNoiseShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ThicknessNoiseShader`\n" -"\n" -"[Thickness shader]\n" -"\n" -".. method:: __init__(amplitude, period)\n" -"\n" -" Builds a ThicknessNoiseShader object.\n" -"\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(stroke)\n" -"\n" -" Adds some noise to the stroke thickness.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`ThicknessNoiseShader`\n" + "\n" + "[Thickness shader]\n" + "\n" + ".. method:: __init__(amplitude, period)\n" + "\n" + " Builds a ThicknessNoiseShader object.\n" + "\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(stroke)\n" + "\n" + " Adds some noise to the stroke thickness.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; -static int ThicknessNoiseShader___init__(BPy_ThicknessNoiseShader *self, PyObject *args, PyObject *kwds) +static int ThicknessNoiseShader___init__(BPy_ThicknessNoiseShader *self, + PyObject *args, + PyObject *kwds) { - static const char *kwlist[] = {"amplitude", "period", NULL}; - float f1, f2; + static const char *kwlist[] = {"amplitude", "period", NULL}; + float f1, f2; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2)) - return -1; - self->py_ss.ss = new StrokeShaders::ThicknessNoiseShader(f1, f2); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "ff", (char **)kwlist, &f1, &f2)) + return -1; + self->py_ss.ss = new StrokeShaders::ThicknessNoiseShader(f1, f2); + return 0; } /*-----------------------BPy_ThicknessNoiseShader type definition ------------------------------*/ PyTypeObject ThicknessNoiseShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "ThicknessNoiseShader", /* tp_name */ - sizeof(BPy_ThicknessNoiseShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - ThicknessNoiseShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)ThicknessNoiseShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "ThicknessNoiseShader", /* tp_name */ + sizeof(BPy_ThicknessNoiseShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + ThicknessNoiseShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)ThicknessNoiseShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.h index ec18ae24966..1a42985b245 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_ThicknessNoiseShader.h @@ -31,19 +31,18 @@ extern "C" { extern PyTypeObject ThicknessNoiseShader_Type; -#define BPy_ThicknessNoiseShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&ThicknessNoiseShader_Type)) +#define BPy_ThicknessNoiseShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&ThicknessNoiseShader_Type)) /*---------------------------Python BPy_ThicknessNoiseShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_ThicknessNoiseShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_THICKNESSNOISESHADER_H__ */ diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp index 1d33aeb559b..3c3c31f4a70 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.cpp @@ -31,77 +31,76 @@ extern "C" { //------------------------INSTANCE METHODS ---------------------------------- static char TipRemoverShader___doc__[] = -"Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`TipRemoverShader`\n" -"\n" -"[Geometry shader]\n" -"\n" -".. method:: __init__(tip_length)\n" -"\n" -" Builds a TipRemoverShader object.\n" -"\n" -" :arg tip_length: The length of the piece of stroke we want to remove\n" -" at each extremity.\n" -" :type tip_length: float\n" -"\n" -".. method:: shade(stroke)\n" -"\n" -" Removes the stroke's extremities.\n" -"\n" -" :arg stroke: A Stroke object.\n" -" :type stroke: :class:`freestyle.types.Stroke`\n"; + "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`TipRemoverShader`\n" + "\n" + "[Geometry shader]\n" + "\n" + ".. method:: __init__(tip_length)\n" + "\n" + " Builds a TipRemoverShader object.\n" + "\n" + " :arg tip_length: The length of the piece of stroke we want to remove\n" + " at each extremity.\n" + " :type tip_length: float\n" + "\n" + ".. method:: shade(stroke)\n" + "\n" + " Removes the stroke's extremities.\n" + "\n" + " :arg stroke: A Stroke object.\n" + " :type stroke: :class:`freestyle.types.Stroke`\n"; static int TipRemoverShader___init__(BPy_TipRemoverShader *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"tip_length", NULL}; - double d; + static const char *kwlist[] = {"tip_length", NULL}; + double d; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "d", (char **)kwlist, &d)) - return -1; - self->py_ss.ss = new StrokeShaders::TipRemoverShader(d); - return 0; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "d", (char **)kwlist, &d)) + return -1; + self->py_ss.ss = new StrokeShaders::TipRemoverShader(d); + return 0; } /*-----------------------BPy_TipRemoverShader type definition ------------------------------*/ PyTypeObject TipRemoverShader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "TipRemoverShader", /* tp_name */ - sizeof(BPy_TipRemoverShader), /* tp_basicsize */ - 0, /* tp_itemsize */ - 0, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - TipRemoverShader___doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - &StrokeShader_Type, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)TipRemoverShader___init__, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ + PyVarObject_HEAD_INIT(NULL, 0) "TipRemoverShader", /* tp_name */ + sizeof(BPy_TipRemoverShader), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_reserved */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + TipRemoverShader___doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + &StrokeShader_Type, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)TipRemoverShader___init__, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ }; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.h b/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.h index 9615c4caff8..a82be691c81 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.h +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_TipRemoverShader.h @@ -31,19 +31,18 @@ extern "C" { extern PyTypeObject TipRemoverShader_Type; -#define BPy_TipRemoverShader_Check(v) (PyObject_IsInstance((PyObject *)v, (PyObject *)&TipRemoverShader_Type)) +#define BPy_TipRemoverShader_Check(v) \ + (PyObject_IsInstance((PyObject *)v, (PyObject *)&TipRemoverShader_Type)) /*---------------------------Python BPy_TipRemoverShader structure definition----------*/ typedef struct { - BPy_StrokeShader py_ss; + BPy_StrokeShader py_ss; } BPy_TipRemoverShader; - /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus } #endif - #endif /* __FREESTYLE_PYTHON_TIPREMOVERSHADER_H__ */ |