diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-11-08 17:16:49 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-11-08 23:39:01 +0300 |
commit | 206c94fea98d44ed9667607638c455c7c0e63822 (patch) | |
tree | ddc1f6f30c18d10674daaeeaee6b465550447709 /source/blender/collada/collada_utils.cpp | |
parent | 670e6cab4319b94c96c6a61cb76199f1054b935a (diff) |
Farewell Scene->base
While getting rid of Scene->base we got the following fixes:
* Fix "Convert To" operator
* Fix "NLA allowing to selected objects that are not selectable
* Fix scene.objects (readonly, no option to link/unlink)
Note: Collada needs to use the context SceneLayer for adding objects
however I added a placeholder, so Collada maintainers can fix this
properly.
Diffstat (limited to 'source/blender/collada/collada_utils.cpp')
-rw-r--r-- | source/blender/collada/collada_utils.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index 3bdd22a53f8..85976c64b5f 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -47,6 +47,7 @@ extern "C" { #include "BKE_customdata.h" #include "BKE_object.h" #include "BKE_global.h" +#include "BKE_layer.h" #include "BKE_mesh.h" #include "BKE_scene.h" #include "BKE_DerivedMesh.h" @@ -142,7 +143,14 @@ Object *bc_add_object(Scene *scene, int type, const char *name) ob->lay = scene->lay; DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); - BKE_scene_base_select(scene, BKE_scene_base_add(scene, ob)); + /* XXX Collada should use the context scene layer, not the scene one. (dfelinto/gaia). */ + SceneLayer *scene_layer = BKE_scene_layer_context_active_PLACEHOLDER(scene); + + LayerCollection *layer_collection = BKE_layer_collection_get_active_ensure(scene, scene_layer); + BKE_collection_object_add(scene, layer_collection->scene_collection, ob); + + Base *base = BKE_scene_layer_base_find(scene_layer, ob); + BKE_scene_layer_base_select(scene_layer, base); return ob; } |