diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-04 01:32:49 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-04 01:32:49 +0400 |
commit | b075765edd9e8f18b088faf1a55358d0f8a289cd (patch) | |
tree | 8e47cac0528e5448741c88b3e4b6cfe62c0183fc /source/blender/collada/collada_utils.cpp | |
parent | 552a70f1774dcb197739281968aab58cf887fd83 (diff) |
Fix #31258: collada now selects newly added objects after import.
Diffstat (limited to 'source/blender/collada/collada_utils.cpp')
-rw-r--r-- | source/blender/collada/collada_utils.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index 4aed29defbc..bd0f82fb0ac 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -34,6 +34,7 @@ #include "DNA_customdata_types.h" #include "DNA_object_types.h" +#include "DNA_scene_types.h" #include "BLI_math.h" @@ -41,6 +42,7 @@ #include "BKE_customdata.h" #include "BKE_depsgraph.h" #include "BKE_object.h" +#include "BKE_scene.h" #include "WM_api.h" // XXX hrm, see if we can do without this #include "WM_types.h" @@ -110,3 +112,16 @@ int bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space) return true; } +Object *bc_add_object(Scene *scene, int type, const char *name) +{ + Object *ob = add_only_object(type, name); + + ob->data= add_obdata_from_type(type); + ob->lay= scene->lay; + ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; + + scene_select_base(scene, scene_add_base(scene, ob)); + + return ob; +} + |