RNA
[blender.git] / source / blender / python / intern / bpy_rna.c
index 207ca41ed46f4ab373df606f22a3e6f6c30adefb..4cdc78297d4cc8ee0f0910ea8c86bdcf66285997 100644 (file)
@@ -481,7 +481,9 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v
                                BPy_StructRNA *param= (BPy_StructRNA*)value;
                                int raise_error= 0;
                                if(data) {
-                                       if(ptype == &RNA_AnyType) {
+                                       int flag = RNA_property_flag(prop);
+
+                                       if(flag & PROP_RNAPTR) {
                                                if(value == Py_None)
                                                        memset(data, 0, sizeof(PointerRNA));
                                                else
@@ -1209,8 +1211,9 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
                {
                        PointerRNA newptr;
                        StructRNA *type= RNA_property_pointer_type(ptr, prop);
+                       int flag = RNA_property_flag(prop);
 
-                       if(type == &RNA_AnyType) {
+                       if(flag & PROP_RNAPTR) {
                                /* in this case we get the full ptr */
                                newptr= *(PointerRNA*)data;
                        }