Blender  V3.3
BPy_BackboneStretcherShader.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 
9 #include "../../stroke/BasicStrokeShaders.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 using namespace Freestyle;
16 
18 
19 //------------------------INSTANCE METHODS ----------------------------------
20 
22  "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`BackboneStretcherShader`\n"
23  "\n"
24  "[Geometry shader]\n"
25  "\n"
26  ".. method:: __init__(amount=2.0)\n"
27  "\n"
28  " Builds a BackboneStretcherShader object.\n"
29  "\n"
30  " :arg amount: The stretching amount value.\n"
31  " :type amount: float\n"
32  "\n"
33  ".. method:: shade(stroke)\n"
34  "\n"
35  " Stretches the stroke at its two extremities and following the\n"
36  " respective directions: v(1)v(0) and v(n-1)v(n).\n"
37  "\n"
38  " :arg stroke: A Stroke object.\n"
39  " :type stroke: :class:`freestyle.types.Stroke`\n";
40 
42  PyObject *args,
43  PyObject *kwds)
44 {
45  static const char *kwlist[] = {"amount", nullptr};
46  float f = 2.0;
47 
48  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|f", (char **)kwlist, &f)) {
49  return -1;
50  }
51  self->py_ss.ss = new StrokeShaders::BackboneStretcherShader(f);
52  return 0;
53 }
54 
55 /*-----------------------BPy_BackboneStretcherShader type definition ----------------------------*/
56 
58  PyVarObject_HEAD_INIT(nullptr, 0) "BackboneStretcherShader", /* tp_name */
59  sizeof(BPy_BackboneStretcherShader), /* tp_basicsize */
60  0, /* tp_itemsize */
61  nullptr, /* tp_dealloc */
62  0, /* tp_vectorcall_offset */
63  nullptr, /* tp_getattr */
64  nullptr, /* tp_setattr */
65  nullptr, /* tp_reserved */
66  nullptr, /* tp_repr */
67  nullptr, /* tp_as_number */
68  nullptr, /* tp_as_sequence */
69  nullptr, /* tp_as_mapping */
70  nullptr, /* tp_hash */
71  nullptr, /* tp_call */
72  nullptr, /* tp_str */
73  nullptr, /* tp_getattro */
74  nullptr, /* tp_setattro */
75  nullptr, /* tp_as_buffer */
76  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
78  nullptr, /* tp_traverse */
79  nullptr, /* tp_clear */
80  nullptr, /* tp_richcompare */
81  0, /* tp_weaklistoffset */
82  nullptr, /* tp_iter */
83  nullptr, /* tp_iternext */
84  nullptr, /* tp_methods */
85  nullptr, /* tp_members */
86  nullptr, /* tp_getset */
87  &StrokeShader_Type, /* tp_base */
88  nullptr, /* tp_dict */
89  nullptr, /* tp_descr_get */
90  nullptr, /* tp_descr_set */
91  0, /* tp_dictoffset */
92  (initproc)BackboneStretcherShader___init__, /* tp_init */
93  nullptr, /* tp_alloc */
94  nullptr, /* tp_new */
95 };
96 
98 
99 #ifdef __cplusplus
100 }
101 #endif
static char BackboneStretcherShader___doc__[]
PyTypeObject BackboneStretcherShader_Type
static int BackboneStretcherShader___init__(BPy_BackboneStretcherShader *self, PyObject *args, PyObject *kwds)
PyTypeObject StrokeShader_Type
inherits from class Rep
Definition: AppCanvas.cpp:18