Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/intern/bpy_props.c')
-rw-r--r--source/blender/python/intern/bpy_props.c161
1 files changed, 129 insertions, 32 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index daef323058c..c3d96227dea 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -1874,7 +1874,22 @@ static void bpy_prop_callback_assign_enum(struct PropertyRNA *prop, PyObject *ge
#_func"(options={ ...}):"))) \
{ \
return NULL; \
- } (void)0
+ } \
+ { \
+ const EnumPropertyItem *tag_defines = RNA_struct_property_tag_defines(srna); \
+ if (py_tags && !tag_defines) { \
+ PyErr_Format(PyExc_TypeError, \
+ #_func"(): property-tags not available for '%s'", \
+ RNA_struct_identifier(srna)); \
+ return NULL; \
+ } \
+ if (UNLIKELY(py_tags && pyrna_set_to_enum_bitfield( \
+ tag_defines, py_tags, \
+ &prop_tags, #_func"(tags={ ...}):"))) \
+ { \
+ return NULL; \
+ } \
+ }(void)0
#define BPY_PROPDEF_SUBTYPE_CHECK(_func, _property_flag_items, _subtype) \
BPY_PROPDEF_CHECK(_func, _property_flag_items); \
@@ -1957,6 +1972,10 @@ static void bpy_prop_callback_assign_enum(struct PropertyRNA *prop, PyObject *ge
" :arg type: A subclass of :class:`bpy.types.PropertyGroup` or :class:`bpy.types.ID`.\n" \
" :type type: class\n" \
+#define BPY_PROPDEF_TAGS_DOC \
+" :arg tags: Enumerator of tags that are defined by parent class.\n" \
+" :type tags: set\n" \
+
#if 0
static int bpy_struct_id_used(StructRNA *srna, char *identifier)
{
@@ -1975,6 +1994,7 @@ PyDoc_STRVAR(BPy_BoolProperty_doc,
"description=\"\", "
"default=False, "
"options={'ANIMATABLE'}, "
+ "tags={}, "
"subtype='NONE', "
"update=None, "
"get=None, "
@@ -1985,6 +2005,7 @@ PyDoc_STRVAR(BPy_BoolProperty_doc,
BPY_PROPDEF_NAME_DOC
BPY_PROPDEF_DESC_DOC
BPY_PROPDEF_OPTIONS_DOC
+BPY_PROPDEF_TAGS_DOC
BPY_PROPDEF_SUBTYPE_NUMBER_DOC
BPY_PROPDEF_UPDATE_DOC
BPY_PROPDEF_GET_DOC
@@ -2003,22 +2024,25 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
PropertyRNA *prop;
PyObject *pyopts = NULL;
int opts = 0;
+ int prop_tags = 0;
const char *pysubtype = NULL;
int subtype = PROP_NONE;
PyObject *update_cb = NULL;
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
+ PyObject *py_tags = NULL;
static const char *_keywords[] = {
"attr", "name", "description", "default",
- "options", "subtype", "update", "get", "set", NULL,
+ "options", "tags", "subtype",
+ "update", "get", "set", NULL,
};
- static _PyArg_Parser _parser = {"s#|ssO&O!sOOO:BoolProperty", _keywords, 0};
+ static _PyArg_Parser _parser = {"s#|ssO&O!O!sOOO:BoolProperty", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
args, kw, &_parser,
&id, &id_len,
&name, &description, PyC_ParseBool, &def,
- &PySet_Type, &pyopts, &pysubtype,
+ &PySet_Type, &pyopts, &PySet_Type, &py_tags, &pysubtype,
&update_cb, &get_cb, &set_cb))
{
return NULL;
@@ -2040,6 +2064,9 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
RNA_def_property_boolean_default(prop, def);
RNA_def_property_ui_text(prop, name ? name : id, description);
+ if (py_tags) {
+ RNA_def_property_tags(prop, prop_tags);
+ }
if (pyopts) {
bpy_prop_assign_flag(prop, opts);
}
@@ -2056,6 +2083,7 @@ PyDoc_STRVAR(BPy_BoolVectorProperty_doc,
"description=\"\", "
"default=(False, False, False), "
"options={'ANIMATABLE'}, "
+ "tags={}, "
"subtype='NONE', "
"size=3, "
"update=None, "
@@ -2069,6 +2097,7 @@ BPY_PROPDEF_DESC_DOC
" :arg default: sequence of booleans the length of *size*.\n"
" :type default: sequence\n"
BPY_PROPDEF_OPTIONS_DOC
+BPY_PROPDEF_TAGS_DOC
BPY_PROPDEF_SUBTYPE_ARRAY_DOC
BPY_PROPDEF_VECSIZE_DOC
BPY_PROPDEF_UPDATE_DOC
@@ -2090,22 +2119,26 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
PyObject *pydef = NULL;
PyObject *pyopts = NULL;
int opts = 0;
+ int prop_tags = 0;
const char *pysubtype = NULL;
int subtype = PROP_NONE;
PyObject *update_cb = NULL;
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
+ PyObject *py_tags = NULL;
static const char *_keywords[] = {
"attr", "name", "description", "default",
- "options", "subtype", "size", "update", "get", "set", NULL,
+ "options", "tags", "subtype", "size",
+ "update", "get", "set", NULL,
};
- static _PyArg_Parser _parser = {"s#|ssOO!siOOO:BoolVectorProperty", _keywords, 0};
+ static _PyArg_Parser _parser = {"s#|ssOO!O!siOOO:BoolVectorProperty", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
args, kw, &_parser,
&id, &id_len,
&name, &description, &pydef,
- &PySet_Type, &pyopts, &pysubtype, &size,
+ &PySet_Type, &pyopts, &PySet_Type, &py_tags,
+ &pysubtype, &size,
&update_cb, &get_cb, &set_cb))
{
return NULL;
@@ -2139,6 +2172,9 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
if (pydef) RNA_def_property_boolean_array_default(prop, def);
RNA_def_property_ui_text(prop, name ? name : id, description);
+ if (py_tags) {
+ RNA_def_property_tags(prop, prop_tags);
+ }
if (pyopts) {
bpy_prop_assign_flag(prop, opts);
}
@@ -2158,6 +2194,7 @@ PyDoc_STRVAR(BPy_IntProperty_doc,
"soft_min=-2**31, soft_max=2**31-1, "
"step=1, "
"options={'ANIMATABLE'}, "
+ "tags={}, "
"subtype='NONE', "
"update=None, "
"get=None, "
@@ -2177,6 +2214,7 @@ BPY_PROPDEF_NUM_SOFTMIN_DOC
" :type soft_max: int\n"
BPY_PROPDEF_INT_STEP_DOC
BPY_PROPDEF_OPTIONS_DOC
+BPY_PROPDEF_TAGS_DOC
BPY_PROPDEF_SUBTYPE_NUMBER_DOC
BPY_PROPDEF_UPDATE_DOC
BPY_PROPDEF_GET_DOC
@@ -2195,24 +2233,27 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
PropertyRNA *prop;
PyObject *pyopts = NULL;
int opts = 0;
+ int prop_tags = 0;
const char *pysubtype = NULL;
int subtype = PROP_NONE;
PyObject *update_cb = NULL;
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
+ PyObject *py_tags = NULL;
static const char *_keywords[] = {
"attr", "name", "description", "default",
"min", "max", "soft_min", "soft_max",
- "step", "options", "subtype", "update", "get", "set", NULL,
+ "step", "options", "tags", "subtype",
+ "update", "get", "set", NULL,
};
- static _PyArg_Parser _parser = {"s#|ssiiiiiiO!sOOO:IntProperty", _keywords, 0};
+ static _PyArg_Parser _parser = {"s#|ssiiiiiiO!O!sOOO:IntProperty", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
args, kw, &_parser,
&id, &id_len,
&name, &description, &def,
&min, &max, &soft_min, &soft_max,
- &step, &PySet_Type, &pyopts, &pysubtype,
+ &step, &PySet_Type, &pyopts, &PySet_Type, &py_tags, &pysubtype,
&update_cb, &get_cb, &set_cb))
{
return NULL;
@@ -2236,6 +2277,9 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
RNA_def_property_range(prop, min, max);
RNA_def_property_ui_range(prop, MAX2(soft_min, min), MIN2(soft_max, max), step, 3);
+ if (py_tags) {
+ RNA_def_property_tags(prop, prop_tags);
+ }
if (pyopts) {
bpy_prop_assign_flag(prop, opts);
}
@@ -2254,6 +2298,7 @@ PyDoc_STRVAR(BPy_IntVectorProperty_doc,
"soft_max=2**31-1, "
"step=1, "
"options={'ANIMATABLE'}, "
+ "tags={}, "
"subtype='NONE', "
"size=3, "
"update=None, "
@@ -2276,6 +2321,7 @@ BPY_PROPDEF_NUM_SOFTMAX_DOC
" :type soft_max: int\n"
BPY_PROPDEF_INT_STEP_DOC
BPY_PROPDEF_OPTIONS_DOC
+BPY_PROPDEF_TAGS_DOC
BPY_PROPDEF_SUBTYPE_ARRAY_DOC
BPY_PROPDEF_VECSIZE_DOC
BPY_PROPDEF_UPDATE_DOC
@@ -2298,24 +2344,27 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
PyObject *pydef = NULL;
PyObject *pyopts = NULL;
int opts = 0;
+ int prop_tags = 0;
const char *pysubtype = NULL;
int subtype = PROP_NONE;
PyObject *update_cb = NULL;
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
+ PyObject *py_tags = NULL;
static const char *_keywords[] = {
"attr", "name", "description", "default",
"min", "max", "soft_min", "soft_max",
- "step", "options", "subtype", "size", "update", "get", "set", NULL,
+ "step", "options", "tags", "subtype", "size",
+ "update", "get", "set", NULL,
};
- static _PyArg_Parser _parser = {"s#|ssOiiiiiO!siOOO:IntVectorProperty", _keywords, 0};
+ static _PyArg_Parser _parser = {"s#|ssOiiiiiO!O!siOOO:IntVectorProperty", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
args, kw, &_parser,
&id, &id_len,
&name, &description, &pydef,
&min, &max, &soft_min, &soft_max,
- &step, &PySet_Type, &pyopts,
+ &step, &PySet_Type, &pyopts, &PySet_Type, &py_tags,
&pysubtype, &size,
&update_cb, &get_cb, &set_cb))
{
@@ -2351,6 +2400,9 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
RNA_def_property_ui_text(prop, name ? name : id, description);
RNA_def_property_ui_range(prop, MAX2(soft_min, min), MIN2(soft_max, max), step, 3);
+ if (py_tags) {
+ RNA_def_property_tags(prop, prop_tags);
+ }
if (pyopts) {
bpy_prop_assign_flag(prop, opts);
}
@@ -2371,6 +2423,7 @@ PyDoc_STRVAR(BPy_FloatProperty_doc,
"step=3, "
"precision=2, "
"options={'ANIMATABLE'}, "
+ "tags={}, "
"subtype='NONE', "
"unit='NONE', "
"update=None, "
@@ -2392,6 +2445,7 @@ BPY_PROPDEF_NUM_SOFTMAX_DOC
BPY_PROPDEF_FLOAT_STEP_DOC
BPY_PROPDEF_FLOAT_PREC_DOC
BPY_PROPDEF_OPTIONS_DOC
+BPY_PROPDEF_TAGS_DOC
BPY_PROPDEF_SUBTYPE_NUMBER_DOC
BPY_PROPDEF_UNIT_DOC
BPY_PROPDEF_UPDATE_DOC
@@ -2412,6 +2466,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
PropertyRNA *prop;
PyObject *pyopts = NULL;
int opts = 0;
+ int prop_tags = 0;
const char *pysubtype = NULL;
int subtype = PROP_NONE;
const char *pyunit = NULL;
@@ -2419,21 +2474,22 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
PyObject *update_cb = NULL;
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
+ PyObject *py_tags = NULL;
static const char *_keywords[] = {
"attr", "name", "description", "default",
"min", "max", "soft_min", "soft_max",
- "step", "precision", "options", "subtype",
+ "step", "precision", "options", "tags", "subtype",
"unit", "update", "get", "set", NULL,
};
- static _PyArg_Parser _parser = {"s#|ssffffffiO!ssOOO:FloatProperty", _keywords, 0};
+ static _PyArg_Parser _parser = {"s#|ssffffffiO!O!ssOOO:FloatProperty", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
args, kw, &_parser,
&id, &id_len,
&name, &description, &def,
&min, &max, &soft_min, &soft_max,
&step, &precision, &PySet_Type,
- &pyopts, &pysubtype, &pyunit,
+ &pyopts, &PySet_Type, &py_tags, &pysubtype, &pyunit,
&update_cb, &get_cb, &set_cb))
{
return NULL;
@@ -2462,6 +2518,9 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
RNA_def_property_ui_text(prop, name ? name : id, description);
RNA_def_property_ui_range(prop, MAX2(soft_min, min), MIN2(soft_max, max), step, precision);
+ if (py_tags) {
+ RNA_def_property_tags(prop, prop_tags);
+ }
if (pyopts) {
bpy_prop_assign_flag(prop, opts);
}
@@ -2481,6 +2540,7 @@ PyDoc_STRVAR(BPy_FloatVectorProperty_doc,
"step=3, "
"precision=2, "
"options={'ANIMATABLE'}, "
+ "tags={}, "
"subtype='NONE', "
"unit='NONE', "
"size=3, "
@@ -2503,6 +2563,7 @@ BPY_PROPDEF_NUM_SOFTMIN_DOC
BPY_PROPDEF_NUM_SOFTMAX_DOC
" :type soft_max: float\n"
BPY_PROPDEF_OPTIONS_DOC
+BPY_PROPDEF_TAGS_DOC
BPY_PROPDEF_FLOAT_STEP_DOC
BPY_PROPDEF_FLOAT_PREC_DOC
BPY_PROPDEF_SUBTYPE_ARRAY_DOC
@@ -2528,6 +2589,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
PyObject *pydef = NULL;
PyObject *pyopts = NULL;
int opts = 0;
+ int prop_tags = 0;
const char *pysubtype = NULL;
int subtype = PROP_NONE;
const char *pyunit = NULL;
@@ -2535,21 +2597,22 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
PyObject *update_cb = NULL;
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
+ PyObject *py_tags = NULL;
static const char *_keywords[] = {
"attr", "name", "description", "default",
"min", "max", "soft_min", "soft_max",
- "step", "precision", "options", "subtype",
+ "step", "precision", "options", "tags", "subtype",
"unit", "size", "update", "get", "set", NULL,
};
- static _PyArg_Parser _parser = {"s#|ssOfffffiO!ssiOOO:FloatVectorProperty", _keywords, 0};
+ static _PyArg_Parser _parser = {"s#|ssOfffffiO!O!ssiOOO:FloatVectorProperty", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
args, kw, &_parser,
&id, &id_len,
&name, &description, &pydef,
&min, &max, &soft_min, &soft_max,
&step, &precision, &PySet_Type,
- &pyopts, &pysubtype, &pyunit, &size,
+ &pyopts, &PySet_Type, &py_tags, &pysubtype, &pyunit, &size,
&update_cb, &get_cb, &set_cb))
{
return NULL;
@@ -2589,6 +2652,9 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
RNA_def_property_ui_text(prop, name ? name : id, description);
RNA_def_property_ui_range(prop, MAX2(soft_min, min), MIN2(soft_max, max), step, precision);
+ if (py_tags) {
+ RNA_def_property_tags(prop, prop_tags);
+ }
if (pyopts) {
bpy_prop_assign_flag(prop, opts);
}
@@ -2605,6 +2671,7 @@ PyDoc_STRVAR(BPy_StringProperty_doc,
"default=\"\", "
"maxlen=0, "
"options={'ANIMATABLE'}, "
+ "tags={}, "
"subtype='NONE', "
"update=None, "
"get=None, "
@@ -2619,6 +2686,7 @@ BPY_PROPDEF_DESC_DOC
" :arg maxlen: maximum length of the string.\n"
" :type maxlen: int\n"
BPY_PROPDEF_OPTIONS_DOC
+BPY_PROPDEF_TAGS_DOC
BPY_PROPDEF_SUBTYPE_STRING_DOC
BPY_PROPDEF_UPDATE_DOC
BPY_PROPDEF_GET_DOC
@@ -2637,22 +2705,25 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
PropertyRNA *prop;
PyObject *pyopts = NULL;
int opts = 0;
+ int prop_tags = 0;
const char *pysubtype = NULL;
int subtype = PROP_NONE;
PyObject *update_cb = NULL;
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
+ PyObject *py_tags = NULL;
static const char *_keywords[] = {
"attr", "name", "description", "default",
- "maxlen", "options", "subtype", "update", "get", "set", NULL,
+ "maxlen", "options", "tags", "subtype",
+ "update", "get", "set", NULL,
};
- static _PyArg_Parser _parser = {"s#|sssiO!sOOO:StringProperty", _keywords, 0};
+ static _PyArg_Parser _parser = {"s#|sssiO!O!sOOO:StringProperty", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
args, kw, &_parser,
&id, &id_len,
&name, &description, &def,
- &maxlen, &PySet_Type, &pyopts, &pysubtype,
+ &maxlen, &PySet_Type, &pyopts, &PySet_Type, &py_tags, &pysubtype,
&update_cb, &get_cb, &set_cb))
{
return NULL;
@@ -2675,6 +2746,9 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw
if (def && def[0]) RNA_def_property_string_default(prop, def);
RNA_def_property_ui_text(prop, name ? name : id, description);
+ if (py_tags) {
+ RNA_def_property_tags(prop, prop_tags);
+ }
if (pyopts) {
bpy_prop_assign_flag(prop, opts);
}
@@ -2691,6 +2765,7 @@ PyDoc_STRVAR(BPy_EnumProperty_doc,
"description=\"\", "
"default=None, "
"options={'ANIMATABLE'}, "
+ "tags={}, "
"update=None, "
"get=None, "
"set=None)\n"
@@ -2732,6 +2807,7 @@ BPY_PROPDEF_DESC_DOC
" (i.e. if a callback function is given as *items* parameter).\n"
" :type default: string or set\n"
BPY_PROPDEF_OPTIONS_ENUM_DOC
+BPY_PROPDEF_TAGS_DOC
BPY_PROPDEF_UPDATE_DOC
BPY_PROPDEF_GET_DOC
BPY_PROPDEF_SET_DOC
@@ -2752,21 +2828,23 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
PropertyRNA *prop;
PyObject *pyopts = NULL;
int opts = 0;
+ int prop_tags = 0;
bool is_itemf = false;
PyObject *update_cb = NULL;
PyObject *get_cb = NULL;
PyObject *set_cb = NULL;
+ PyObject *py_tags = NULL;
static const char *_keywords[] = {
"attr", "items", "name", "description", "default",
- "options", "update", "get", "set", NULL,
+ "options", "tags", "update", "get", "set", NULL,
};
- static _PyArg_Parser _parser = {"s#O|ssOO!OOO:EnumProperty", _keywords, 0};
+ static _PyArg_Parser _parser = {"s#O|ssOO!O!OOO:EnumProperty", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
args, kw, &_parser,
&id, &id_len,
&items, &name, &description,
- &def, &PySet_Type, &pyopts,
+ &def, &PySet_Type, &pyopts, &PySet_Type, &py_tags,
&update_cb, &get_cb, &set_cb))
{
return NULL;
@@ -2829,6 +2907,9 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
if (opts & PROP_ENUM_FLAG) prop = RNA_def_enum_flag(srna, id, eitems, defvalue, name ? name : id, description);
else prop = RNA_def_enum(srna, id, eitems, defvalue, name ? name : id, description);
+ if (py_tags) {
+ RNA_def_property_tags(prop, prop_tags);
+ }
if (pyopts) {
bpy_prop_assign_flag(prop, opts);
}
@@ -2877,6 +2958,7 @@ PyDoc_STRVAR(BPy_PointerProperty_doc,
"name=\"\", "
"description=\"\", "
"options={'ANIMATABLE'}, "
+ "tags={}, "
"poll=None, "
"update=None)\n"
"\n"
@@ -2886,6 +2968,7 @@ BPY_PROPDEF_TYPE_DOC
BPY_PROPDEF_NAME_DOC
BPY_PROPDEF_DESC_DOC
BPY_PROPDEF_OPTIONS_DOC
+BPY_PROPDEF_TAGS_DOC
BPY_PROPDEF_POLL_DOC
BPY_PROPDEF_UPDATE_DOC
);
@@ -2902,18 +2985,21 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *ptype;
PyObject *type = Py_None;
PyObject *pyopts = NULL;
+ PyObject *py_tags = NULL;
int opts = 0;
+ int prop_tags = 0;
PyObject *update_cb = NULL, *poll_cb = NULL;
static const char *_keywords[] = {
- "attr", "type", "name", "description", "options", "poll", "update", NULL,
+ "attr", "type", "name", "description", "options",
+ "tags", "poll", "update", NULL,
};
- static _PyArg_Parser _parser = {"s#O|ssO!OO:PointerProperty", _keywords, 0};
+ static _PyArg_Parser _parser = {"s#O|ssO!O!OO:PointerProperty", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
args, kw, &_parser,
&id, &id_len,
&type, &name, &description,
- &PySet_Type, &pyopts,
+ &PySet_Type, &pyopts, &PySet_Type, &py_tags,
&poll_cb, &update_cb))
{
return NULL;
@@ -2937,6 +3023,9 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
return NULL;
}
prop = RNA_def_pointer_runtime(srna, id, ptype, name ? name : id, description);
+ if (py_tags) {
+ RNA_def_property_tags(prop, prop_tags);
+ }
if (pyopts) {
bpy_prop_assign_flag(prop, opts);
}
@@ -2957,7 +3046,8 @@ PyDoc_STRVAR(BPy_CollectionProperty_doc,
".. function:: CollectionProperty(type=None, "
"name=\"\", "
"description=\"\", "
- "options={'ANIMATABLE'})\n"
+ "options={'ANIMATABLE'}, "
+ "tags={})\n"
"\n"
" Returns a new collection property definition.\n"
"\n"
@@ -2965,6 +3055,7 @@ BPY_PROPDEF_TYPE_DOC
BPY_PROPDEF_NAME_DOC
BPY_PROPDEF_DESC_DOC
BPY_PROPDEF_OPTIONS_DOC
+BPY_PROPDEF_TAGS_DOC
);
PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
{
@@ -2979,17 +3070,20 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA *ptype;
PyObject *type = Py_None;
PyObject *pyopts = NULL;
+ PyObject *py_tags = NULL;
int opts = 0;
+ int prop_tags = 0;
static const char *_keywords[] = {
- "attr", "type", "name", "description", "options", NULL,
+ "attr", "type", "name", "description",
+ "options", "tags", NULL,
};
- static _PyArg_Parser _parser = {"s#O|ssO!:CollectionProperty", _keywords, 0};
+ static _PyArg_Parser _parser = {"s#O|ssO!O!:CollectionProperty", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
args, kw, &_parser,
&id, &id_len,
&type, &name, &description,
- &PySet_Type, &pyopts))
+ &PySet_Type, &pyopts, &PySet_Type, &py_tags))
{
return NULL;
}
@@ -3008,6 +3102,9 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
}
prop = RNA_def_collection_runtime(srna, id, ptype, name ? name : id, description);
+ if (py_tags) {
+ RNA_def_property_tags(prop, prop_tags);
+ }
if (pyopts) {
bpy_prop_assign_flag(prop, opts);
}