|
Blender V4.3
|
#include <Python.h>#include "MEM_guardedalloc.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "idprop_py_ui_api.hh"#include "BKE_idprop.hh"#include "DNA_ID.h"#include "RNA_access.hh"#include "RNA_enum_types.hh"#include "py_capi_utils.hh"#include "py_capi_rna.hh"#include "python_utildefines.hh"Go to the source code of this file.
Macros | |
| #define | USE_STRING_COERCE |
Functions | |
UI Data Update | |
| static bool | args_contain_key (PyObject *kwargs, const char *name) |
| static bool | idprop_ui_data_update_base (IDPropertyUIData *ui_data, const char *rna_subtype, const char *description) |
| static bool | py_long_as_int (PyObject *py_long, int *r_int) |
| static bool | try_parse_enum_item (PyObject *py_item, const int index, IDPropertyUIDataEnumItem &item) |
| static IDPropertyUIDataEnumItem * | idprop_enum_items_from_py (PyObject *seq_fast, int &r_items_num) |
| static bool | idprop_ui_data_update_int_default (IDProperty *idprop, IDPropertyUIDataInt *ui_data, PyObject *default_value) |
| static bool | idprop_ui_data_update_int (IDProperty *idprop, PyObject *args, PyObject *kwargs) |
| static bool | idprop_ui_data_update_bool_default (IDProperty *idprop, IDPropertyUIDataBool *ui_data, PyObject *default_value) |
| static bool | idprop_ui_data_update_bool (IDProperty *idprop, PyObject *args, PyObject *kwargs) |
| static bool | idprop_ui_data_update_float_default (IDProperty *idprop, IDPropertyUIDataFloat *ui_data, PyObject *default_value) |
| static bool | idprop_ui_data_update_float (IDProperty *idprop, PyObject *args, PyObject *kwargs) |
| static bool | idprop_ui_data_update_string (IDProperty *idprop, PyObject *args, PyObject *kwargs) |
| static bool | idprop_ui_data_update_id (IDProperty *idprop, PyObject *args, PyObject *kwargs) |
| PyDoc_STRVAR (BPy_IDPropertyUIManager_update_doc, ".. method:: update( " "subtype=None, " "min=None, " "max=None, " "soft_min=None, " "soft_max=None, " "precision=None, " "step=None, " "default=None, " "id_type=None, " "items=None, " "description=None)\n" "\n" " Update the RNA information of the IDProperty used for interaction and\n" " display in the user interface. The required types for many of the keyword\n" " arguments depend on the type of the property.\n ") | |
| static PyObject * | BPy_IDPropertyUIManager_update (BPy_IDPropertyUIManager *self, PyObject *args, PyObject *kwargs) |
UI Data As Dictionary | |
| static void | idprop_ui_data_to_dict_int (IDProperty *property, PyObject *dict) |
| static void | idprop_ui_data_to_dict_bool (IDProperty *property, PyObject *dict) |
| static void | idprop_ui_data_to_dict_float (IDProperty *property, PyObject *dict) |
| static void | idprop_ui_data_to_dict_string (IDProperty *property, PyObject *dict) |
| static void | idprop_ui_data_to_dict_id (IDProperty *property, PyObject *dict) |
| PyDoc_STRVAR (BPy_IDPropertyUIManager_as_dict_doc, ".. method:: as_dict()\n" "\n" " Return a dictionary of the property's RNA UI data. The fields in the\n" " returned dictionary and their types will depend on the property's type.\n") | |
| static PyObject * | BPy_IDIDPropertyUIManager_as_dict (BPy_IDPropertyUIManager *self) |
UI Data Clear | |
| PyDoc_STRVAR (BPy_IDPropertyUIManager_clear_doc, ".. method:: clear()\n" "\n" " Remove the RNA UI data from this IDProperty.\n") | |
| static PyObject * | BPy_IDPropertyUIManager_clear (BPy_IDPropertyUIManager *self) |
UI Data Copying | |
| PyDoc_STRVAR (BPy_IDPropertyUIManager_update_from_doc, ".. method:: update_from(ui_manager_source)\n" "\n" " Copy UI data from an IDProperty in the source group to a property in this group.\n " " If the source property has no UI data, the target UI data will be reset if it exists.\n" "\n" " :raises TypeError: If the types of the two properties don't match.\n") | |
| static PyObject * | BPy_IDPropertyUIManager_update_from (BPy_IDPropertyUIManager *self, PyObject *args) |
UI Data Manager Definition | |
| static PyMethodDef | BPy_IDPropertyUIManager_methods [] |
| PyTypeObject | BPy_IDPropertyUIManager_Type |
| static PyObject * | BPy_IDPropertyUIManager_repr (BPy_IDPropertyUIManager *self) |
| static Py_hash_t | BPy_IDPropertyUIManager_hash (BPy_IDPropertyUIManager *self) |
| void | IDPropertyUIData_Init_Types () |
| #define USE_STRING_COERCE |
Definition at line 25 of file idprop_py_ui_api.cc.
|
static |
Definition at line 38 of file idprop_py_ui_api.cc.
Referenced by idprop_ui_data_update_float(), and idprop_ui_data_update_int().
|
static |
Definition at line 846 of file idprop_py_ui_api.cc.
References BLI_assert, BLI_assert_unreachable, IDPropertyUIData::description, IDP_ui_data_ensure(), IDP_ui_data_supported(), IDP_ui_data_type(), IDP_UI_DATA_TYPE_BOOLEAN, IDP_UI_DATA_TYPE_FLOAT, IDP_UI_DATA_TYPE_ID, IDP_UI_DATA_TYPE_INT, IDP_UI_DATA_TYPE_STRING, IDP_UI_DATA_TYPE_UNSUPPORTED, idprop_ui_data_to_dict_bool(), idprop_ui_data_to_dict_float(), idprop_ui_data_to_dict_id(), idprop_ui_data_to_dict_int(), idprop_ui_data_to_dict_string(), RNA_enum_identifier(), rna_enum_property_subtype_items, IDPropertyUIData::rna_subtype, and self.
|
static |
Definition at line 908 of file idprop_py_ui_api.cc.
References BLI_assert, BLI_assert_unreachable, IDP_ui_data_free(), IDP_ui_data_supported(), and self.
|
static |
Definition at line 1003 of file idprop_py_ui_api.cc.
References self.
|
static |
Definition at line 997 of file idprop_py_ui_api.cc.
References self.
|
static |
Definition at line 651 of file idprop_py_ui_api.cc.
References BLI_assert, BLI_assert_unreachable, IDP_ui_data_ensure(), IDP_ui_data_supported(), IDP_ui_data_type(), IDP_UI_DATA_TYPE_BOOLEAN, IDP_UI_DATA_TYPE_FLOAT, IDP_UI_DATA_TYPE_ID, IDP_UI_DATA_TYPE_INT, IDP_UI_DATA_TYPE_STRING, IDP_UI_DATA_TYPE_UNSUPPORTED, idprop_ui_data_update_bool(), idprop_ui_data_update_float(), idprop_ui_data_update_id(), idprop_ui_data_update_int(), idprop_ui_data_update_string(), and self.
|
static |
Definition at line 941 of file idprop_py_ui_api.cc.
References BLI_assert, BPy_IDPropertyUIManager_Type, IDP_ui_data_copy(), IDP_ui_data_free(), IDP_ui_data_supported(), BPy_IDPropertyUIManager::property, self, and IDProperty::ui_data.
|
static |
Definition at line 135 of file idprop_py_ui_api.cc.
References IDPropertyUIDataEnumItem::identifier, MEM_freeN(), and try_parse_enum_item().
Referenced by idprop_ui_data_update_int().
|
static |
Definition at line 754 of file idprop_py_ui_api.cc.
References IDPropertyUIDataBool::default_array, IDPropertyUIDataBool::default_array_len, IDPropertyUIDataBool::default_value, IDP_ARRAY, IDProperty::type, and IDProperty::ui_data.
Referenced by BPy_IDIDPropertyUIManager_as_dict().
|
static |
Definition at line 773 of file idprop_py_ui_api.cc.
References IDPropertyUIDataFloat::default_array, IDPropertyUIDataFloat::default_array_len, IDPropertyUIDataFloat::default_value, IDP_ARRAY, IDPropertyUIDataFloat::max, IDPropertyUIDataFloat::min, IDPropertyUIDataFloat::precision, IDPropertyUIDataFloat::soft_max, IDPropertyUIDataFloat::soft_min, IDPropertyUIDataFloat::step, IDProperty::type, and IDProperty::ui_data.
Referenced by BPy_IDIDPropertyUIManager_as_dict().
|
static |
Definition at line 815 of file idprop_py_ui_api.cc.
References GS, ID_OB, IDPropertyUIDataID::id_type, IDP_Id, rna_enum_id_type_items, and RNA_enum_identifier().
Referenced by BPy_IDIDPropertyUIManager_as_dict().
|
static |
Definition at line 704 of file idprop_py_ui_api.cc.
References BLI_assert, IDPropertyUIDataInt::default_array, IDPropertyUIDataInt::default_array_len, IDPropertyUIDataInt::default_value, IDPropertyUIDataEnumItem::description, IDPropertyUIDataInt::enum_items, IDPropertyUIDataInt::enum_items_num, IDPropertyUIDataEnumItem::icon, IDPropertyUIDataEnumItem::identifier, IDP_ARRAY, IDPropertyUIDataInt::max, IDPropertyUIDataInt::min, IDPropertyUIDataEnumItem::name, IDPropertyUIDataInt::soft_max, IDPropertyUIDataInt::soft_min, IDPropertyUIDataInt::step, IDProperty::type, IDProperty::ui_data, and IDPropertyUIDataEnumItem::value.
Referenced by BPy_IDIDPropertyUIManager_as_dict().
|
static |
Definition at line 804 of file idprop_py_ui_api.cc.
References IDPropertyUIDataString::default_value, and IDProperty::ui_data.
Referenced by BPy_IDIDPropertyUIManager_as_dict().
|
static |
Definition at line 48 of file idprop_py_ui_api.cc.
References BLI_strdup(), IDPropertyUIData::description, pyrna_enum_value_from_id(), rna_enum_property_subtype_items, and IDPropertyUIData::rna_subtype.
Referenced by idprop_ui_data_update_bool(), idprop_ui_data_update_float(), idprop_ui_data_update_id(), idprop_ui_data_update_int(), and idprop_ui_data_update_string().
|
static |
Definition at line 378 of file idprop_py_ui_api.cc.
References IDPropertyUIDataBool::base, ELEM, IDP_ui_data_free_unique_contents(), IDP_ui_data_type(), idprop_ui_data_update_base(), idprop_ui_data_update_bool_default(), and IDProperty::ui_data.
Referenced by BPy_IDPropertyUIManager_update().
|
static |
Definition at line 332 of file idprop_py_ui_api.cc.
References IDPropertyUIDataBool::default_array, IDPropertyUIDataBool::default_array_len, IDPropertyUIDataBool::default_value, IDP_ARRAY, len, MEM_freeN(), MEM_malloc_arrayN, PyC_AsArray(), PyC_Long_AsBool(), and IDProperty::type.
Referenced by idprop_ui_data_update_bool().
|
static |
Definition at line 468 of file idprop_py_ui_api.cc.
References args_contain_key(), IDPropertyUIDataFloat::base, ELEM, float, IDP_ui_data_free_unique_contents(), IDP_ui_data_type(), idprop_ui_data_update_base(), idprop_ui_data_update_float_default(), IDPropertyUIDataFloat::max, max, IDPropertyUIDataFloat::min, min, IDPropertyUIDataFloat::precision, IDPropertyUIDataFloat::soft_max, IDPropertyUIDataFloat::soft_min, IDPropertyUIDataFloat::step, and IDProperty::ui_data.
Referenced by BPy_IDPropertyUIManager_update().
|
static |
Definition at line 422 of file idprop_py_ui_api.cc.
References IDPropertyUIDataFloat::default_array, IDPropertyUIDataFloat::default_array_len, IDPropertyUIDataFloat::default_value, IDP_ARRAY, len, MEM_freeN(), MEM_malloc_arrayN, PyC_AsArray(), and IDProperty::type.
Referenced by idprop_ui_data_update_float().
|
static |
Definition at line 594 of file idprop_py_ui_api.cc.
References IDPropertyUIDataID::base, IDPropertyUIDataID::id_type, IDP_ui_data_free_unique_contents(), IDP_ui_data_type(), idprop_ui_data_update_base(), pyrna_enum_value_from_id(), rna_enum_id_type_items, and IDProperty::ui_data.
Referenced by BPy_IDPropertyUIManager_update().
|
static |
Definition at line 215 of file idprop_py_ui_api.cc.
References args_contain_key(), IDPropertyUIDataInt::base, ELEM, IDPropertyUIDataInt::enum_items, IDPropertyUIDataInt::enum_items_num, IDP_EnumItemsValidate(), IDP_ui_data_free_unique_contents(), IDP_ui_data_type(), idprop_enum_items_from_py(), idprop_ui_data_update_base(), idprop_ui_data_update_int_default(), IDPropertyUIDataInt::max, max, IDPropertyUIDataInt::min, min, IDPropertyUIDataInt::soft_max, IDPropertyUIDataInt::soft_min, IDPropertyUIDataInt::step, and IDProperty::ui_data.
Referenced by BPy_IDPropertyUIManager_update().
|
static |
Definition at line 172 of file idprop_py_ui_api.cc.
References IDPropertyUIDataInt::default_array, IDPropertyUIDataInt::default_array_len, IDPropertyUIDataInt::default_value, IDP_ARRAY, len, MEM_freeN(), MEM_malloc_arrayN, PyC_AsArray(), and IDProperty::type.
Referenced by idprop_ui_data_update_int().
|
static |
Definition at line 555 of file idprop_py_ui_api.cc.
References IDPropertyUIDataString::base, BLI_strdup(), IDPropertyUIDataString::default_value, IDP_ui_data_free_unique_contents(), IDP_ui_data_type(), idprop_ui_data_update_base(), and IDProperty::ui_data.
Referenced by BPy_IDPropertyUIManager_update().
| void IDPropertyUIData_Init_Types | ( | ) |
Definition at line 1061 of file idprop_py_ui_api.cc.
References BPy_IDPropertyUIManager_Type.
Referenced by BPy_init_modules(), and BPyInit_idprop_types().
|
static |
Definition at line 70 of file idprop_py_ui_api.cc.
References int.
Referenced by try_parse_enum_item().
| PyDoc_STRVAR | ( | BPy_IDPropertyUIManager_as_dict_doc | , |
| ".. method:: as_dict()\n" "\n" " Return a dictionary of the property's RNA UI data. The fields in the\n" " returned dictionary and their types will depend on the property's type.\n" | ) |
| PyDoc_STRVAR | ( | BPy_IDPropertyUIManager_clear_doc | , |
| ".. method:: clear()\n" "\n" " Remove the RNA UI data from this IDProperty.\n" | ) |
| PyDoc_STRVAR | ( | BPy_IDPropertyUIManager_update_doc | , |
| ".. method:: update( " "subtype=None, " "min=None, " "max=None, " "soft_min=None, " "soft_max=None, " "precision=None, " "step=None, " "default=None, " "id_type=None, " "items=None, " "description=None)\n" "\n" " Update the RNA information of the IDProperty used for interaction and\n" " display in the user interface. The required types for many of the keyword\n" " arguments depend on the type of the property.\n " | ) |
| PyDoc_STRVAR | ( | BPy_IDPropertyUIManager_update_from_doc | , |
| ".. method:: update_from(ui_manager_source)\n" "\n" " Copy UI data from an IDProperty in the source group to a property in this group.\n " " If the source property has no UI | data, | ||
| the target UI data will be reset if it exists.\n" "\n" " :raises TypeError:If the types of the two properties don 't match.\n" | ) |
|
static |
Similar to enum_items_from_py, which parses enum items for RNA properties. This function is simpler, since it doesn't have to parse a default value or handle the case of enum flags (PROP_ENUM_FLAG).
Definition at line 84 of file idprop_py_ui_api.cc.
References BLI_strdup(), BLI_strdup_null(), IDPropertyUIDataEnumItem::description, IDPropertyUIDataEnumItem::icon, IDPropertyUIDataEnumItem::identifier, IDPropertyUIDataEnumItem::name, py_long_as_int(), rna_enum_icon_items, RNA_enum_value_from_identifier(), and IDPropertyUIDataEnumItem::value.
Referenced by idprop_enum_items_from_py().
|
static |
Definition at line 973 of file idprop_py_ui_api.cc.
| PyTypeObject BPy_IDPropertyUIManager_Type |
Definition at line 1008 of file idprop_py_ui_api.cc.
Referenced by BPy_IDPropertyUIManager_update_from(), IDPropertyUIData_Init_Types(), and pyrna_struct_id_properties_ui().