diff options
-rw-r--r-- | release/scripts/modules/bpy_extras/object_utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index 9db86782d02..8c009a77d3d 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -130,7 +130,10 @@ def object_data_add(context, obdata, operator=None, name=None): obj_new.matrix_world = add_object_align_init(context, operator) space_data = context.space_data - if space_data.type == 'VIEW_3D': + if space_data and space_data.type != 'VIEW_3D': + space_data = None + + if space_data: if space_data.local_view: obj_new.local_view_set(space_data, True) |