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:
authorBastien Montagne <bastien@blender.org>2020-04-15 18:26:34 +0300
committerBastien Montagne <bastien@blender.org>2020-04-16 17:21:11 +0300
commit0438944b343ed11abad47964f4dccb4e171da179 (patch)
tree0b7eeab5d28b4d7ddc7f6bd90873cc23edf1cdc5 /source/blender/makesrna/intern/rna_access_compare_override.c
parente3d575b37651b20b281f431047d97b43c0ce028d (diff)
Refactor/strengthen a bit invalid operands checks when applying an override operation.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access_compare_override.c')
-rw-r--r--source/blender/makesrna/intern/rna_access_compare_override.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c
index 199d22ee3dc..32b375fda97 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -481,28 +481,13 @@ static bool rna_property_override_operation_apply(Main *bmain,
const short override_op = opop->operation;
- if (override_op == IDOVERRIDE_LIBRARY_OP_NOOP) {
- return true;
- }
-
- if (ELEM(override_op,
- IDOVERRIDE_LIBRARY_OP_ADD,
- IDOVERRIDE_LIBRARY_OP_SUBTRACT,
- IDOVERRIDE_LIBRARY_OP_MULTIPLY) &&
- !ptr_storage) {
- /* We cannot apply 'diff' override operations without some reference storage.
- * This should typically only happen at read time of .blend file... */
+ if (!BKE_lib_override_library_property_operation_operands_validate(
+ opop, ptr_dst, ptr_src, ptr_storage, prop_dst, prop_src, prop_storage)) {
return false;
}
- if (ELEM(override_op,
- IDOVERRIDE_LIBRARY_OP_ADD,
- IDOVERRIDE_LIBRARY_OP_SUBTRACT,
- IDOVERRIDE_LIBRARY_OP_MULTIPLY) &&
- !prop_storage) {
- /* We cannot apply 'diff' override operations without some reference storage.
- * This should typically only happen at read time of .blend file... */
- return false;
+ if (override_op == IDOVERRIDE_LIBRARY_OP_NOOP) {
+ return true;
}
RNAPropOverrideApply override_apply = NULL;