|
Blender V4.3
|
#include <Python.h>#include <cstddef>#include "MEM_guardedalloc.h"#include "BLI_alloca.h"#include "BLI_utildefines.h"#include "WM_types.hh"#include "bpy_capi_utils.hh"#include "bpy_rna_gizmo.hh"#include "../generic/py_capi_utils.hh"#include "../generic/python_compat.hh"#include "RNA_access.hh"#include "RNA_prototypes.hh"#include "bpy_rna.hh"Go to the source code of this file.
Classes | |
| struct | BPyGizmoWithTarget |
| struct | BPyGizmoWithTargetType |
| struct | BPyGizmoHandlerUserData |
Functions | |
Parsing Utility Functions | |
Functions used as callbacks for #PyArg_ParseTuple | |
| static int | py_rna_gizmo_parse (PyObject *o, void *p) |
| static int | py_rna_gizmo_target_id_parse (PyObject *o, void *p) |
| static int | py_rna_gizmo_target_id_parse_and_ensure_is_valid (PyObject *o, void *p) |
| static int | py_rna_gizmo_target_type_id_parse (PyObject *o, void *p) |
Gizmo Target Property Access API | |
| PyDoc_STRVAR (bpy_gizmo_target_get_value_doc, ".. method:: target_get_value(target):\n" "\n" " Get the value of this target property.\n" "\n" " :arg target: Target property name.\n" " :type target: str\n" " :return: The value of the target property as a value or array based on the target type.\n" " :rtype: float | tuple[float, ...]\n") | |
| static PyObject * | bpy_gizmo_target_get_value (PyObject *, PyObject *args, PyObject *kw) |
| PyDoc_STRVAR (bpy_gizmo_target_set_value_doc, ".. method:: target_set_value(target):\n" "\n" " Set the value of this target property.\n" "\n" " :arg target: Target property name.\n" " :type target: str\n") | |
| static PyObject * | bpy_gizmo_target_set_value (PyObject *, PyObject *args, PyObject *kw) |
| PyDoc_STRVAR (bpy_gizmo_target_get_range_doc, ".. method:: target_get_range(target):\n" "\n" " Get the range for this target property.\n" "\n" " :arg target: Target property name.\n" " :return: The range of this property (min, max).\n" " :rtype: tuple[float, float]\n") | |
| static PyObject * | bpy_gizmo_target_get_range (PyObject *, PyObject *args, PyObject *kw) |
Gizmo Module | |
| bool | BPY_rna_gizmo_module (PyObject *mod_par) |
Gizmo Target Property Define API | |
| #define | BPY_GIZMO_FN_SLOT_LEN (BPY_GIZMO_FN_SLOT_RANGE_GET + 1) |
| enum | { BPY_GIZMO_FN_SLOT_GET = 0 , BPY_GIZMO_FN_SLOT_SET , BPY_GIZMO_FN_SLOT_RANGE_GET } |
| static void | py_rna_gizmo_handler_get_cb (const wmGizmo *, wmGizmoProperty *gz_prop, void *value_p) |
| static void | py_rna_gizmo_handler_set_cb (const wmGizmo *, wmGizmoProperty *gz_prop, const void *value_p) |
| static void | py_rna_gizmo_handler_range_get_cb (const wmGizmo *, wmGizmoProperty *gz_prop, void *value_p) |
| static void | py_rna_gizmo_handler_free_cb (const wmGizmo *, wmGizmoProperty *gz_prop) |
| PyDoc_STRVAR (bpy_gizmo_target_set_handler_doc, ".. method:: target_set_handler(target, get, set, range=None):\n" "\n" " Assigns callbacks to a gizmos property.\n" "\n" " :arg target: Target property name.\n" " :type target: str\n" " :arg get: Function that returns the value for this property (single value or sequence).\n" " :type get: Callable[[], float | Sequence[float]]\n" " :arg set: Function that takes a single value argument and applies it.\n" " :type set: Callable[[tuple[float, ...]], Any]\n" " :arg range: Function that returns a (min, max) tuple for gizmos that use a range. " "The returned value is not used.\n" " :type range: callable\n") | |
| static PyObject * | bpy_gizmo_target_set_handler (PyObject *, PyObject *args, PyObject *kw) |
This file defines utility methods for bpy.types.Gizmo.
Definition in file bpy_rna_gizmo.cc.
| #define BPY_GIZMO_FN_SLOT_LEN (BPY_GIZMO_FN_SLOT_RANGE_GET + 1) |
Definition at line 139 of file bpy_rna_gizmo.cc.
Referenced by bpy_gizmo_target_set_handler(), and py_rna_gizmo_handler_free_cb().
| anonymous enum |
| Enumerator | |
|---|---|
| BPY_GIZMO_FN_SLOT_GET | |
| BPY_GIZMO_FN_SLOT_SET | |
| BPY_GIZMO_FN_SLOT_RANGE_GET | |
Definition at line 134 of file bpy_rna_gizmo.cc.
|
static |
Definition at line 603 of file bpy_rna_gizmo.cc.
References wmGizmoPropertyType::data_type, params, PROP_FLOAT, PY_ARG_PARSER_HEAD_COMPAT, py_rna_gizmo_parse(), py_rna_gizmo_target_id_parse_and_ensure_is_valid(), PyC_Tuple_PackArray_F32(), wmGizmoProperty::type, and WM_gizmo_target_property_float_range_get().
Referenced by BPY_rna_gizmo_module().
|
static |
Definition at line 446 of file bpy_rna_gizmo.cc.
References BLI_array_alloca, wmGizmoPropertyType::data_type, params, PROP_FLOAT, PY_ARG_PARSER_HEAD_COMPAT, py_rna_gizmo_parse(), py_rna_gizmo_target_id_parse_and_ensure_is_valid(), PyC_Tuple_PackArray_F32(), wmGizmoProperty::type, WM_gizmo_target_property_array_length(), WM_gizmo_target_property_float_get(), and WM_gizmo_target_property_float_get_array().
Referenced by BPY_rna_gizmo_module().
|
static |
Definition at line 333 of file bpy_rna_gizmo.cc.
References BPY_GIZMO_FN_SLOT_GET, BPY_GIZMO_FN_SLOT_LEN, BPY_GIZMO_FN_SLOT_RANGE_GET, BPY_GIZMO_FN_SLOT_SET, data, BPyGizmoHandlerUserData::fn_slots, MEM_callocN, params, PY_ARG_PARSER_HEAD_COMPAT, py_rna_gizmo_handler_free_cb(), py_rna_gizmo_handler_get_cb(), py_rna_gizmo_handler_range_get_cb(), py_rna_gizmo_handler_set_cb(), py_rna_gizmo_parse(), py_rna_gizmo_target_type_id_parse(), wmGizmoPropertyFnParams::value_get_fn, and WM_gizmo_target_property_def_func_ptr().
Referenced by BPY_rna_gizmo_module().
|
static |
Definition at line 515 of file bpy_rna_gizmo.cc.
References wmGizmoPropertyType::array_length, BLI_array_alloca, BPY_context_get(), wmGizmoPropertyType::data_type, params, PROP_FLOAT, PY_ARG_PARSER_HEAD_COMPAT, py_rna_gizmo_parse(), py_rna_gizmo_target_id_parse_and_ensure_is_valid(), PyC_AsArray(), wmGizmoProperty::type, WM_gizmo_target_property_array_length(), WM_gizmo_target_property_float_set(), and WM_gizmo_target_property_float_set_array().
Referenced by BPY_rna_gizmo_module().
| bool BPY_rna_gizmo_module | ( | PyObject * | mod_par | ) |
Definition at line 662 of file bpy_rna_gizmo.cc.
References ARRAY_SIZE, bpy_gizmo_target_get_range(), bpy_gizmo_target_get_value(), bpy_gizmo_target_set_handler(), and bpy_gizmo_target_set_value().
Referenced by BPy_init_modules().
|
static |
Definition at line 303 of file bpy_rna_gizmo.cc.
References BPY_GIZMO_FN_SLOT_LEN, wmGizmoProperty::custom_func, MEM_freeN(), and wmGizmoProperty::user_data.
Referenced by bpy_gizmo_target_set_handler().
|
static |
Definition at line 146 of file bpy_rna_gizmo.cc.
References wmGizmoPropertyType::array_length, BPY_GIZMO_FN_SLOT_GET, wmGizmoProperty::custom_func, wmGizmoPropertyType::data_type, PROP_FLOAT, PyC_AsArray(), ret, wmGizmoProperty::type, and wmGizmoProperty::user_data.
Referenced by bpy_gizmo_target_set_handler().
|
static |
Definition at line 247 of file bpy_rna_gizmo.cc.
References BPY_GIZMO_FN_SLOT_RANGE_GET, wmGizmoProperty::custom_func, wmGizmoPropertyType::data_type, PROP_FLOAT, ret, wmGizmoProperty::type, and wmGizmoProperty::user_data.
Referenced by bpy_gizmo_target_set_handler().
|
static |
Definition at line 197 of file bpy_rna_gizmo.cc.
References wmGizmoPropertyType::array_length, BPY_GIZMO_FN_SLOT_SET, wmGizmoProperty::custom_func, wmGizmoPropertyType::data_type, PROP_FLOAT, PyC_Tuple_PackArray_F32(), ret, wmGizmoProperty::type, and wmGizmoProperty::user_data.
Referenced by bpy_gizmo_target_set_handler().
|
static |
Definition at line 48 of file bpy_rna_gizmo.cc.
References BLI_assert, BPy_StructRNA_Check, ptr, RNA_struct_is_a(), and PointerRNA::type.
Referenced by bpy_gizmo_target_get_range(), bpy_gizmo_target_get_value(), bpy_gizmo_target_set_handler(), and bpy_gizmo_target_set_value().
|
static |
Definition at line 59 of file bpy_rna_gizmo.cc.
References BLI_assert, BPyGizmoWithTarget::gz, BPyGizmoWithTarget::gz_prop, wmGizmoType::idname, wmGizmo::type, and WM_gizmo_target_property_find().
Referenced by py_rna_gizmo_target_id_parse_and_ensure_is_valid().
|
static |
Definition at line 83 of file bpy_rna_gizmo.cc.
References BPyGizmoWithTarget::gz, BPyGizmoWithTarget::gz_prop, wmGizmoType::idname, py_rna_gizmo_target_id_parse(), wmGizmo::type, and WM_gizmo_target_property_is_valid().
Referenced by bpy_gizmo_target_get_range(), bpy_gizmo_target_get_value(), and bpy_gizmo_target_set_value().
|
static |
Definition at line 103 of file bpy_rna_gizmo.cc.
References BLI_assert, BPyGizmoWithTargetType::gz, BPyGizmoWithTargetType::gz_prop_type, wmGizmoType::idname, wmGizmo::type, and WM_gizmotype_target_property_find().
Referenced by bpy_gizmo_target_set_handler().
| PyDoc_STRVAR | ( | bpy_gizmo_target_get_range_doc | , |
| ".. method:: target_get_range(target):\n" "\n" " Get the range for this target property.\n" "\n" " :arg target: Target property name.\n" " :return: The range of this property (min, max).\n" " :rtype: tuple\n" | [float, float] ) |
| PyDoc_STRVAR | ( | bpy_gizmo_target_get_value_doc | , |
| ".. method:: target_get_value(target):\n" "\n" " Get the value of this target property.\n" "\n" " :arg target: Target property name.\n" " :type target: str\n" " :return: The value of the target property as a value or array based on the target type.\n" " :rtype: float | tuple\n" | [float,...] ) |
| PyDoc_STRVAR | ( | bpy_gizmo_target_set_handler_doc | , |
| ".. method:: target_set_handler(target, get, set, range=None):\n" "\n" " Assigns callbacks to a gizmos property.\n" "\n" " :arg target: Target property name.\n" " :type target: str\n" " :arg get: Function that returns the value for this property (single value or sequence).\n" " :type get: | Callable[[], | ||
| float|Sequence]\n" " :arg set:Function that takes a single value argument and applies it.\n" " :type set:Callable] | [float][[tuple[float,...], | ||
| Any]\n" " :arg range:Function that returns a(min, max) tuple for gizmos that use a range. " "The returned value is not used.\n" " :type range:callable\n" | ) |
| PyDoc_STRVAR | ( | bpy_gizmo_target_set_value_doc | , |
| ".. method:: target_set_value(target):\n" "\n" " Set the value of this target property.\n" "\n" " :arg target: Target property name.\n" " :type target: str\n" | ) |