Python exception adding Empty objects via object_data_add with "Enter Edit Mode" enabled #73681

Closed
opened 2020-02-08 20:29:48 +01:00 by jon denning · 6 comments
Member

System Information
Operating system: Linux-4.15.0-76-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.116

Blender Version
Broken: version: 2.83 (sub 2), branch: master, commit date: 2020-02-07 22:49, hash: a010d97204
Broken: version: 2.82 beta, hash: 68221b7ebafe
Broken: version: 2.81a

Short description of error
Python throws exception below when using bpy_extras.object_utils.object_data_add with "Enter Edit Mode" enabled.

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "/home/jon/software/blender-2.83alpha-20200208/2.83/scripts/modules/bpy_extras/object_utils.py", line 165, in object_data_add
    bpy.ops.object.mode_set(mode='EDIT')
  File "/home/jon/software/blender-2.83alpha-20200208/2.83/scripts/modules/bpy/ops.py", line 201, in __call__
    ret = op_call(self.idname_py(), None, kw)
TypeError: Converting py args to operator properties:  enum "EDIT" not found in ('OBJECT')

Tested also in latest 2.82 beta and 2.81a with same results (throws exceptions).

Exact steps for others to reproduce the error
Load factory settings, then paste following into Python Console.

from bpy_extras.object_utils import object_data_add

# does not break
bpy.context.preferences.edit.use_enter_edit_mode = False
object_data_add(bpy.context, None, name='GOOD')

# breaks!
bpy.context.preferences.edit.use_enter_edit_mode = True
object_data_add(bpy.context, None, name='BAD')
**System Information** Operating system: Linux-4.15.0-76-generic-x86_64-with-debian-buster-sid 64 Bits Graphics card: GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.116 **Blender Version** Broken: version: 2.83 (sub 2), branch: master, commit date: 2020-02-07 22:49, hash: `a010d97204` Broken: version: 2.82 beta, hash: `68221b7ebafe` Broken: version: 2.81a **Short description of error** Python throws exception below when using `bpy_extras.object_utils.object_data_add` with "Enter Edit Mode" enabled. ``` Traceback (most recent call last): File "<blender_console>", line 1, in <module> File "/home/jon/software/blender-2.83alpha-20200208/2.83/scripts/modules/bpy_extras/object_utils.py", line 165, in object_data_add bpy.ops.object.mode_set(mode='EDIT') File "/home/jon/software/blender-2.83alpha-20200208/2.83/scripts/modules/bpy/ops.py", line 201, in __call__ ret = op_call(self.idname_py(), None, kw) TypeError: Converting py args to operator properties: enum "EDIT" not found in ('OBJECT') ``` Tested also in latest 2.82 beta and 2.81a with same results (throws exceptions). **Exact steps for others to reproduce the error** Load factory settings, then paste following into Python Console. ``` from bpy_extras.object_utils import object_data_add # does not break bpy.context.preferences.edit.use_enter_edit_mode = False object_data_add(bpy.context, None, name='GOOD') # breaks! bpy.context.preferences.edit.use_enter_edit_mode = True object_data_add(bpy.context, None, name='BAD') ```
Author
Member

Added subscriber: @gfxcoder

Added subscriber: @gfxcoder
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Philipp Oeser self-assigned this 2020-02-10 10:15:38 +01:00
Member

Can confirm.
True for Empty objects (obdata=None)
Fix incoming...

Can confirm. True for Empty objects (obdata=None) Fix incoming...
Philipp Oeser changed title from Python throws exception when using `object_data_add` with "Enter Edit Mode" enabled to Python exception adding Empty objects via `object_data_add` with "Enter Edit Mode" enabled 2020-02-10 10:18:33 +01:00

This issue was referenced by dbf48758d9

This issue was referenced by dbf48758d956bb23ad6b07ab16c3d0dacb657ccd
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blender/blender#73681
No description provided.