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/makesrna/intern/rna_group.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/makesrna/intern/rna_group.c')
-rw-r--r--source/blender/makesrna/intern/rna_group.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c
index ff3900705e4..b3afba36a9f 100644
--- a/source/blender/makesrna/intern/rna_group.c
+++ b/source/blender/makesrna/intern/rna_group.c
@@ -109,6 +109,7 @@ static void rna_Collection_objects_unlink(Collection *collection, Main *bmain, R
}
static bool rna_Collection_objects_override_apply(
+ Main *bmain,
PointerRNA *ptr_dst, PointerRNA *UNUSED(ptr_src), PointerRNA *UNUSED(ptr_storage),
PropertyRNA *UNUSED(prop_dst), PropertyRNA *UNUSED(prop_src), PropertyRNA *UNUSED(prop_storage),
const int UNUSED(len_dst), const int UNUSED(len_src), const int UNUSED(len_storage),
@@ -142,7 +143,7 @@ static bool rna_Collection_objects_override_apply(
id_us_plus(&cob_dst->ob->id);
if (BKE_collection_is_in_scene(coll_dst)) {
- BKE_main_collection_sync(G.main); /* YUCK!!!!!!!!!!!!! */
+ BKE_main_collection_sync(bmain);
}
return true;
@@ -191,6 +192,7 @@ static void rna_Collection_children_unlink(Collection *collection, Main *bmain,
}
static bool rna_Collection_children_override_apply(
+ Main *bmain,
PointerRNA *ptr_dst, PointerRNA *UNUSED(ptr_src), PointerRNA *UNUSED(ptr_storage),
PropertyRNA *UNUSED(prop_dst), PropertyRNA *UNUSED(prop_src), PropertyRNA *UNUSED(prop_storage),
const int UNUSED(len_dst), const int UNUSED(len_src), const int UNUSED(len_storage),
@@ -224,7 +226,7 @@ static bool rna_Collection_children_override_apply(
id_us_plus(&collchild_dst->collection->id);
BKE_collection_object_cache_free(coll_dst);
- BKE_main_collection_sync(G.main); /* YUCK!!!!!!!!!!!!! */
+ BKE_main_collection_sync(bmain);
return true;
}