From ce5561b815366f714e68bd81fc130afb79c267ef Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 25 Nov 2021 10:10:47 +0100 Subject: Fix Py API: wrong doc about type of Collection property. Collection property only accepts PropertyGroup type, not ID ones. Reported on IRC by @frameshift, thanks. --- source/blender/python/intern/bpy_props.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/blender/python/intern') diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 6d384ed9358..77c2d46eda4 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -2630,10 +2630,14 @@ static int bpy_prop_arg_parse_tag_defines(PyObject *o, void *p) " This function must take 2 values (self, value) and return None.\n" \ " :type set: function\n" -#define BPY_PROPDEF_TYPE_DOC \ +#define BPY_PROPDEF_POINTER_TYPE_DOC \ " :arg type: A subclass of :class:`bpy.types.PropertyGroup` or :class:`bpy.types.ID`.\n" \ " :type type: class\n" +#define BPY_PROPDEF_COLLECTION_TYPE_DOC \ + " :arg type: A subclass of :class:`bpy.types.PropertyGroup`.\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" @@ -3981,7 +3985,7 @@ PyDoc_STRVAR(BPy_PointerProperty_doc, "update=None)\n" "\n" " Returns a new pointer property definition.\n" - "\n" BPY_PROPDEF_TYPE_DOC BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC + "\n" BPY_PROPDEF_POINTER_TYPE_DOC BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_OPTIONS_DOC BPY_PROPDEF_OPTIONS_OVERRIDE_DOC BPY_PROPDEF_TAGS_DOC BPY_PROPDEF_POLL_DOC BPY_PROPDEF_UPDATE_DOC); PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw) @@ -4104,7 +4108,7 @@ PyDoc_STRVAR(BPy_CollectionProperty_doc, "tags=set())\n" "\n" " Returns a new collection property definition.\n" - "\n" BPY_PROPDEF_TYPE_DOC BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC + "\n" BPY_PROPDEF_COLLECTION_TYPE_DOC BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC BPY_PROPDEF_OPTIONS_DOC BPY_PROPDEF_OPTIONS_OVERRIDE_COLLECTION_DOC BPY_PROPDEF_TAGS_DOC); PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw) -- cgit v1.2.3