Cleanup: use proper RNA struct type for ListBase type
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 22 Jun 2016 16:04:04 +0000 (18:04 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 22 Jun 2016 16:04:04 +0000 (18:04 +0200)
(otherwise all code using RNA has to link DNA_listbase.h, not clean at all!).

source/blender/makesrna/RNA_types.h
source/blender/makesrna/intern/makesrna.c
source/blender/python/intern/bpy_rna.c

index d8bea93bcbc251edc8905f71afd30fef530b0383..1d5f46a18142aa2f248ea620df3d274a89d0862c 100644 (file)
@@ -285,6 +285,11 @@ typedef struct CollectionPointerLink {
        PointerRNA ptr;
 } CollectionPointerLink;
 
+/* Copy of ListBase for RNA... */
+typedef struct CollectionListBase {
+       struct CollectionPointerLink *first, *last;
+} CollectionListBase;
+
 typedef enum RawPropertyType {
        PROP_RAW_UNSET = -1,
        PROP_RAW_INT, // XXX - abused for types that are not set, eg. MFace.verts, needs fixing.
index 535847cfc78333fe147bc767dadcd3e02c57d4d2..8d3c6cb19cfc1e0c0ffcf47fd256ec3b414ec635 100644 (file)
@@ -466,7 +466,7 @@ static const char *rna_parameter_type_name(PropertyRNA *parm)
                }
                case PROP_COLLECTION:
                {
-                       return "ListBase";
+                       return "CollectionListBase";
                }
                default:
                        return "<error, no type specified>";
index 49b806347d6b9bcdf95ee8691494c31349fe2407..1c6471c2cca5c93cc0cb3de58d3b8148ef8f0493 100644 (file)
@@ -5220,7 +5220,7 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat
                        }
                        case PROP_COLLECTION:
                        {
-                               ListBase *lb = (ListBase *)data;
+                               CollectionListBase *lb = (CollectionListBase *)data;
                                CollectionPointerLink *link;
 
                                ret = PyList_New(0);