Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-03-13 02:41:12 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-13 02:52:25 +0300
commitaf0ab15e1dd84aadb32ee8d7a836a08fe6251474 (patch)
tree4eabb3847dc1a28e68d052837d74fa5d59bc177c /release/scripts/modules
parent3ea7a5d8699c74ddf4ea7b359022145e44f62bc2 (diff)
Fix T62436: New added Torus won't appear in Local View
Add Object.local_view_get/set Alternate fix which supports removing from local view & checking if an object is in local view. Also avoids redundant refresh. Matches 2.7x Object.layer_local_view capabilities more closely, without exposing the flag directly.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r--release/scripts/modules/bpy_extras/object_utils.py5
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..10132366981 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:
+ obj_new.local_view_set(space_data, True)
+
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)