ID property's id_type enum is missing the SCREEN type #115151

Closed
opened 2023-11-19 22:01:37 +01:00 by dima glib · 4 comments
Member

Blender Version
Broken: 4.0, 4.1 alpha
Worked: never

Short description of error
In Blender 4.0, UI support for IDBlock-referencing custom properties was introduced. In the corresponding popup dialog, there is the "ID Type" selector that determines the specific IDBlock type which can be used as the property's value. The corresponding enum seems to include options for all IDBlock types (even for Grease Pencil v3, which is not shipped in Blender 4.0), except for the Screen type.
However, Screen objects can still be assigned to custom properties via scripting, and trying to open the pop-up for such a property results in a crash.

image

Exact steps for others to reproduce the error

  • Open attached .blend file (the object "Cube" has a custom property of IDBlock of type Screen set with C.object["s"] = D.screens[0])
  • Try edit the custom property through the UI
**Blender Version** Broken: 4.0, 4.1 alpha Worked: never **Short description of error** In Blender 4.0, UI support for IDBlock-referencing custom properties was introduced. In the corresponding popup dialog, there is the "ID Type" selector that determines the specific IDBlock type which can be used as the property's value. The corresponding enum seems to include options for all IDBlock types (even for Grease Pencil v3, which is not shipped in Blender 4.0), except for the Screen type. However, Screen objects can still be assigned to custom properties via scripting, and trying to open the pop-up for such a property results in a crash. ![image](/attachments/3d3e0ff7-60c2-423e-981d-eb3361a16569) **Exact steps for others to reproduce the error** - Open attached .blend file (the object "Cube" has a custom property of IDBlock of type Screen set with `C.object["s"] = D.screens[0]`) - Try edit the custom property through the UI
dima glib added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-11-19 22:01:38 +01:00
Iliya Katushenock added the
Interest
Core
label 2023-11-20 11:52:17 +01:00

Thank you for the report, @dairin0d.

I can notice that not all IDs were put into the enum. (Whether it is intentional or an accident, I still need to check).
https://projects.blender.org/blender/blender/src/branch/main/source/blender/makesrna/intern/rna_ID.cc#L35-L75

But the crash really isn't ideal. So confirming the bug.

@mont29 ^

Thank you for the report, @dairin0d. I can notice that not all IDs were put into the enum. (Whether it is intentional or an accident, I still need to check). https://projects.blender.org/blender/blender/src/branch/main/source/blender/makesrna/intern/rna_ID.cc#L35-L75 But the crash really isn't ideal. So confirming the bug. @mont29 ^
Germano Cavalcante added
Module
Python API
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-11-20 23:21:18 +01:00

@mano-wii DId you find where that omission in rna_enum_id_type_items comes from?

In any case, this is a good test-case for forward-compatibility, when we introduce new ID types in the future ;)

@mano-wii DId you find where that omission in `rna_enum_id_type_items` comes from? In any case, this is a good test-case for forward-compatibility, when we introduce new ID types in the future ;)

It was removed in 2e635b6500
I noticed that the screen icon started to be used for the workspace ID.

@brecht, do you remember why ID Screen was removed from the rna enum?

It was removed in 2e635b6500 I noticed that the screen icon started to be used for the workspace ID. @brecht, do you remember why ID Screen was removed from the rna enum?

Talked with Brecht, this was likely an 'optimistic' change during 2.8 dev when Screen id type was expected to be fully removed and replaced by workspaces.

Will add it back for the time being, we should not have ID types accessible to users/scripters that are not listed in the IDTypes enum.

Will also add some new id_type member to RNA ID struct, which returns the ID identifier as listed in rna_enum_id_type_items, and some python testing to ensure there is no ID exposed in bpy.data that cannot be properly 'typed' from rna_enum_id_type_items enum.

Talked with Brecht, this was likely an 'optimistic' change during 2.8 dev when `Screen` id type was expected to be fully removed and replaced by workspaces. Will add it back for the time being, we should not have ID types accessible to users/scripters that are not listed in the IDTypes enum. Will also add some new `id_type` member to RNA ID struct, which returns the ID identifier as listed in `rna_enum_id_type_items`, and some python testing to ensure there is no ID exposed in `bpy.data` that cannot be properly 'typed' from `rna_enum_id_type_items` enum.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-11-21 18:54:42 +01:00
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#115151
No description provided.