29 "Class hierarchy: :class:`Interface0D` > :class:`CurvePoint` > :class:`StrokeVertex`\n"
31 "Class to define a stroke vertex.\n"
33 ".. method:: __init__()\n"
34 " __init__(brother)\n"
35 " __init__(first_vertex, second_vertex, t3d)\n"
37 " __init__(svertex)\n"
38 " __init__(svertex, attribute)\n"
40 " Builds a :class:`StrokeVertex` using the default constructor,\n"
41 " copy constructor, from 2 :class:`StrokeVertex` and an interpolation parameter,\n"
42 " from a CurvePoint, from a SVertex, or a :class:`SVertex`"
43 " and a :class:`StrokeAttribute` object.\n"
45 " :arg brother: A StrokeVertex object.\n"
46 " :type brother: :class:`StrokeVertex`\n"
47 " :arg first_vertex: The first StrokeVertex.\n"
48 " :type first_vertex: :class:`StrokeVertex`\n"
49 " :arg second_vertex: The second StrokeVertex.\n"
50 " :type second_vertex: :class:`StrokeVertex`\n"
51 " :arg t3d: An interpolation parameter.\n"
53 " :arg point: A CurvePoint object.\n"
54 " :type point: :class:`CurvePoint`\n"
55 " :arg svertex: An SVertex object.\n"
56 " :type svertex: :class:`SVertex`\n"
57 " :arg svertex: An SVertex object.\n"
58 " :type svertex: :class:`SVertex`\n"
59 " :arg attribute: A StrokeAttribute object.\n"
60 " :type attribute: :class:`StrokeAttribute`");
64 static const char *kwlist_1[] = {
"brother",
nullptr};
65 static const char *kwlist_2[] = {
"first_vertex",
"second_vertex",
"t3d",
nullptr};
66 static const char *kwlist_3[] = {
"point",
nullptr};
67 static const char *kwlist_4[] = {
"svertex",
"attribute",
nullptr};
68 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
71 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
StrokeVertex_Type, &obj1))
78 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid StrokeVertex object");
84 else if ((
void)PyErr_Clear(),
85 PyArg_ParseTupleAndKeywords(args,
97 if (!sv1 || (sv1->
A() ==
nullptr && sv1->
B() ==
nullptr)) {
98 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid StrokeVertex object");
101 if (!sv2 || (sv2->
A() ==
nullptr && sv2->
B() ==
nullptr)) {
102 PyErr_SetString(PyExc_TypeError,
"argument 2 is an invalid StrokeVertex object");
107 else if ((
void)PyErr_Clear(),
108 PyArg_ParseTupleAndKeywords(
112 if (!cp || cp->
A() ==
nullptr || cp->
B() ==
nullptr) {
113 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid CurvePoint object");
118 else if ((
void)PyErr_Clear(),
119 (
void)(obj2 =
nullptr),
120 PyArg_ParseTupleAndKeywords(args,
137 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
141 self->py_cp.py_if0D.if0D =
self->sv;
142 self->py_cp.py_if0D.borrowed =
false;
226 StrokeVertex_attribute_doc,
227 "StrokeAttribute for this StrokeVertex.\n"
229 ":type: :class:`StrokeAttribute`");
239 PyErr_SetString(PyExc_TypeError,
"value must be a StrokeAttribute object");
248 StrokeVertex_curvilinear_abscissa_doc,
249 "Curvilinear abscissa of this StrokeVertex in the Stroke.\n"
255 return PyFloat_FromDouble(
self->sv->curvilinearAbscissa());
263 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
265 PyErr_SetString(PyExc_TypeError,
"value must be a number");
268 self->sv->setCurvilinearAbscissa(scalar);
274 StrokeVertex_point_doc,
275 "2D point coordinates.\n"
277 ":type: :class:`mathutils.Vector`");
290 self->sv->setX(
v[0]);
291 self->sv->setY(
v[1]);
297 StrokeVertex_stroke_length_doc,
298 "Stroke length (it is only a value retained by the StrokeVertex,\n"
299 "and it won't change the real stroke length).\n"
305 return PyFloat_FromDouble(
self->sv->strokeLength());
313 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
315 PyErr_SetString(PyExc_TypeError,
"value must be a number");
318 self->sv->setStrokeLength(scalar);
325 "Curvilinear abscissa of this StrokeVertex in the Stroke.\n"
331 return PyFloat_FromDouble(
self->sv->u());
338 StrokeVertex_attribute_doc,
340 {
"curvilinear_abscissa",
343 StrokeVertex_curvilinear_abscissa_doc,
348 StrokeVertex_point_doc,
353 StrokeVertex_stroke_length_doc,
356 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
362 PyVarObject_HEAD_INIT(
nullptr, 0)
381 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * BPy_StrokeAttribute_from_StrokeAttribute(StrokeAttribute &sa)
PyTypeObject CurvePoint_Type
PyTypeObject SVertex_Type
PyTypeObject StrokeAttribute_Type
#define BPy_StrokeAttribute_Check(v)
static PyGetSetDef BPy_StrokeVertex_getseters[]
static Mathutils_Callback StrokeVertex_mathutils_cb
static int StrokeVertex_point_set(BPy_StrokeVertex *self, PyObject *value, void *)
static int StrokeVertex_mathutils_check(BaseMathObject *bmo)
static int StrokeVertex_curvilinear_abscissa_set(BPy_StrokeVertex *self, PyObject *value, void *)
static PyObject * StrokeVertex_point_get(BPy_StrokeVertex *self, void *)
static PyObject * StrokeVertex_attribute_get(BPy_StrokeVertex *self, void *)
static int StrokeVertex_stroke_length_set(BPy_StrokeVertex *self, PyObject *value, void *)
static int StrokeVertex_mathutils_get(BaseMathObject *bmo, int)
static int StrokeVertex_mathutils_set_index(BaseMathObject *bmo, int, int index)
static int StrokeVertex_init(BPy_StrokeVertex *self, PyObject *args, PyObject *kwds)
static PyObject * StrokeVertex_curvilinear_abscissa_get(BPy_StrokeVertex *self, void *)
static PyObject * StrokeVertex_u_get(BPy_StrokeVertex *self, void *)
static int StrokeVertex_mathutils_get_index(BaseMathObject *bmo, int, int index)
static uchar StrokeVertex_mathutils_cb_index
static int StrokeVertex_mathutils_set(BaseMathObject *bmo, int)
void StrokeVertex_mathutils_register_callback()
static PyObject * StrokeVertex_stroke_length_get(BPy_StrokeVertex *self, void *)
static int StrokeVertex_attribute_set(BPy_StrokeVertex *self, PyObject *value, void *)
PyTypeObject StrokeVertex_Type
PyDoc_STRVAR(StrokeVertex_doc, "Class hierarchy: :class:`Interface0D` > :class:`CurvePoint` > :class:`StrokeVertex`\n" "\n" "Class to define a stroke vertex.\n" "\n" ".. method:: __init__()\n" " __init__(brother)\n" " __init__(first_vertex, second_vertex, t3d)\n" " __init__(point)\n" " __init__(svertex)\n" " __init__(svertex, attribute)\n" "\n" " Builds a :class:`StrokeVertex` using the default constructor,\n" " copy constructor, from 2 :class:`StrokeVertex` and an interpolation parameter,\n" " from a CurvePoint, from a SVertex, or a :class:`SVertex`" " and a :class:`StrokeAttribute` object.\n" "\n" " :arg brother: A StrokeVertex object.\n" " :type brother: :class:`StrokeVertex`\n" " :arg first_vertex: The first StrokeVertex.\n" " :type first_vertex: :class:`StrokeVertex`\n" " :arg second_vertex: The second StrokeVertex.\n" " :type second_vertex: :class:`StrokeVertex`\n" " :arg t3d: An interpolation parameter.\n" " :type t3d: float\n" " :arg point: A CurvePoint object.\n" " :type point: :class:`CurvePoint`\n" " :arg svertex: An SVertex object.\n" " :type svertex: :class:`SVertex`\n" " :arg svertex: An SVertex object.\n" " :type svertex: :class:`SVertex`\n" " :arg attribute: A StrokeAttribute object.\n" " :type attribute: :class:`StrokeAttribute`")
#define BPy_StrokeVertex_Check(v)
ATTR_WARN_UNUSED_RESULT const BMVert * v
draw_view in_light_buf[] float
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
uchar Mathutils_RegisterCallback(Mathutils_Callback *cb)
PyObject * Vector_CreatePyObject_cb(PyObject *cb_user, int vec_num, uchar cb_type, uchar cb_subtype)