Cleanup: replace macros with converter callbacks for bpy.props
Macros were used for expanding shared logic for some properties. Replace this with Python converters & a funciton that handles deferred registration. Add generic converter functions for RNA enums: - pyrna_enum_value_parse_string - pyrna_enum_bitfield_parse_set
This commit is contained in:
@@ -213,6 +213,18 @@ int pyrna_set_to_enum_bitfield(const struct EnumPropertyItem *items,
|
||||
int *r_value,
|
||||
const char *error_prefix);
|
||||
|
||||
/**
|
||||
* Data for #pyrna_enum_value_parse_string & #pyrna_enum_bitfield_parse_set parsing utilities.
|
||||
* Use with #PyArg_ParseTuple's `O&` formatting.
|
||||
*/
|
||||
struct BPy_EnumProperty_Parse {
|
||||
const EnumPropertyItem *items;
|
||||
int value;
|
||||
bool is_set;
|
||||
};
|
||||
int pyrna_enum_value_parse_string(PyObject *o, void *p);
|
||||
int pyrna_enum_bitfield_parse_set(PyObject *o, void *p);
|
||||
|
||||
int pyrna_enum_value_from_id(const EnumPropertyItem *item,
|
||||
const char *identifier,
|
||||
int *value,
|
||||
|
||||
Reference in New Issue
Block a user