LibOverride: Fix inverted logic in RNA collection operation application.
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 21 Aug 2019 15:10:40 +0000 (17:10 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 21 Aug 2019 15:13:51 +0000 (17:13 +0200)
Note to self: need to recheck the namings of whole override code,
currently this is way to confusing and inconsistent.

source/blender/makesrna/intern/rna_access.c

index b78a3304cc799b94e8b1a08c75d0d84e7c601932..fb3aad8ddbae3df2669df4052229539848b8bb8c 100644 (file)
@@ -8871,45 +8871,41 @@ static void rna_property_override_apply_ex(Main *bmain,
       RNA_POINTER_INVALIDATE(&private_ptr_item_storage);
       if (opop->subitem_local_name != NULL) {
         RNA_property_collection_lookup_string(
-            ptr_local, prop_local, opop->subitem_local_name, &private_ptr_item_local);
+            ptr_override, prop_override, opop->subitem_local_name, &private_ptr_item_override);
         if (opop->subitem_reference_name != NULL) {
-          RNA_property_collection_lookup_string(ptr_override,
-                                                prop_override,
-                                                opop->subitem_reference_name,
-                                                &private_ptr_item_override);
+          RNA_property_collection_lookup_string(
+              ptr_local, prop_local, opop->subitem_reference_name, &private_ptr_item_local);
         }
         else {
           RNA_property_collection_lookup_string(
-              ptr_override, prop_override, opop->subitem_local_name, &private_ptr_item_override);
+              ptr_local, prop_local, opop->subitem_local_name, &private_ptr_item_local);
         }
       }
       else if (opop->subitem_reference_name != NULL) {
-        RNA_property_collection_lookup_string(
-            ptr_local, prop_local, opop->subitem_reference_name, &private_ptr_item_local);
         RNA_property_collection_lookup_string(
             ptr_override, prop_override, opop->subitem_reference_name, &private_ptr_item_override);
+        RNA_property_collection_lookup_string(
+            ptr_local, prop_local, opop->subitem_reference_name, &private_ptr_item_local);
       }
       else if (opop->subitem_local_index != -1) {
         RNA_property_collection_lookup_int(
-            ptr_local, prop_local, opop->subitem_local_index, &private_ptr_item_local);
+            ptr_override, prop_override, opop->subitem_local_index, &private_ptr_item_override);
         if (opop->subitem_reference_index != -1) {
-          RNA_property_collection_lookup_int(ptr_override,
-                                             prop_override,
-                                             opop->subitem_reference_index,
-                                             &private_ptr_item_override);
+          RNA_property_collection_lookup_int(
+              ptr_local, prop_local, opop->subitem_reference_index, &private_ptr_item_local);
         }
         else {
           RNA_property_collection_lookup_int(
-              ptr_override, prop_override, opop->subitem_local_index, &private_ptr_item_override);
+              ptr_local, prop_local, opop->subitem_local_index, &private_ptr_item_local);
         }
       }
       else if (opop->subitem_reference_index != -1) {
-        RNA_property_collection_lookup_int(
-            ptr_local, prop_local, opop->subitem_reference_index, &private_ptr_item_local);
         RNA_property_collection_lookup_int(ptr_override,
                                            prop_override,
                                            opop->subitem_reference_index,
                                            &private_ptr_item_override);
+        RNA_property_collection_lookup_int(
+            ptr_local, prop_local, opop->subitem_reference_index, &private_ptr_item_local);
       }
       if (prop_storage != NULL) {
         if (opop->subitem_local_name != NULL) {