diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-10-27 14:23:29 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-10-27 14:23:29 +0300 |
commit | 216a3a3826214c665c90b8c89715507e8755b1c7 (patch) | |
tree | 791f4ce375355d48a204b35284e2672e5489a84e /release/scripts/modules/bpy_extras | |
parent | 5f0933f07a548719a850d9cac01aae6709b9dc0b (diff) |
Fix T49743: Adding torus in edit mode local mode shows error
The 'local' layers were not correctly set when redoing 'add object'
addons using object_utils.py helper (we always want to restore layers
from view in local view, even if we set 'real' layers from operator
afterwards).
Diffstat (limited to 'release/scripts/modules/bpy_extras')
-rw-r--r-- | release/scripts/modules/bpy_extras/object_utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index 87bb84b5844..88cd7398fe0 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -137,12 +137,14 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True, name= if context.space_data and context.space_data.type == 'VIEW_3D': v3d = context.space_data + if v3d and v3d.local_view: + base.layers_from_view(context.space_data) + if operator is not None and any(operator.layers): base.layers = operator.layers else: if use_active_layer: if v3d and v3d.local_view: - base.layers_from_view(context.space_data) base.layers[scene.active_layer] = True else: if v3d and not v3d.lock_camera_and_layers: |