[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20287] branches/blender2.5/blender/source /blender: RNA: ID properties were not being shown as RNA properties anymore , fixed.

Brecht Van Lommel brecht at blender.org
Wed May 20 11:17:22 CEST 2009


Revision: 20287
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20287
Author:   blendix
Date:     2009-05-20 11:17:21 +0200 (Wed, 20 May 2009)

Log Message:
-----------
RNA: ID properties were not being shown as RNA properties anymore, fixed.
Python: fix two warnings (initialize to NULL).

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c
    branches/blender2.5/blender/source/blender/python/intern/bpy_operator_wrap.c
    branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_types.h	2009-05-20 08:45:42 UTC (rev 20286)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_types.h	2009-05-20 09:17:21 UTC (rev 20287)
@@ -109,6 +109,7 @@
 typedef struct CollectionPropertyIterator {
 	/* internal */
 	PointerRNA parent;
+	PointerRNA builtin_parent;
 	struct PropertyRNA *prop;
 	void *internal;
 	int idprop;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c	2009-05-20 08:45:42 UTC (rev 20286)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c	2009-05-20 09:17:21 UTC (rev 20287)
@@ -87,7 +87,7 @@
 {
 	IDProperty *idprop= (IDProperty*)data;
 	PropertyRNA *prop;
-	StructRNA *ptype= iter->parent.type;
+	StructRNA *ptype= iter->builtin_parent.type;
 
 	/* function to skip any id properties that are already known by RNA,
 	 * for the second loop where we go over unknown id properties */
@@ -177,7 +177,7 @@
 
 		/* try id properties */
 		if(!iter->valid) {
-			group= rna_idproperties_get(&iter->parent, 0);
+			group= rna_idproperties_get(&iter->builtin_parent, 0);
 
 			if(group) {
 				rna_iterator_listbase_end(iter);
@@ -243,7 +243,7 @@
 }
 
 /* Builtin properties iterator re-uses the Struct properties iterator, only
- * difference is that we need to see the ptr data to the type of the struct
+ * difference is that we need to set the ptr data to the type of the struct
  * whose properties we want to iterate over. */
 
 void rna_builtin_properties_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
@@ -260,6 +260,7 @@
 		newptr.id.data= NULL;
 
 	iter->parent= newptr;
+	iter->builtin_parent = *ptr;
 
 	rna_Struct_properties_begin(iter, &newptr);
 }

Modified: branches/blender2.5/blender/source/blender/python/intern/bpy_operator_wrap.c
===================================================================
--- branches/blender2.5/blender/source/blender/python/intern/bpy_operator_wrap.c	2009-05-20 08:45:42 UTC (rev 20286)
+++ branches/blender2.5/blender/source/blender/python/intern/bpy_operator_wrap.c	2009-05-20 09:17:21 UTC (rev 20287)
@@ -187,7 +187,7 @@
 {
 	PyObject *py_class = op->type->pyop_data;
 	PyObject *args;
-	PyObject *ret= NULL, *py_class_instance, *item;
+	PyObject *ret= NULL, *py_class_instance, *item= NULL;
 	int ret_flag= (mode==PYOP_POLL ? 0:OPERATOR_CANCELLED);
 
 	PyGILState_STATE gilstate = PyGILState_Ensure();

Modified: branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c	2009-05-20 08:45:42 UTC (rev 20286)
+++ branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c	2009-05-20 09:17:21 UTC (rev 20287)
@@ -1092,6 +1092,7 @@
 		case PROP_COLLECTION:
 			/* XXX not supported yet
 			 * ret = pyrna_prop_CreatePyObject(ptr, prop); */
+			ret = NULL;
 			break;
 		default:
 			PyErr_Format(PyExc_AttributeError, "RNA Error: unknown type \"%d\" (pyrna_param_to_py)", type);





More information about the Bf-blender-cvs mailing list