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>2022-04-01 13:21:00 +0300
committerBastien Montagne <bastien@blender.org>2022-04-01 13:35:25 +0300
commit1264142f78302dcecd229b3dd72544470e553964 (patch)
tree418b7bbf1f83c17b64eb524a7cef8ea6159de894 /source/blender/makesrna/intern/rna_object.c
parentd34c4089f18f4ec6c6f8f79b95146195d065ec1e (diff)
LibOverride: RNA Apply: let apply function responsible for calling update or not on overridden properties.
While this is the desired behavior in almost cases, there are a few hairy nightmares that may require not to do so. NOTE: this change should should not modify any current behavior at all.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r--source/blender/makesrna/intern/rna_object.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 0b39c8e27c7..3334022e202 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -646,7 +646,7 @@ static void rna_Object_parent_set(PointerRNA *ptr,
}
}
-static bool rna_Object_parent_override_apply(Main *UNUSED(bmain),
+static bool rna_Object_parent_override_apply(Main *bmain,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
PointerRNA *ptr_storage,
@@ -683,6 +683,7 @@ static bool rna_Object_parent_override_apply(Main *UNUSED(bmain),
else {
ob->parent = parent_src;
}
+ RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
return true;
}
@@ -1667,11 +1668,11 @@ static bConstraint *rna_Object_constraints_copy(Object *object, Main *bmain, Poi
return new_con;
}
-bool rna_Object_constraints_override_apply(Main *UNUSED(bmain),
+bool rna_Object_constraints_override_apply(Main *bmain,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
PointerRNA *UNUSED(ptr_storage),
- PropertyRNA *UNUSED(prop_dst),
+ PropertyRNA *prop_dst,
PropertyRNA *UNUSED(prop_src),
PropertyRNA *UNUSED(prop_storage),
const int UNUSED(len_dst),
@@ -1716,6 +1717,7 @@ bool rna_Object_constraints_override_apply(Main *UNUSED(bmain),
BKE_constraint_unique_name(con_dst, &ob_dst->constraints);
// printf("%s: We inserted a constraint...\n", __func__);
+ RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
return true;
}
@@ -1786,7 +1788,7 @@ bool rna_Object_modifiers_override_apply(Main *bmain,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
PointerRNA *UNUSED(ptr_storage),
- PropertyRNA *UNUSED(prop_dst),
+ PropertyRNA *prop_dst,
PropertyRNA *UNUSED(prop_src),
PropertyRNA *UNUSED(prop_storage),
const int UNUSED(len_dst),
@@ -1847,6 +1849,7 @@ bool rna_Object_modifiers_override_apply(Main *bmain,
BLI_insertlinkafter(&ob_dst->modifiers, mod_anchor, mod_dst);
// printf("%s: We inserted a modifier '%s'...\n", __func__, mod_dst->name);
+ RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
return true;
}
@@ -1883,7 +1886,7 @@ bool rna_Object_greasepencil_modifiers_override_apply(Main *bmain,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
PointerRNA *UNUSED(ptr_storage),
- PropertyRNA *UNUSED(prop_dst),
+ PropertyRNA *prop_dst,
PropertyRNA *UNUSED(prop_src),
PropertyRNA *UNUSED(prop_storage),
const int UNUSED(len_dst),
@@ -1932,6 +1935,7 @@ bool rna_Object_greasepencil_modifiers_override_apply(Main *bmain,
BLI_insertlinkafter(&ob_dst->greasepencil_modifiers, mod_anchor, mod_dst);
// printf("%s: We inserted a gpencil modifier '%s'...\n", __func__, mod_dst->name);
+ RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
return true;
}