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:
authorPhilipp Oeser <info@graphics-engineer.com>2020-02-10 12:26:34 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-02-10 12:31:02 +0300
commitdbf48758d956bb23ad6b07ab16c3d0dacb657ccd (patch)
treee305cb65a974a3fc9ff35d900d30322d1bbaab29
parent7c54de4ab38171c2555e608c70cc02e1d08b893f (diff)
Fix T73681: Python exception adding Empty objects via `object_data_add`
with "Enter Edit Mode" enabled It is valild to add Empties this way, but we cannot enter editmode on those.
-rw-r--r--release/scripts/modules/bpy_extras/object_utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index 8c009a77d3d..540bc75cece 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -161,7 +161,7 @@ def object_data_add(context, obdata, operator=None, name=None):
bpy.ops.object.mode_set(mode='EDIT')
else:
layer.objects.active = obj_new
- if context.preferences.edit.use_enter_edit_mode:
+ if obdata and context.preferences.edit.use_enter_edit_mode:
bpy.ops.object.mode_set(mode='EDIT')
return obj_new