Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stokes <kupomail@gmail.com>2013-10-14 00:59:55 +0400
committerDaniel Stokes <kupomail@gmail.com>2013-10-14 00:59:55 +0400
commit0aa392d2ff4cc29f2e53485a6456a7deb838e1bb (patch)
tree50aa44367f0df077be6115c1f9deb85656018d4d /source/blender/makesrna/intern/rna_access.c
parent6167313105cd0b65ba777459ce9333ac51e0cb3b (diff)
parent2ce3bd0d672e7e26e1a8710444872ad6478a7565 (diff)
Merged revisions 60248-60717 from trunk/blendersoc-2013-bge
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 918c67b4513..341ba02fd47 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -4419,10 +4419,12 @@ char *RNA_path_full_struct_py(struct PointerRNA *ptr)
data_path = RNA_path_from_ID_to_struct(ptr);
- ret = BLI_sprintfN("%s.%s",
- id_path, data_path);
+ /* XXX data_path may be NULL (see #36788), do we want to get the 'bpy.data.foo["bar"].(null)' stuff? */
+ ret = BLI_sprintfN("%s.%s", id_path, data_path);
- MEM_freeN(data_path);
+ if (data_path) {
+ MEM_freeN(data_path);
+ }
MEM_freeN(id_path);
return ret;
@@ -6316,14 +6318,20 @@ void _RNA_warning(const char *format, ...)
#endif
}
-bool RNA_property_equals(PointerRNA *a, PointerRNA *b, PropertyRNA *prop, bool is_strict)
+bool RNA_property_equals(PointerRNA *a, PointerRNA *b, PropertyRNA *prop, eRNAEqualsMode mode)
{
int len, fromlen;
- /* if not strict, uninitialized properties are assumed to match */
- if (!is_strict)
- if (!(RNA_property_is_set(a, prop) && RNA_property_is_set(b, prop)))
+ if (mode == RNA_EQ_UNSET_MATCH_ANY) {
+ /* uninitialized properties are assumed to match anything */
+ if (!RNA_property_is_set(a, prop) || !RNA_property_is_set(b, prop))
return true;
+ }
+ else if (mode == RNA_EQ_UNSET_MATCH_NONE) {
+ /* unset properties never match set properties */
+ if (RNA_property_is_set(a, prop) != RNA_property_is_set(b, prop))
+ return false;
+ }
/* get the length of the array to work with */
len = RNA_property_array_length(a, prop);
@@ -6437,7 +6445,7 @@ bool RNA_property_equals(PointerRNA *a, PointerRNA *b, PropertyRNA *prop, bool i
if (!STREQ(RNA_property_identifier(prop), "rna_type")) {
PointerRNA propptr_a = RNA_property_pointer_get(a, prop);
PointerRNA propptr_b = RNA_property_pointer_get(b, prop);
- return RNA_struct_equals(&propptr_a, &propptr_b, is_strict);
+ return RNA_struct_equals(&propptr_a, &propptr_b, mode);
}
break;
}
@@ -6449,7 +6457,7 @@ bool RNA_property_equals(PointerRNA *a, PointerRNA *b, PropertyRNA *prop, bool i
return true;
}
-bool RNA_struct_equals(PointerRNA *a, PointerRNA *b, bool is_strict)
+bool RNA_struct_equals(PointerRNA *a, PointerRNA *b, eRNAEqualsMode mode)
{
CollectionPropertyIterator iter;
// CollectionPropertyRNA *citerprop; /* UNUSED */
@@ -6470,7 +6478,7 @@ bool RNA_struct_equals(PointerRNA *a, PointerRNA *b, bool is_strict)
for (; iter.valid; RNA_property_collection_next(&iter)) {
PropertyRNA *prop = iter.ptr.data;
- if (!RNA_property_equals(a, b, prop, is_strict)) {
+ if (!RNA_property_equals(a, b, prop, mode)) {
equals = false;
break;
}