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-12-11 08:13:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-12-11 08:13:44 +0300
commitf52d60a21d4d3551190305549dbb2a647a1ae0c9 (patch)
tree67f13ede052ec89aa4a63521ffe8bb45d94be13f
parent5cd6aa4bc9a7f852bc3221ff4b62863d399be042 (diff)
Fix bpy.extras.object_data_add use without an active space
-rw-r--r--release/scripts/modules/bpy_extras/object_utils.py5
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)