[Bf-blender-cvs] [59bb5d3a89d] blender2.8: Cleanup: some remaining G.main's in COllada in 2.8...

Bastien Montagne noreply at git.blender.org
Thu Jun 14 16:43:40 CEST 2018


Commit: 59bb5d3a89d4379ccc74138aa0d4cd4ce2d8a093
Author: Bastien Montagne
Date:   Thu Jun 14 16:43:11 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB59bb5d3a89d4379ccc74138aa0d4cd4ce2d8a093

Cleanup: some remaining G.main's in COllada in 2.8...

===================================================================

M	source/blender/collada/DocumentImporter.cpp
M	source/blender/collada/collada_utils.cpp

===================================================================

diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 7aeed15ee87..c6ba3b8f4ac 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -412,7 +412,7 @@ Object *DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod
 	Main *bmain = CTX_data_main(mContext);
 	Object *obn = BKE_object_copy(bmain, source_ob);
 	DEG_id_tag_update(&obn->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
-	BKE_collection_object_add_from(G.main, sce, source_ob, obn);
+	BKE_collection_object_add_from(bmain, sce, source_ob, obn);
 
 	if (instance_node) {
 		anim_importer.read_node_transform(instance_node, obn);
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index 61a97a45a6e..4ded9bd2d86 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -157,7 +157,7 @@ Object *bc_add_object(Main *bmain, Scene *scene, ViewLayer *view_layer, int type
 	DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
 
 	LayerCollection *layer_collection = BKE_layer_collection_get_active(view_layer);
-	BKE_collection_object_add(G.main, layer_collection->collection, ob);
+	BKE_collection_object_add(bmain, layer_collection->collection, ob);
 
 	Base *base = BKE_view_layer_base_find(view_layer, ob);
 	BKE_view_layer_base_select(view_layer, base);



More information about the Bf-blender-cvs mailing list