Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_access_compare_override.c
| Show All 21 Lines | |||||
| #include "DNA_ID.h" | #include "DNA_ID.h" | ||||
| #include "DNA_constraint_types.h" | #include "DNA_constraint_types.h" | ||||
| #include "DNA_modifier_types.h" | #include "DNA_modifier_types.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #define DEBUG_OVERRIDE_TIMEIT | |||||
| #ifdef DEBUG_OVERRIDE_TIMEIT | #ifdef DEBUG_OVERRIDE_TIMEIT | ||||
| # include "PIL_time_utildefines.h" | # include "PIL_time_utildefines.h" | ||||
| #endif | #endif | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_library_override.h" | #include "BKE_library_override.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| ▲ Show 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | bool RNA_struct_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, eRNACompareMode mode) | ||||
| } | } | ||||
| RNA_property_collection_end(&iter); | RNA_property_collection_end(&iter); | ||||
| return equals; | return equals; | ||||
| } | } | ||||
| /* Low-level functions, also used by non-override RNA API like copy or equality check. */ | /* Low-level functions, also used by non-override RNA API like copy or equality check. */ | ||||
| /** Generic RNA property diff function. | /** | ||||
| * Generic RNA property diff function. | |||||
| * | * | ||||
| * \note about \a prop and \a prop_a/prop_b parameters: | * \note about \a prop and \a prop_a/prop_b parameters: | ||||
| * the former is expected to be an 'un-resolved' one, | * the former is expected to be an 'un-resolved' one, | ||||
| * while the two later are expected to be fully resolved ones | * while the two later are expected to be fully resolved ones | ||||
| * (i.e. to be the IDProps when they should be, etc.). | * (i.e. to be the IDProps when they should be, etc.). | ||||
| * When \a prop is given, \a prop_a and \a prop_b should always be NULL, and vice-versa. | * When \a prop is given, \a prop_a and \a prop_b should always be NULL, and vice-versa. | ||||
| * This is necessary, because we cannot perform 'set/unset' checks on resolved properties | * This is necessary, because we cannot perform 'set/unset' checks on resolved properties | ||||
| * (unset IDProps would merely be NULL then). | * (unset IDProps would merely be NULL then). | ||||
| ▲ Show 20 Lines • Show All 572 Lines • ▼ Show 20 Lines | printf("diffing time averaged (%s): %.6f (total: %.6f, in %d runs)\n", | ||||
| _sum_time_diffing, | _sum_time_diffing, | ||||
| (int)_num_time_diffing); | (int)_num_time_diffing); | ||||
| } | } | ||||
| #endif | #endif | ||||
| return matching; | return matching; | ||||
| } | } | ||||
| /** Store needed second operands into \a storage data-block | /** | ||||
| * for differential override operations. */ | * Store needed second operands into \a storage data-block | ||||
| * for differential override operations. | |||||
| */ | |||||
| bool RNA_struct_override_store(Main *bmain, | bool RNA_struct_override_store(Main *bmain, | ||||
| PointerRNA *ptr_local, | PointerRNA *ptr_local, | ||||
| PointerRNA *ptr_reference, | PointerRNA *ptr_reference, | ||||
| PointerRNA *ptr_storage, | PointerRNA *ptr_storage, | ||||
| IDOverrideLibrary *override) | IDOverrideLibrary *override) | ||||
| { | { | ||||
| bool changed = false; | bool changed = false; | ||||
| ▲ Show 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | if (!rna_property_override_operation_apply(bmain, | ||||
| opop)) { | opop)) { | ||||
| /* TODO No assert here, would be much much better to just report as warning, | /* TODO No assert here, would be much much better to just report as warning, | ||||
| * failing override applications will probably be fairly common! */ | * failing override applications will probably be fairly common! */ | ||||
| BLI_assert(0); | BLI_assert(0); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /** Apply given \a override operations on \a ptr_dst, using \a ptr_src | /** | ||||
| * (and \a ptr_storage for differential ops) as source. */ | * Apply given \a override operations on \a ptr_dst, using \a ptr_src | ||||
| * (and \a ptr_storage for differential ops) as source. | |||||
| */ | |||||
| void RNA_struct_override_apply(Main *bmain, | void RNA_struct_override_apply(Main *bmain, | ||||
| PointerRNA *ptr_dst, | PointerRNA *ptr_dst, | ||||
| PointerRNA *ptr_src, | PointerRNA *ptr_src, | ||||
| PointerRNA *ptr_storage, | PointerRNA *ptr_storage, | ||||
| IDOverrideLibrary *override) | IDOverrideLibrary *override) | ||||
| { | { | ||||
| #ifdef DEBUG_OVERRIDE_TIMEIT | #ifdef DEBUG_OVERRIDE_TIMEIT | ||||
| TIMEIT_START_AVERAGED(RNA_struct_override_apply); | TIMEIT_START_AVERAGED(RNA_struct_override_apply); | ||||
| ▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines | |||||