Blender  V3.3
Macros
idprop_py_ui_api.c File Reference
#include <Python.h>
#include "MEM_guardedalloc.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "idprop_py_ui_api.h"
#include "BKE_idprop.h"
#include "DNA_ID.h"
#include "RNA_access.h"
#include "RNA_enum_types.h"
#include "py_capi_utils.h"
#include "py_capi_rna.h"
#include "python_utildefines.h"

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 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_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, " "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_float (IDProperty *property, PyObject *dict)
 
static void idprop_ui_data_to_dict_string (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 struct 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 ()
 

Macro Definition Documentation

◆ USE_STRING_COERCE

#define USE_STRING_COERCE

Definition at line 23 of file idprop_py_ui_api.c.

Function Documentation

◆ args_contain_key()

static bool args_contain_key ( PyObject *  kwargs,
const char *  name 
)
static

Definition at line 36 of file idprop_py_ui_api.c.

References NULL, and result.

Referenced by idprop_ui_data_update_float(), and idprop_ui_data_update_int().

◆ BPy_IDIDPropertyUIManager_as_dict()

static PyObject* BPy_IDIDPropertyUIManager_as_dict ( BPy_IDPropertyUIManager self)
static

◆ BPy_IDPropertyUIManager_clear()

static PyObject* BPy_IDPropertyUIManager_clear ( BPy_IDPropertyUIManager self)
static

◆ BPy_IDPropertyUIManager_hash()

static Py_hash_t BPy_IDPropertyUIManager_hash ( BPy_IDPropertyUIManager self)
static

Definition at line 656 of file idprop_py_ui_api.c.

References self.

◆ BPy_IDPropertyUIManager_repr()

static PyObject* BPy_IDPropertyUIManager_repr ( BPy_IDPropertyUIManager self)
static

Definition at line 650 of file idprop_py_ui_api.c.

References self.

◆ BPy_IDPropertyUIManager_update()

static PyObject* BPy_IDPropertyUIManager_update ( BPy_IDPropertyUIManager self,
PyObject *  args,
PyObject *  kwargs 
)
static

◆ BPy_IDPropertyUIManager_update_from()

static PyObject* BPy_IDPropertyUIManager_update_from ( BPy_IDPropertyUIManager self,
PyObject *  args 
)
static

Definition at line 603 of file idprop_py_ui_api.c.

◆ idprop_ui_data_to_dict_float()

static void idprop_ui_data_to_dict_float ( IDProperty property,
PyObject *  dict 
)
static

◆ idprop_ui_data_to_dict_int()

static void idprop_ui_data_to_dict_int ( IDProperty property,
PyObject *  dict 
)
static

◆ idprop_ui_data_to_dict_string()

static void idprop_ui_data_to_dict_string ( IDProperty property,
PyObject *  dict 
)
static

◆ idprop_ui_data_update_base()

static bool idprop_ui_data_update_base ( IDPropertyUIData ui_data,
const char *  rna_subtype,
const char *  description 
)
static

◆ idprop_ui_data_update_float()

static bool idprop_ui_data_update_float ( IDProperty idprop,
PyObject *  args,
PyObject *  kwargs 
)
static

◆ idprop_ui_data_update_float_default()

static bool idprop_ui_data_update_float_default ( IDProperty idprop,
IDPropertyUIDataFloat ui_data,
PyObject *  default_value 
)
static
Note
The default value needs special handling because for array IDProperties it can be a single value or an array, but for non-array properties it can only be a value.

Definition at line 188 of file idprop_py_ui_api.c.

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().

◆ idprop_ui_data_update_id()

static bool idprop_ui_data_update_id ( IDProperty idprop,
PyObject *  args,
PyObject *  kwargs 
)
static
Returns
False when parsing fails, in which case caller should return NULL.

Definition at line 352 of file idprop_py_ui_api.c.

References IDPropertyUIDataID::base, IDP_ui_data_free_unique_contents(), IDP_ui_data_type(), idprop_ui_data_update_base(), if(), NULL, and IDProperty::ui_data.

Referenced by BPy_IDPropertyUIManager_update().

◆ idprop_ui_data_update_int()

static bool idprop_ui_data_update_int ( IDProperty idprop,
PyObject *  args,
PyObject *  kwargs 
)
static

◆ idprop_ui_data_update_int_default()

static bool idprop_ui_data_update_int_default ( IDProperty idprop,
IDPropertyUIDataInt ui_data,
PyObject *  default_value 
)
static
Note
The default value needs special handling because for array IDProperties it can be a single value or an array, but for non-array properties it can only be a value.

Definition at line 77 of file idprop_py_ui_api.c.

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().

◆ idprop_ui_data_update_string()

static bool idprop_ui_data_update_string ( IDProperty idprop,
PyObject *  args,
PyObject *  kwargs 
)
static
Returns
False when parsing fails, in which case caller should return NULL.

Definition at line 314 of file idprop_py_ui_api.c.

References IDPropertyUIDataString::base, BLI_strdup(), IDP_ui_data_free_unique_contents(), IDP_ui_data_type(), idprop_ui_data_update_base(), if(), NULL, and IDProperty::ui_data.

Referenced by BPy_IDPropertyUIManager_update().

◆ IDPropertyUIData_Init_Types()

void IDPropertyUIData_Init_Types ( void  )

Definition at line 722 of file idprop_py_ui_api.c.

References BPy_IDPropertyUIManager_Type.

Referenced by BPy_init_modules(), and BPyInit_idprop_types().

◆ PyDoc_STRVAR() [1/4]

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() [2/4]

PyDoc_STRVAR ( BPy_IDPropertyUIManager_clear_doc  ,
".. method:: clear()\n" "\n" " Remove the RNA UI data from this IDProperty.\n"   
)

◆ PyDoc_STRVAR() [3/4]

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, " "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() [4/4]

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"   
)

Variable Documentation

◆ BPy_IDPropertyUIManager_methods

struct PyMethodDef BPy_IDPropertyUIManager_methods[]
static
Initial value:
= {
{"update",
METH_VARARGS | METH_KEYWORDS,
BPy_IDPropertyUIManager_update_doc},
{"as_dict",
METH_NOARGS,
BPy_IDPropertyUIManager_as_dict_doc},
{"clear",
METH_NOARGS,
BPy_IDPropertyUIManager_clear_doc},
{"update_from",
METH_VARARGS,
BPy_IDPropertyUIManager_update_from_doc},
{NULL, NULL, 0, NULL},
}
static PyObject * BPy_IDIDPropertyUIManager_as_dict(BPy_IDPropertyUIManager *self)
static PyObject * BPy_IDPropertyUIManager_update_from(BPy_IDPropertyUIManager *self, PyObject *args)
static PyObject * BPy_IDPropertyUIManager_clear(BPy_IDPropertyUIManager *self)
static PyObject * BPy_IDPropertyUIManager_update(BPy_IDPropertyUIManager *self, PyObject *args, PyObject *kwargs)

Definition at line 603 of file idprop_py_ui_api.c.

◆ BPy_IDPropertyUIManager_Type

PyTypeObject BPy_IDPropertyUIManager_Type