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 <montagne29@wanadoo.fr>2018-06-29 13:46:54 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-29 13:48:12 +0300
commit2223d63c58c9a2125fb4a2e6ee1c780c781a95bb (patch)
tree42b820b7ffd2ebe4f71a51d6e05b73c1cc13fdd7 /source/blender/editors/interface/interface_ops.c
parent3733be8731df978ec50cd283ff24b813bdd89df1 (diff)
Refactor static override code to pass Main around.
Access to main database is actually rarely needed, but some custom 'apply' functions do need it (like Collections' overriding of objects or children collections).
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r--source/blender/editors/interface/interface_ops.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index aad48d13277..571c1327f78 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -464,6 +464,7 @@ static int override_remove_button_poll(bContext *C)
static int override_remove_button_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
PointerRNA ptr, id_refptr, src;
PropertyRNA *prop;
int index;
@@ -505,7 +506,7 @@ static int override_remove_button_exec(bContext *C, wmOperator *op)
}
BKE_override_static_property_operation_delete(oprop, opop);
if (!is_template) {
- RNA_property_copy(&ptr, &src, prop, index);
+ RNA_property_copy(bmain, &ptr, &src, prop, index);
}
if (BLI_listbase_is_empty(&oprop->operations)) {
BKE_override_static_property_delete(id->override_static, oprop);
@@ -515,7 +516,7 @@ static int override_remove_button_exec(bContext *C, wmOperator *op)
/* Just remove whole generic override operation of this property. */
BKE_override_static_property_delete(id->override_static, oprop);
if (!is_template) {
- RNA_property_copy(&ptr, &src, prop, -1);
+ RNA_property_copy(bmain, &ptr, &src, prop, -1);
}
}
@@ -699,6 +700,7 @@ bool UI_context_copy_to_selected_list(
*/
static bool copy_to_selected_button(bContext *C, bool all, bool poll)
{
+ Main *bmain = CTX_data_main(C);
PointerRNA ptr, lptr, idptr;
PropertyRNA *prop, *lprop;
bool success = false;
@@ -747,7 +749,7 @@ static bool copy_to_selected_button(bContext *C, bool all, bool poll)
break;
}
else {
- if (RNA_property_copy(&lptr, &ptr, prop, (all) ? -1 : index)) {
+ if (RNA_property_copy(bmain, &lptr, &ptr, prop, (all) ? -1 : index)) {
RNA_property_update(C, &lptr, prop);
success = true;
}