diff options
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 4 | ||||
-rw-r--r-- | source/blender/collada/SceneExporter.cpp | 12 | ||||
-rw-r--r-- | source/blender/collada/collada_utils.cpp | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index d50c4bb23c4..89015f45e5a 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -266,7 +266,7 @@ void DocumentImporter::finish() std::vector<Object *>::iterator it; for (it = libnode_ob.begin(); it != libnode_ob.end(); it++) { Object *ob = *it; - BKE_collections_object_remove(G.main, &sce->id, ob, true); + BKE_scene_collections_object_remove(G.main, sce, ob, true); } libnode_ob.clear(); @@ -409,7 +409,7 @@ Object *DocumentImporter::create_instance_node(Object *source_ob, COLLADAFW::Nod Object *obn = BKE_object_copy(G.main, source_ob); DEG_id_tag_update(&obn->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); - BKE_collection_object_add_from(sce, source_ob, obn); + BKE_collection_object_add_from(G.main, sce, source_ob, obn); if (instance_node) { anim_importer.read_node_transform(instance_node, obn); diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp index a1d542daa14..5d1df800746 100644 --- a/source/blender/collada/SceneExporter.cpp +++ b/source/blender/collada/SceneExporter.cpp @@ -26,7 +26,7 @@ extern "C" { #include "BLI_utildefines.h" - #include "BKE_group.h" + #include "BKE_collection.h" #include "BKE_object.h" #include "BLI_listbase.h" } @@ -171,15 +171,15 @@ void SceneExporter::writeNodes(Depsgraph *depsgraph, Object *ob, Scene *sce) } // empty object - else if (ob->type == OB_EMPTY) { // TODO: handle groups (OB_DUPLIGROUP - if ((ob->transflag & OB_DUPLIGROUP) == OB_DUPLIGROUP && ob->dup_group) { - Group *group = ob->dup_group; + else if (ob->type == OB_EMPTY) { // TODO: handle groups (OB_DUPLICOLLECTION + if ((ob->transflag & OB_DUPLICOLLECTION) == OB_DUPLICOLLECTION && ob->dup_group) { + Collection *collection = ob->dup_group; /* printf("group detected '%s'\n", group->id.name + 2); */ - FOREACH_GROUP_OBJECT_BEGIN(group, object) + FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(collection, object) { printf("\t%s\n", object->id.name); } - FOREACH_GROUP_OBJECT_END; + FOREACH_COLLECTION_OBJECT_RECURSIVE_END; } } diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index 778ead55c8d..b8fde34cc96 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -163,8 +163,8 @@ Object *bc_add_object(Scene *scene, ViewLayer *view_layer, int type, const char ob->lay = scene->lay; DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); - LayerCollection *layer_collection = BKE_layer_collection_get_active_ensure(scene, view_layer); - BKE_collection_object_add(&scene->id, layer_collection->scene_collection, ob); + LayerCollection *layer_collection = BKE_layer_collection_get_active(view_layer); + BKE_collection_object_add(G.main, layer_collection->collection, ob); Base *base = BKE_view_layer_base_find(view_layer, ob); BKE_view_layer_base_select(view_layer, base); |