[Bf-blender-cvs] [fb1f7fa] master: Cleanup: use proper RNA struct type for ListBase type (otherwise all code using RNA has to link DNA_listbase.h, not clean at all!).
Bastien Montagne
noreply at git.blender.org
Wed Jun 22 18:11:52 CEST 2016
Commit: fb1f7fad78e4a0a1220c7472e1332043b2ee0f85
Author: Bastien Montagne
Date: Wed Jun 22 18:04:04 2016 +0200
Branches: master
https://developer.blender.org/rBfb1f7fad78e4a0a1220c7472e1332043b2ee0f85
Cleanup: use proper RNA struct type for ListBase type
(otherwise all code using RNA has to link DNA_listbase.h, not clean at all!).
===================================================================
M source/blender/makesrna/RNA_types.h
M source/blender/makesrna/intern/makesrna.c
M source/blender/python/intern/bpy_rna.c
===================================================================
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index d8bea93..1d5f46a 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -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.
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 535847c..8d3c6cb 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -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>";
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 49b8063..1c6471c 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -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);
More information about the Bf-blender-cvs
mailing list