diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_rna.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 215 |
1 files changed, 108 insertions, 107 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 5dad1218307..8c3e1a724cf 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -613,7 +613,7 @@ static bool rna_Property_overridable_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return (prop->flag_override & PROPOVERRIDE_OVERRIDABLE_STATIC) != 0; + return (prop->flag_override & PROPOVERRIDE_OVERRIDABLE_LIBRARY) != 0; } static bool rna_Property_use_output_get(PointerRNA *ptr) @@ -1176,7 +1176,7 @@ static bool rna_property_override_diff_propptr_validate_diffing(PointerRNA *prop /* We do a generic quick first comparison checking for "name" and/or "type" properties. * We assume that is any of those are false, then we are not handling the same data. - * This helps a lot in static override case, especially to detect inserted items in collections. + * This helps a lot in library override case, especially to detect inserted items in collections. */ if (!no_prop_name && (is_valid_for_diffing || do_force_name)) { PropertyRNA *nameprop_a = RNA_struct_name_property(propptr_a->type); @@ -1239,7 +1239,7 @@ static int rna_property_override_diff_propptr(Main *bmain, eRNACompareMode mode, const bool no_ownership, const bool no_prop_name, - IDOverrideStatic *override, + IDOverrideLibrary *override, const char *rna_path, const int flags, bool *r_override_changed) @@ -1279,12 +1279,12 @@ static int rna_property_override_diff_propptr(Main *bmain, if (do_create && comp != 0) { bool created = false; - IDOverrideStaticProperty *op = BKE_override_static_property_get( + IDOverrideLibraryProperty *op = BKE_override_library_property_get( override, rna_path, &created); if (op != NULL && created) { /* If not yet overridden... */ - BKE_override_static_property_operation_get( - op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); + BKE_override_library_property_operation_get( + op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); if (r_override_changed) { *r_override_changed = created; } @@ -1325,7 +1325,7 @@ int rna_property_override_diff_default(Main *bmain, const int len_a, const int len_b, const int mode, - IDOverrideStatic *override, + IDOverrideLibrary *override, const char *rna_path, const int flags, bool *r_override_changed) @@ -1357,12 +1357,12 @@ int rna_property_override_diff_default(Main *bmain, if (do_create && comp != 0) { /* XXX TODO this will have to be refined to handle array items */ bool created = false; - IDOverrideStaticProperty *op = BKE_override_static_property_get( + IDOverrideLibraryProperty *op = BKE_override_library_property_get( override, rna_path, &created); if (op != NULL && created) { - BKE_override_static_property_operation_get( - op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); + BKE_override_library_property_operation_get( + op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); if (r_override_changed) { *r_override_changed = created; } @@ -1388,12 +1388,12 @@ int rna_property_override_diff_default(Main *bmain, if (do_create && comp != 0) { bool created = false; - IDOverrideStaticProperty *op = BKE_override_static_property_get( + IDOverrideLibraryProperty *op = BKE_override_library_property_get( override, rna_path, &created); if (op != NULL && created) { /* If not yet overridden... */ - BKE_override_static_property_operation_get( - op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); + BKE_override_library_property_operation_get( + op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); if (r_override_changed) { *r_override_changed = created; } @@ -1422,12 +1422,12 @@ int rna_property_override_diff_default(Main *bmain, if (do_create && comp != 0) { /* XXX TODO this will have to be refined to handle array items */ bool created = false; - IDOverrideStaticProperty *op = BKE_override_static_property_get( + IDOverrideLibraryProperty *op = BKE_override_library_property_get( override, rna_path, &created); if (op != NULL && created) { - BKE_override_static_property_operation_get( - op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); + BKE_override_library_property_operation_get( + op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); if (r_override_changed) { *r_override_changed = created; } @@ -1453,12 +1453,12 @@ int rna_property_override_diff_default(Main *bmain, if (do_create && comp != 0) { bool created = false; - IDOverrideStaticProperty *op = BKE_override_static_property_get( + IDOverrideLibraryProperty *op = BKE_override_library_property_get( override, rna_path, &created); if (op != NULL && created) { /* If not yet overridden... */ - BKE_override_static_property_operation_get( - op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); + BKE_override_library_property_operation_get( + op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); if (r_override_changed) { *r_override_changed = created; } @@ -1487,12 +1487,12 @@ int rna_property_override_diff_default(Main *bmain, if (do_create && comp != 0) { /* XXX TODO this will have to be refined to handle array items */ bool created = false; - IDOverrideStaticProperty *op = BKE_override_static_property_get( + IDOverrideLibraryProperty *op = BKE_override_library_property_get( override, rna_path, &created); if (op != NULL && created) { - BKE_override_static_property_operation_get( - op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); + BKE_override_library_property_operation_get( + op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); if (r_override_changed) { *r_override_changed = created; } @@ -1518,12 +1518,12 @@ int rna_property_override_diff_default(Main *bmain, if (do_create && comp != 0) { bool created = false; - IDOverrideStaticProperty *op = BKE_override_static_property_get( + IDOverrideLibraryProperty *op = BKE_override_library_property_get( override, rna_path, &created); if (op != NULL && created) { /* If not yet overridden... */ - BKE_override_static_property_operation_get( - op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); + BKE_override_library_property_operation_get( + op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); if (r_override_changed) { *r_override_changed = created; } @@ -1541,12 +1541,12 @@ int rna_property_override_diff_default(Main *bmain, if (do_create && comp != 0) { bool created = false; - IDOverrideStaticProperty *op = BKE_override_static_property_get( + IDOverrideLibraryProperty *op = BKE_override_library_property_get( override, rna_path, &created); if (op != NULL && created) { /* If not yet overridden... */ - BKE_override_static_property_operation_get( - op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); + BKE_override_library_property_operation_get( + op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); if (r_override_changed) { *r_override_changed = created; } @@ -1575,12 +1575,12 @@ int rna_property_override_diff_default(Main *bmain, if (do_create && comp != 0) { bool created = false; - IDOverrideStaticProperty *op = BKE_override_static_property_get( + IDOverrideLibraryProperty *op = BKE_override_library_property_get( override, rna_path, &created); if (op != NULL && created) { /* If not yet overridden... */ - BKE_override_static_property_operation_get( - op, IDOVERRIDESTATIC_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); + BKE_override_library_property_operation_get( + op, IDOVERRIDE_LIBRARY_OP_REPLACE, NULL, NULL, -1, -1, true, NULL, NULL); if (r_override_changed) { *r_override_changed = created; } @@ -1626,7 +1626,7 @@ int rna_property_override_diff_default(Main *bmain, /* Note: we assume we only insert in ptr_a (i.e. we can only get new items in ptr_a), * and that we never remove anything. */ const bool use_insertion = (RNA_property_override_flag(prop_a) & - PROPOVERRIDE_STATIC_INSERTION) && + PROPOVERRIDE_LIBRARY_INSERTION) && do_create; const bool no_prop_name = (RNA_property_override_flag(prop_a) & PROPOVERRIDE_NO_PROP_NAME) != 0; @@ -1724,7 +1724,7 @@ int rna_property_override_diff_default(Main *bmain, is_id, is_valid_for_diffing, is_valid_for_insertion, - (RNA_property_override_flag(prop_a) & PROPOVERRIDE_STATIC_INSERTION) != 0, + (RNA_property_override_flag(prop_a) & PROPOVERRIDE_LIBRARY_INSERTION) != 0, do_create); } # endif @@ -1767,33 +1767,34 @@ int rna_property_override_diff_default(Main *bmain, * We also assume then that _a data is the one where things are inserted. */ if (is_valid_for_insertion && use_insertion) { bool created; - IDOverrideStaticProperty *op = BKE_override_static_property_get( + IDOverrideLibraryProperty *op = BKE_override_library_property_get( override, rna_path, &created); if (is_first_insert) { /* We need to clean up all possible existing insertion operations, * otherwise we'd end up with a mess of ops everytime something changes. */ - for (IDOverrideStaticPropertyOperation *opop = op->operations.first; opop != NULL;) { - IDOverrideStaticPropertyOperation *opop_next = opop->next; + for (IDOverrideLibraryPropertyOperation *opop = op->operations.first; + opop != NULL;) { + IDOverrideLibraryPropertyOperation *opop_next = opop->next; if (ELEM(opop->operation, - IDOVERRIDESTATIC_OP_INSERT_AFTER, - IDOVERRIDESTATIC_OP_INSERT_BEFORE)) { - BKE_override_static_property_operation_delete(op, opop); + IDOVERRIDE_LIBRARY_OP_INSERT_AFTER, + IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE)) { + BKE_override_library_property_operation_delete(op, opop); } opop = opop_next; } is_first_insert = false; } - BKE_override_static_property_operation_get(op, - IDOVERRIDESTATIC_OP_INSERT_AFTER, - NULL, - prev_propname_a, - -1, - idx_a - 1, - true, - NULL, - NULL); + BKE_override_library_property_operation_get(op, + IDOVERRIDE_LIBRARY_OP_INSERT_AFTER, + NULL, + prev_propname_a, + -1, + idx_a - 1, + true, + NULL, + NULL); # if 0 printf("%s: Adding insertion op override after '%s'/%d\n", rna_path, @@ -1894,7 +1895,7 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), const int len_local, const int len_reference, const int len_storage, - IDOverrideStaticPropertyOperation *opop) + IDOverrideLibraryPropertyOperation *opop) { BLI_assert(len_local == len_reference && (!ptr_storage || len_local == len_storage)); UNUSED_VARS_NDEBUG(len_reference, len_storage); @@ -1904,9 +1905,9 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), const int index = is_array ? opop->subitem_reference_index : 0; if (!ELEM(opop->operation, - IDOVERRIDESTATIC_OP_ADD, - IDOVERRIDESTATIC_OP_SUBTRACT, - IDOVERRIDESTATIC_OP_MULTIPLY)) { + IDOVERRIDE_LIBRARY_OP_ADD, + IDOVERRIDE_LIBRARY_OP_SUBTRACT, + IDOVERRIDE_LIBRARY_OP_MULTIPLY)) { return changed; } @@ -1936,12 +1937,12 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), RNA_property_int_get_array(ptr_reference, prop_reference, array_a); switch (opop->operation) { - case IDOVERRIDESTATIC_OP_ADD: - case IDOVERRIDESTATIC_OP_SUBTRACT: { - const int fac = opop->operation == IDOVERRIDESTATIC_OP_ADD ? 1 : -1; - const int other_op = opop->operation == IDOVERRIDESTATIC_OP_ADD ? - IDOVERRIDESTATIC_OP_SUBTRACT : - IDOVERRIDESTATIC_OP_ADD; + case IDOVERRIDE_LIBRARY_OP_ADD: + case IDOVERRIDE_LIBRARY_OP_SUBTRACT: { + const int fac = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? 1 : -1; + const int other_op = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? + IDOVERRIDE_LIBRARY_OP_SUBTRACT : + IDOVERRIDE_LIBRARY_OP_ADD; bool do_set = true; array_b = (len_local > RNA_STACK_ARRAY) ? MEM_mallocN(sizeof(*array_b) * len_local, __func__) : @@ -1956,7 +1957,7 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), if (array_b[j] < prop_min || array_b[j] > prop_max) { /* We failed to find a suitable diff op, * fall back to plain REPLACE one. */ - opop->operation = IDOVERRIDESTATIC_OP_REPLACE; + opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE; do_set = false; break; } @@ -1986,18 +1987,18 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), const int value = RNA_PROPERTY_GET_SINGLE(int, ptr_reference, prop_reference, index); switch (opop->operation) { - case IDOVERRIDESTATIC_OP_ADD: - case IDOVERRIDESTATIC_OP_SUBTRACT: { - const int fac = opop->operation == IDOVERRIDESTATIC_OP_ADD ? 1 : -1; - const int other_op = opop->operation == IDOVERRIDESTATIC_OP_ADD ? - IDOVERRIDESTATIC_OP_SUBTRACT : - IDOVERRIDESTATIC_OP_ADD; + case IDOVERRIDE_LIBRARY_OP_ADD: + case IDOVERRIDE_LIBRARY_OP_SUBTRACT: { + const int fac = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? 1 : -1; + const int other_op = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? + IDOVERRIDE_LIBRARY_OP_SUBTRACT : + IDOVERRIDE_LIBRARY_OP_ADD; int b = fac * (RNA_PROPERTY_GET_SINGLE(int, ptr_local, prop_local, index) - value); if (b < prop_min || b > prop_max) { opop->operation = other_op; b = -b; if (b < prop_min || b > prop_max) { - opop->operation = IDOVERRIDESTATIC_OP_REPLACE; + opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE; break; } } @@ -2026,12 +2027,12 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), RNA_property_float_get_array(ptr_reference, prop_reference, array_a); switch (opop->operation) { - case IDOVERRIDESTATIC_OP_ADD: - case IDOVERRIDESTATIC_OP_SUBTRACT: { - const float fac = opop->operation == IDOVERRIDESTATIC_OP_ADD ? 1.0 : -1.0; - const int other_op = opop->operation == IDOVERRIDESTATIC_OP_ADD ? - IDOVERRIDESTATIC_OP_SUBTRACT : - IDOVERRIDESTATIC_OP_ADD; + case IDOVERRIDE_LIBRARY_OP_ADD: + case IDOVERRIDE_LIBRARY_OP_SUBTRACT: { + const float fac = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? 1.0 : -1.0; + const int other_op = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? + IDOVERRIDE_LIBRARY_OP_SUBTRACT : + IDOVERRIDE_LIBRARY_OP_ADD; bool do_set = true; array_b = (len_local > RNA_STACK_ARRAY) ? MEM_mallocN(sizeof(*array_b) * len_local, __func__) : @@ -2046,7 +2047,7 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), if (array_b[j] < prop_min || array_b[j] > prop_max) { /* We failed to find a suitable diff op, * fall back to plain REPLACE one. */ - opop->operation = IDOVERRIDESTATIC_OP_REPLACE; + opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE; do_set = false; break; } @@ -2063,7 +2064,7 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), } break; } - case IDOVERRIDESTATIC_OP_MULTIPLY: { + case IDOVERRIDE_LIBRARY_OP_MULTIPLY: { bool do_set = true; array_b = (len_local > RNA_STACK_ARRAY) ? MEM_mallocN(sizeof(*array_b) * len_local, __func__) : @@ -2072,7 +2073,7 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), for (int i = len_local; i--;) { array_b[i] = array_a[i] == 0.0f ? array_b[i] : array_b[i] / array_a[i]; if (array_b[i] < prop_min || array_b[i] > prop_max) { - opop->operation = IDOVERRIDESTATIC_OP_REPLACE; + opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE; do_set = false; break; } @@ -2099,18 +2100,18 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), const float value = RNA_PROPERTY_GET_SINGLE(float, ptr_reference, prop_reference, index); switch (opop->operation) { - case IDOVERRIDESTATIC_OP_ADD: - case IDOVERRIDESTATIC_OP_SUBTRACT: { - const float fac = opop->operation == IDOVERRIDESTATIC_OP_ADD ? 1.0f : -1.0f; - const int other_op = opop->operation == IDOVERRIDESTATIC_OP_ADD ? - IDOVERRIDESTATIC_OP_SUBTRACT : - IDOVERRIDESTATIC_OP_ADD; + case IDOVERRIDE_LIBRARY_OP_ADD: + case IDOVERRIDE_LIBRARY_OP_SUBTRACT: { + const float fac = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? 1.0f : -1.0f; + const int other_op = opop->operation == IDOVERRIDE_LIBRARY_OP_ADD ? + IDOVERRIDE_LIBRARY_OP_SUBTRACT : + IDOVERRIDE_LIBRARY_OP_ADD; float b = fac * (RNA_PROPERTY_GET_SINGLE(float, ptr_local, prop_local, index) - value); if (b < prop_min || b > prop_max) { opop->operation = other_op; b = -b; if (b < prop_min || b > prop_max) { - opop->operation = IDOVERRIDESTATIC_OP_REPLACE; + opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE; break; } } @@ -2118,11 +2119,11 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), RNA_PROPERTY_SET_SINGLE(float, ptr_storage, prop_storage, index, b); break; } - case IDOVERRIDESTATIC_OP_MULTIPLY: { + case IDOVERRIDE_LIBRARY_OP_MULTIPLY: { const float b = RNA_property_float_get_index(ptr_local, prop_local, index) / (value == 0.0f ? 1.0f : value); if (b < prop_min || b > prop_max) { - opop->operation = IDOVERRIDESTATIC_OP_REPLACE; + opop->operation = IDOVERRIDE_LIBRARY_OP_REPLACE; break; } changed = true; @@ -2170,7 +2171,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), PointerRNA *UNUSED(ptr_item_dst), PointerRNA *UNUSED(ptr_item_src), PointerRNA *UNUSED(ptr_item_storage), - IDOverrideStaticPropertyOperation *opop) + IDOverrideLibraryPropertyOperation *opop) { BLI_assert(len_dst == len_src && (!ptr_storage || len_dst == len_storage)); UNUSED_VARS_NDEBUG(len_src, len_storage); @@ -2191,7 +2192,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), RNA_property_boolean_get_array(ptr_src, prop_src, array_a); switch (override_op) { - case IDOVERRIDESTATIC_OP_REPLACE: + case IDOVERRIDE_LIBRARY_OP_REPLACE: RNA_property_boolean_set_array(ptr_dst, prop_dst, array_a); break; default: @@ -2207,7 +2208,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), const bool value = RNA_PROPERTY_GET_SINGLE(boolean, ptr_src, prop_src, index); switch (override_op) { - case IDOVERRIDESTATIC_OP_REPLACE: + case IDOVERRIDE_LIBRARY_OP_REPLACE: RNA_PROPERTY_SET_SINGLE(boolean, ptr_dst, prop_dst, index, value); break; default: @@ -2225,18 +2226,18 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), array_stack_a; switch (override_op) { - case IDOVERRIDESTATIC_OP_REPLACE: + case IDOVERRIDE_LIBRARY_OP_REPLACE: RNA_property_int_get_array(ptr_src, prop_src, array_a); RNA_property_int_set_array(ptr_dst, prop_dst, array_a); break; - case IDOVERRIDESTATIC_OP_ADD: - case IDOVERRIDESTATIC_OP_SUBTRACT: + case IDOVERRIDE_LIBRARY_OP_ADD: + case IDOVERRIDE_LIBRARY_OP_SUBTRACT: RNA_property_int_get_array(ptr_dst, prop_dst, array_a); array_b = (len_dst > RNA_STACK_ARRAY) ? MEM_mallocN(sizeof(*array_b) * len_dst, __func__) : array_stack_b; RNA_property_int_get_array(ptr_storage, prop_storage, array_b); - if (override_op == IDOVERRIDESTATIC_OP_ADD) { + if (override_op == IDOVERRIDE_LIBRARY_OP_ADD) { for (int i = len_dst; i--;) { array_a[i] += array_b[i]; } @@ -2266,14 +2267,14 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), 0; switch (override_op) { - case IDOVERRIDESTATIC_OP_REPLACE: + case IDOVERRIDE_LIBRARY_OP_REPLACE: RNA_PROPERTY_SET_SINGLE(int, ptr_dst, prop_dst, index, RNA_PROPERTY_GET_SINGLE(int, ptr_src, prop_src, index)); break; - case IDOVERRIDESTATIC_OP_ADD: + case IDOVERRIDE_LIBRARY_OP_ADD: RNA_PROPERTY_SET_SINGLE(int, ptr_dst, prop_dst, @@ -2281,7 +2282,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), RNA_PROPERTY_GET_SINGLE(int, ptr_dst, prop_dst, index) - storage_value); break; - case IDOVERRIDESTATIC_OP_SUBTRACT: + case IDOVERRIDE_LIBRARY_OP_SUBTRACT: RNA_PROPERTY_SET_SINGLE(int, ptr_dst, prop_dst, @@ -2304,24 +2305,24 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), array_stack_a; switch (override_op) { - case IDOVERRIDESTATIC_OP_REPLACE: + case IDOVERRIDE_LIBRARY_OP_REPLACE: RNA_property_float_get_array(ptr_src, prop_src, array_a); RNA_property_float_set_array(ptr_dst, prop_dst, array_a); break; - case IDOVERRIDESTATIC_OP_ADD: - case IDOVERRIDESTATIC_OP_SUBTRACT: - case IDOVERRIDESTATIC_OP_MULTIPLY: + case IDOVERRIDE_LIBRARY_OP_ADD: + case IDOVERRIDE_LIBRARY_OP_SUBTRACT: + case IDOVERRIDE_LIBRARY_OP_MULTIPLY: RNA_property_float_get_array(ptr_dst, prop_dst, array_a); array_b = (len_dst > RNA_STACK_ARRAY) ? MEM_mallocN(sizeof(*array_b) * len_dst, __func__) : array_stack_b; RNA_property_float_get_array(ptr_storage, prop_storage, array_b); - if (override_op == IDOVERRIDESTATIC_OP_ADD) { + if (override_op == IDOVERRIDE_LIBRARY_OP_ADD) { for (int i = len_dst; i--;) { array_a[i] += array_b[i]; } } - else if (override_op == IDOVERRIDESTATIC_OP_SUBTRACT) { + else if (override_op == IDOVERRIDE_LIBRARY_OP_SUBTRACT) { for (int i = len_dst; i--;) { array_a[i] -= array_b[i]; } @@ -2351,14 +2352,14 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), 0.0f; switch (override_op) { - case IDOVERRIDESTATIC_OP_REPLACE: + case IDOVERRIDE_LIBRARY_OP_REPLACE: RNA_PROPERTY_SET_SINGLE(float, ptr_dst, prop_dst, index, RNA_PROPERTY_GET_SINGLE(float, ptr_src, prop_src, index)); break; - case IDOVERRIDESTATIC_OP_ADD: + case IDOVERRIDE_LIBRARY_OP_ADD: RNA_PROPERTY_SET_SINGLE(float, ptr_dst, prop_dst, @@ -2366,7 +2367,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), RNA_PROPERTY_GET_SINGLE(float, ptr_dst, prop_dst, index) + storage_value); break; - case IDOVERRIDESTATIC_OP_SUBTRACT: + case IDOVERRIDE_LIBRARY_OP_SUBTRACT: RNA_PROPERTY_SET_SINGLE(float, ptr_dst, prop_dst, @@ -2374,7 +2375,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), RNA_PROPERTY_GET_SINGLE(float, ptr_dst, prop_dst, index) - storage_value); break; - case IDOVERRIDESTATIC_OP_MULTIPLY: + case IDOVERRIDE_LIBRARY_OP_MULTIPLY: RNA_PROPERTY_SET_SINGLE(float, ptr_dst, prop_dst, @@ -2392,7 +2393,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), const int value = RNA_property_enum_get(ptr_src, prop_src); switch (override_op) { - case IDOVERRIDESTATIC_OP_REPLACE: + case IDOVERRIDE_LIBRARY_OP_REPLACE: RNA_property_enum_set(ptr_dst, prop_dst, value); break; /* TODO support add/sub, for bitflags? */ @@ -2406,7 +2407,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), PointerRNA value = RNA_property_pointer_get(ptr_src, prop_src); switch (override_op) { - case IDOVERRIDESTATIC_OP_REPLACE: + case IDOVERRIDE_LIBRARY_OP_REPLACE: RNA_property_pointer_set(ptr_dst, prop_dst, value, NULL); break; default: @@ -2420,7 +2421,7 @@ bool rna_property_override_apply_default(Main *UNUSED(bmain), char *value = RNA_property_string_get_alloc(ptr_src, prop_src, buff, sizeof(buff), NULL); switch (override_op) { - case IDOVERRIDESTATIC_OP_REPLACE: + case IDOVERRIDE_LIBRARY_OP_REPLACE: RNA_property_string_set(ptr_dst, prop_dst, value); break; default: |