diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2019-03-12 23:28:45 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2019-03-12 23:28:45 +0300 |
commit | 9054b39b27c4198f436329f78af43fe3f3175508 (patch) | |
tree | 02312a157f6c3baa167c3a7660fdfb088f59118b /release/scripts/modules/bpy_extras/object_utils.py | |
parent | db5ca11d802ef987c34fd24f14db1b1427f5898e (diff) |
Fix T62436: New added Torus won't appear in Local View
I had to add a region3d.local_view_add(ob) for the API.
Diffstat (limited to 'release/scripts/modules/bpy_extras/object_utils.py')
-rw-r--r-- | release/scripts/modules/bpy_extras/object_utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index 5f3d6fbc50f..f020431c6bb 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -133,6 +133,11 @@ def object_data_add(context, obdata, operator=None, name=None): obj_new.select_set(True) obj_new.matrix_world = add_object_align_init(context, operator) + space_data = context.space_data + if space_data.type == 'VIEW_3D': + if space_data.local_view: + space_data.region_3d.local_view_add(obj_new) + if obj_act and obj_act.mode == 'EDIT' and obj_act.type == obj_new.type: bpy.ops.mesh.select_all(action='DESELECT') obj_act.select_set(True) |