Blender V5.3
bpy_rna_gizmo.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include <Python.h>
12#include <cstddef>
13
14#include "MEM_guardedalloc.h"
15
16#include "BLI_alloca.hh"
17#include "BLI_utildefines.hh"
18
19#include "WM_types.hh"
20
21#include "bpy_capi_utils.hh"
22#include "bpy_rna_gizmo.hh"
23
25#include "../generic/python_compat.hh" /* IWYU pragma: keep. */
26
27#include "RNA_access.hh"
28#include "RNA_prototypes.hh"
29
30#include "bpy_rna.hh"
31
32namespace blender {
33
34/* -------------------------------------------------------------------- */
39
41 wmGizmo *gz; /* Must be first. */
43};
44
46 wmGizmo *gz; /* Must be first. */
48};
49
50static int py_rna_gizmo_parse(PyObject *o, void *p)
51{
52 /* No type checking (this is `self` not a user defined argument). */
54 BLI_assert(RNA_struct_is_a(((const BPy_StructRNA *)o)->ptr->type, RNA_Gizmo));
55
56 wmGizmo **gz_p = static_cast<wmGizmo **>(p);
57 *gz_p = static_cast<wmGizmo *>((reinterpret_cast<const BPy_StructRNA *>(o))->ptr->data);
58 return 1;
59}
60
61static int py_rna_gizmo_target_id_parse(PyObject *o, void *p)
62{
63 BPyGizmoWithTarget *gizmo_with_target = static_cast<BPyGizmoWithTarget *>(p);
64 /* Must be set by `py_rna_gizmo_parse`. */
65 wmGizmo *gz = gizmo_with_target->gz;
66 BLI_assert(gz != nullptr);
67
68 if (!PyUnicode_Check(o)) {
69 PyErr_Format(PyExc_TypeError, "expected a string (got %.200s)", Py_TYPE(o)->tp_name);
70 return 0;
71 }
72 const char *gz_prop_id = PyUnicode_AsUTF8(o);
73 wmGizmoProperty *gz_prop = WM_gizmo_target_property_find(gz, gz_prop_id);
74 if (gz_prop == nullptr) {
75 PyErr_Format(PyExc_ValueError,
76 "Gizmo target property '%s.%s' not found!",
77 gz->type->idname,
78 gz_prop_id);
79 return 0;
80 }
81 gizmo_with_target->gz_prop = gz_prop;
82 return 1;
83}
84
86{
87 if (py_rna_gizmo_target_id_parse(o, p) == 0) {
88 return 0;
89 }
90 BPyGizmoWithTarget *gizmo_with_target = static_cast<BPyGizmoWithTarget *>(p);
91 wmGizmo *gz = gizmo_with_target->gz;
92 wmGizmoProperty *gz_prop = gizmo_with_target->gz_prop;
94 const char *gz_prop_id = PyUnicode_AsUTF8(o);
95 PyErr_Format(PyExc_ValueError,
96 "Gizmo target property '%s.%s' has not been initialized, "
97 "Call \"target_set_prop\" first!",
98 gz->type->idname,
99 gz_prop_id);
100 return 0;
101 }
102 return 1;
103}
104
105static int py_rna_gizmo_target_type_id_parse(PyObject *o, void *p)
106{
107 BPyGizmoWithTargetType *gizmo_with_target = static_cast<BPyGizmoWithTargetType *>(p);
108 /* Must be set first. */
109 wmGizmo *gz = gizmo_with_target->gz;
110 BLI_assert(gz != nullptr);
111
112 if (!PyUnicode_Check(o)) {
113 PyErr_Format(PyExc_TypeError, "expected a string (got %.200s)", Py_TYPE(o)->tp_name);
114 return 0;
115 }
116 const char *gz_prop_id = PyUnicode_AsUTF8(o);
118 gz_prop_id);
119 if (gz_prop_type == nullptr) {
120 PyErr_Format(PyExc_ValueError,
121 "Gizmo target property '%s.%s' not found!",
122 gz->type->idname,
123 gz_prop_id);
124 return 0;
125 }
126 gizmo_with_target->gz_prop_type = gz_prop_type;
127 return 1;
128}
129
131
132/* -------------------------------------------------------------------- */
135
136enum {
140};
141#define BPY_GIZMO_FN_SLOT_LEN (BPY_GIZMO_FN_SLOT_RANGE_GET + 1)
142
147
148static void py_rna_gizmo_handler_get_cb(const wmGizmo * /*gz*/,
149 wmGizmoProperty *gz_prop,
150 void *value_p)
151{
152 const PyGILState_STATE gilstate = PyGILState_Ensure();
153
155 gz_prop->custom_func.user_data);
156 PyObject *ret = PyObject_CallObject(data->fn_slots[BPY_GIZMO_FN_SLOT_GET], nullptr);
157 if (ret == nullptr) {
158 goto fail;
159 }
160
161 if (gz_prop->type->data_type == PROP_FLOAT) {
162 float *value = static_cast<float *>(value_p);
163 if (gz_prop->type->array_length == 1) {
164 if ((*value = PyFloat_AsDouble(ret)) == -1.0f && PyErr_Occurred()) {
165 goto fail;
166 }
167 }
168 else {
169 if (PyC_AsArray(value,
170 sizeof(*value),
171 ret,
172 gz_prop->type->array_length,
173 &PyFloat_Type,
174 "Gizmo get callback: ") == -1)
175 {
176 goto fail;
177 }
178 }
179 }
180 else {
181 PyErr_SetString(PyExc_AttributeError, "internal error, unsupported type");
182 goto fail;
183 }
184
185 Py_DECREF(ret);
186
187 PyGILState_Release(gilstate);
188 return;
189
190fail:
191 PyErr_Print();
192
193 Py_XDECREF(ret);
194
195 PyGILState_Release(gilstate);
196}
197
198static void py_rna_gizmo_handler_set_cb(const wmGizmo * /*gz*/,
199 wmGizmoProperty *gz_prop,
200 const void *value_p)
201{
202 const PyGILState_STATE gilstate = PyGILState_Ensure();
203
205 gz_prop->custom_func.user_data);
206
207 PyObject *args = PyTuple_New(1);
208 PyObject *ret;
209
210 if (gz_prop->type->data_type == PROP_FLOAT) {
211 const float *value = static_cast<const float *>(value_p);
212 PyObject *py_value;
213 if (gz_prop->type->array_length == 1) {
214 py_value = PyFloat_FromDouble(*value);
215 }
216 else {
217 py_value = PyC_Tuple_PackArray_F32(value, gz_prop->type->array_length);
218 }
219 if (py_value == nullptr) {
220 goto fail;
221 }
222 PyTuple_SET_ITEM(args, 0, py_value);
223 }
224 else {
225 PyErr_SetString(PyExc_AttributeError, "internal error, unsupported type");
226 goto fail;
227 }
228
229 ret = PyObject_CallObject(data->fn_slots[BPY_GIZMO_FN_SLOT_SET], args);
230 if (ret == nullptr) {
231 goto fail;
232 }
233 Py_DECREF(args);
234 Py_DECREF(ret);
235
236 PyGILState_Release(gilstate);
237 return;
238
239fail:
240 PyErr_Print();
241
242 Py_DECREF(args);
243
244 PyGILState_Release(gilstate);
245}
246
248 wmGizmoProperty *gz_prop,
249 void *value_p)
250{
251 const PyGILState_STATE gilstate = PyGILState_Ensure();
252
254 gz_prop->custom_func.user_data);
255
256 PyObject *ret = PyObject_CallObject(data->fn_slots[BPY_GIZMO_FN_SLOT_RANGE_GET], nullptr);
257 if (ret == nullptr) {
258 goto fail;
259 }
260
261 if (!PyTuple_Check(ret)) {
262 PyErr_Format(PyExc_TypeError, "Expected a tuple, not %.200s", Py_TYPE(ret)->tp_name);
263 goto fail;
264 }
265
266 if (PyTuple_GET_SIZE(ret) != 2) {
267 PyErr_Format(PyExc_TypeError, "Expected a tuple of size 2, not %d", PyTuple_GET_SIZE(ret));
268 goto fail;
269 }
270
271 if (gz_prop->type->data_type == PROP_FLOAT) {
272 float range[2];
273 for (int i = 0; i < 2; i++) {
274 if (((range[i] = PyFloat_AsDouble(PyTuple_GET_ITEM(ret, i))) == -1.0f && PyErr_Occurred()) ==
275 0)
276 {
277 /* pass */
278 }
279 else {
280 goto fail;
281 }
282 }
283 memcpy(value_p, range, sizeof(range));
284 }
285 else {
286 PyErr_SetString(PyExc_AttributeError, "internal error, unsupported type");
287 goto fail;
288 }
289
290 Py_DECREF(ret);
291 PyGILState_Release(gilstate);
292 return;
293
294fail:
295 PyErr_Print();
296
297 Py_XDECREF(ret);
298
299 PyGILState_Release(gilstate);
300}
301
302static void py_rna_gizmo_handler_free_cb(const wmGizmo * /*gz*/, wmGizmoProperty *gz_prop)
303{
304 const PyGILState_STATE gilstate = PyGILState_Ensure();
305
307 gz_prop->custom_func.user_data);
308
309 for (int i = 0; i < BPY_GIZMO_FN_SLOT_LEN; i++) {
310 Py_XDECREF(data->fn_slots[i]);
311 }
312 PyGILState_Release(gilstate);
313
314 MEM_delete(data);
315}
316
318 /* Wrap. */
319 bpy_gizmo_target_set_handler_doc,
320 ".. method:: target_set_handler(target, get, set, range=None)\n"
321 "\n"
322 " Assigns callbacks to a gizmos property.\n"
323 "\n"
324 " :param target: Target property name.\n"
325 " :type target: str\n"
326 " :param get: Function that returns the value for this property "
327 "(single value or sequence).\n"
328 " :type get: Callable[[], float | Sequence[float]]\n"
329 " :param set: Function that takes a single value argument and applies it.\n"
330 " :type set: Callable[[tuple[float, ...]], Any]\n"
331 " :param range: Function that returns a (min, max) tuple for gizmos that use a range. "
332 "The returned value is not used.\n"
333 " :type range: Callable[[], tuple[float, float]] | None\n");
334static PyObject *bpy_gizmo_target_set_handler(PyObject * /*self*/, PyObject *args, PyObject *kw)
335{
336 struct {
337 BPyGizmoWithTargetType gz_with_target_type;
338 PyObject *py_fn_slots[BPY_GIZMO_FN_SLOT_LEN];
339 } params = {
340 {nullptr, nullptr},
341 {nullptr},
342 };
343
344 /* NOTE: this is a counter-part to functions:
345 * 'Gizmo.target_set_prop & target_set_operator'
346 * (see: rna_wm_gizmo_api.cc). conventions should match. */
347 static const char *const _keywords[] = {"self", "target", "get", "set", "range", nullptr};
348 static _PyArg_Parser _parser = {
349 "O&" /* `self` */
350 "O&" /* `target` */
351 "|$" /* Optional, keyword only arguments. */
352 "O" /* `get` */
353 "O" /* `set` */
354 "O" /* `range` */
355 ":target_set_handler",
356 _keywords,
357 nullptr,
358 };
359
361 const wmGizmoPropertyType *gz_prop_type;
362 wmGizmo *gz;
363
364 if (!_PyArg_ParseTupleAndKeywordsFast(args,
365 kw,
366 &_parser,
367 /* `self` */
369 &params.gz_with_target_type.gz,
370 /* `target` */
372 &params.gz_with_target_type,
373 /* `get/set/range` */
374 &params.py_fn_slots[BPY_GIZMO_FN_SLOT_GET],
375 &params.py_fn_slots[BPY_GIZMO_FN_SLOT_SET],
376 &params.py_fn_slots[BPY_GIZMO_FN_SLOT_RANGE_GET]))
377 {
378 goto fail;
379 }
380
381 gz = params.gz_with_target_type.gz;
382 gz_prop_type = params.gz_with_target_type.gz_prop_type;
383
384 if (params.py_fn_slots[BPY_GIZMO_FN_SLOT_RANGE_GET] == Py_None) {
385 params.py_fn_slots[BPY_GIZMO_FN_SLOT_RANGE_GET] = nullptr;
386 }
387
388 {
389 const int slots_required = 2;
390 const int slots_start = 2;
391 for (int i = 0; i < BPY_GIZMO_FN_SLOT_LEN; i++) {
392 if (params.py_fn_slots[i] == nullptr) {
393 if (i < slots_required) {
394 PyErr_Format(PyExc_ValueError, "Argument '%s' not given", _keywords[slots_start + i]);
395 goto fail;
396 }
397 }
398 else if (!PyCallable_Check(params.py_fn_slots[i])) {
399 PyErr_Format(PyExc_ValueError, "Argument '%s' not callable", _keywords[slots_start + i]);
400 goto fail;
401 }
402 }
403 }
404
406
407 for (int i = 0; i < BPY_GIZMO_FN_SLOT_LEN; i++) {
408 data->fn_slots[i] = params.py_fn_slots[i];
409 Py_XINCREF(params.py_fn_slots[i]);
410 }
411
412 {
413 wmGizmoPropertyFnParams fn_params{};
418 fn_params.user_data = data;
419 WM_gizmo_target_property_def_func_ptr(gz, gz_prop_type, &fn_params);
420 }
421
422 Py_RETURN_NONE;
423
424fail:
425 return nullptr;
426}
427
429
430/* -------------------------------------------------------------------- */
433
435 /* Wrap. */
436 bpy_gizmo_target_get_value_doc,
437 ".. method:: target_get_value(target)\n"
438 "\n"
439 " Get the value of this target property.\n"
440 "\n"
441 " :param target: Target property name.\n"
442 " :type target: str\n"
443 " :return: The value of the target property as a value or array based on the target type.\n"
444 " :rtype: float | tuple[float, ...]\n");
445static PyObject *bpy_gizmo_target_get_value(PyObject * /*self*/, PyObject *args, PyObject *kw)
446{
447 struct {
448 BPyGizmoWithTarget gz_with_target;
449 } params = {
450 {nullptr, nullptr},
451 };
452
453 static const char *const _keywords[] = {"self", "target", nullptr};
454 static _PyArg_Parser _parser = {
455 "O&" /* `self` */
456 "O&" /* `target` */
457 ":target_get_value",
458 _keywords,
459 nullptr,
460 };
461
462 int array_len;
463 wmGizmo *gz;
464 wmGizmoProperty *gz_prop;
465
466 if (!_PyArg_ParseTupleAndKeywordsFast(args,
467 kw,
468 &_parser,
469 /* `self` */
471 &params.gz_with_target.gz,
472 /* `target` */
474 &params.gz_with_target))
475 {
476 goto fail;
477 }
478
479 gz = params.gz_with_target.gz;
480 gz_prop = params.gz_with_target.gz_prop;
481
482 array_len = WM_gizmo_target_property_array_length(gz, gz_prop);
483 switch (gz_prop->type->data_type) {
484 case PROP_FLOAT: {
485 if (array_len != 0) {
486 float *value = static_cast<float *>(BLI_array_alloca(value, array_len));
488 return PyC_Tuple_PackArray_F32(value, array_len);
489 }
490
491 const float value = WM_gizmo_target_property_float_get(gz, gz_prop);
492 return PyFloat_FromDouble(value);
493 }
494 default: {
495 PyErr_SetString(PyExc_RuntimeError, "Not yet supported type");
496 goto fail;
497 }
498 }
499
500fail:
501 return nullptr;
502}
503
505 /* Wrap. */
506 bpy_gizmo_target_set_value_doc,
507 ".. method:: target_set_value(target)\n"
508 "\n"
509 " Set the value of this target property.\n"
510 "\n"
511 " :param target: Target property name.\n"
512 " :type target: str\n");
513static PyObject *bpy_gizmo_target_set_value(PyObject * /*self*/, PyObject *args, PyObject *kw)
514{
515 struct {
516 BPyGizmoWithTarget gz_with_target;
517 PyObject *value;
518 } params = {
519 {nullptr, nullptr},
520 nullptr,
521 };
522
523 static const char *const _keywords[] = {"self", "target", "value", nullptr};
524 static _PyArg_Parser _parser = {
525 "O&" /* `self` */
526 "O&" /* `target` */
527 "O" /* `value` */
528 ":target_set_value",
529 _keywords,
530 nullptr,
531 };
532
533 wmGizmo *gz;
534 wmGizmoProperty *gz_prop;
535 int array_len;
536
537 if (!_PyArg_ParseTupleAndKeywordsFast(args,
538 kw,
539 &_parser,
540 /* `self` */
542 &params.gz_with_target.gz,
543 /* `target` */
545 &params.gz_with_target,
546 /* `value` */
547 &params.value))
548 {
549 goto fail;
550 }
551
552 gz = params.gz_with_target.gz;
553 gz_prop = params.gz_with_target.gz_prop;
554
555 array_len = WM_gizmo_target_property_array_length(gz, gz_prop);
556 switch (gz_prop->type->data_type) {
557 case PROP_FLOAT: {
558 if (array_len != 0) {
559 float *value = static_cast<float *>(BLI_array_alloca(value, array_len));
560 if (PyC_AsArray(value,
561 sizeof(*value),
562 params.value,
563 gz_prop->type->array_length,
564 &PyFloat_Type,
565 "Gizmo target property array: ") == -1)
566 {
567 goto fail;
568 }
570 }
571 else {
572 float value;
573 if ((value = PyFloat_AsDouble(params.value)) == -1.0f && PyErr_Occurred()) {
574 goto fail;
575 }
577 }
578 Py_RETURN_NONE;
579 }
580 default: {
581 PyErr_SetString(PyExc_RuntimeError, "Not yet supported type");
582 goto fail;
583 }
584 }
585
586fail:
587 return nullptr;
588}
589
591 /* Wrap. */
592 bpy_gizmo_target_get_range_doc,
593 ".. method:: target_get_range(target)\n"
594 "\n"
595 " Get the range for this target property.\n"
596 "\n"
597 " :param target: Target property name.\n"
598 " :type target: str\n"
599 " :return: The range of this property (min, max).\n"
600 " :rtype: tuple[float, float]\n");
601static PyObject *bpy_gizmo_target_get_range(PyObject * /*self*/, PyObject *args, PyObject *kw)
602{
603 struct {
604 BPyGizmoWithTarget gz_with_target;
605 } params = {
606 {nullptr, nullptr},
607 };
608
609 static const char *const _keywords[] = {"self", "target", nullptr};
610 static _PyArg_Parser _parser = {
611 "O&" /* `self` */
612 "O&" /* `target` */
613 ":target_get_range",
614 _keywords,
615 nullptr,
616 };
617
618 wmGizmo *gz;
619 wmGizmoProperty *gz_prop;
620
621 if (!_PyArg_ParseTupleAndKeywordsFast(args,
622 kw,
623 &_parser,
624 /* `self` */
626 &params.gz_with_target.gz,
627 /* `target` */
629 &params.gz_with_target))
630 {
631 goto fail;
632 }
633
634 gz = params.gz_with_target.gz;
635 gz_prop = params.gz_with_target.gz_prop;
636
637 switch (gz_prop->type->data_type) {
638 case PROP_FLOAT: {
639 float range[2];
641 return PyC_Tuple_PackArray_F32(range, 2);
642 }
643 default: {
644 PyErr_SetString(PyExc_RuntimeError, "Not yet supported type");
645 goto fail;
646 }
647 }
648
649fail:
650 return nullptr;
651}
652
654
655/* -------------------------------------------------------------------- */
658
659bool BPY_rna_gizmo_module(PyObject *mod_par)
660{
661
662#ifdef __GNUC__
663# ifdef __clang__
664# pragma clang diagnostic push
665# pragma clang diagnostic ignored "-Wcast-function-type"
666# else
667# pragma GCC diagnostic push
668# pragma GCC diagnostic ignored "-Wcast-function-type"
669# endif
670#endif
671
672 static PyMethodDef method_def_array[] = {
673 /* Gizmo Target Property Define API */
674 {"target_set_handler",
675 reinterpret_cast<PyCFunction>(bpy_gizmo_target_set_handler),
676 METH_VARARGS | METH_KEYWORDS,
677 bpy_gizmo_target_set_handler_doc},
678 /* Gizmo Target Property Access API */
679 {"target_get_value",
680 reinterpret_cast<PyCFunction>(bpy_gizmo_target_get_value),
681 METH_VARARGS | METH_KEYWORDS,
682 bpy_gizmo_target_get_value_doc},
683 {"target_set_value",
684 reinterpret_cast<PyCFunction>(bpy_gizmo_target_set_value),
685 METH_VARARGS | METH_KEYWORDS,
686 bpy_gizmo_target_set_value_doc},
687 {"target_get_range",
688 reinterpret_cast<PyCFunction>(bpy_gizmo_target_get_range),
689 METH_VARARGS | METH_KEYWORDS,
690 bpy_gizmo_target_get_range_doc},
691 /* no sentinel needed. */
692 };
693
694#ifdef __GNUC__
695# ifdef __clang__
696# pragma clang diagnostic pop
697# else
698# pragma GCC diagnostic pop
699# endif
700#endif
701
702 for (int i = 0; i < ARRAY_SIZE(method_def_array); i++) {
703 PyMethodDef *m = &method_def_array[i];
704 PyObject *func = PyCFunction_New(m, nullptr);
705 PyObject *func_inst = PyInstanceMethod_New(func);
706 Py_DECREF(func);
707 char name_prefix[128];
708 PyOS_snprintf(name_prefix, sizeof(name_prefix), "_rna_gizmo_%s", m->ml_name);
709 /* TODO: return a type that binds nearly to a method. */
710 PyModule_AddObject(mod_par, name_prefix, func_inst);
711 }
712
713 return false;
714}
715
717
718} // namespace blender
#define BLI_array_alloca(arr, realsize)
Definition BLI_alloca.hh:18
Read Blender memory allocation and freeing.
#define BPy_StructRNA_Check(v)
Definition bpy_rna.hh:76
#define BPY_GIZMO_FN_SLOT_LEN
BMesh Iterators.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
@ BPY_GIZMO_FN_SLOT_GET
@ BPY_GIZMO_FN_SLOT_SET
@ BPY_GIZMO_FN_SLOT_RANGE_GET
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
bool BPY_rna_gizmo_module(PyObject *mod_par)
void WM_gizmo_target_property_float_get_array(const wmGizmo *gz, wmGizmoProperty *gz_prop, float *value)
const wmGizmoPropertyType * WM_gizmotype_target_property_find(const wmGizmoType *gzt, const char *idname)
void WM_gizmo_target_property_def_func_ptr(wmGizmo *gz, const wmGizmoPropertyType *gz_prop_type, const wmGizmoPropertyFnParams *params)
PyDoc_STRVAR(bpy_bm_new_doc, ".. function:: new(*, use_operators=True)\n" "\n" " :param use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
static int py_rna_gizmo_target_id_parse_and_ensure_is_valid(PyObject *o, void *p)
int PyC_AsArray(void *array, const size_t array_item_size, PyObject *value, const Py_ssize_t length, const PyTypeObject *type, const char *error_prefix)
static void py_rna_gizmo_handler_set_cb(const wmGizmo *, wmGizmoProperty *gz_prop, const void *value_p)
static int py_rna_gizmo_parse(PyObject *o, void *p)
static void py_rna_gizmo_handler_range_get_cb(const wmGizmo *, wmGizmoProperty *gz_prop, void *value_p)
void WM_gizmo_target_property_float_set(bContext *C, const wmGizmo *gz, wmGizmoProperty *gz_prop, const float value)
static void py_rna_gizmo_handler_get_cb(const wmGizmo *, wmGizmoProperty *gz_prop, void *value_p)
void WM_gizmo_target_property_float_set_array(bContext *C, const wmGizmo *gz, wmGizmoProperty *gz_prop, const float *value)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
struct bContext * BPY_context_get()
BMesh const char void * data
static void py_rna_gizmo_handler_free_cb(const wmGizmo *, wmGizmoProperty *gz_prop)
wmGizmoProperty * WM_gizmo_target_property_find(wmGizmo *gz, const char *idname)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
bool WM_gizmo_target_property_is_valid(const wmGizmoProperty *gz_prop)
static PyObject * bpy_gizmo_target_set_handler(PyObject *, PyObject *args, PyObject *kw)
static PyObject * bpy_gizmo_target_get_value(PyObject *, PyObject *args, PyObject *kw)
static int py_rna_gizmo_target_id_parse(PyObject *o, void *p)
PyObject * PyC_Tuple_PackArray_F32(const float *array, uint len)
static PyObject * bpy_gizmo_target_get_range(PyObject *, PyObject *args, PyObject *kw)
static int py_rna_gizmo_target_type_id_parse(PyObject *o, void *p)
static PyObject * bpy_gizmo_target_set_value(PyObject *, PyObject *args, PyObject *kw)
int WM_gizmo_target_property_array_length(const wmGizmo *, wmGizmoProperty *gz_prop)
float WM_gizmo_target_property_float_get(const wmGizmo *gz, wmGizmoProperty *gz_prop)
bool WM_gizmo_target_property_float_range_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, float range[2])
header-only compatibility defines.
PyObject * fn_slots[BPY_GIZMO_FN_SLOT_LEN]
const wmGizmoPropertyType * gz_prop_type
wmGizmoPropertyFnSet value_set_fn
wmGizmoPropertyFnRangeGet range_get_fn
wmGizmoPropertyFnGet value_get_fn
wmGizmoPropertyFnFree free_fn
const wmGizmoPropertyType * type
struct blender::wmGizmoProperty::@216011055122204070127377170176223170047224321165 custom_func
const wmGizmoType * type