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.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#73681
No description provided.