Naming Inconsistency with LIGHT_PROBE causing problem #106978

Closed
opened 2023-04-15 04:39:48 +02:00 by Harry McKenzie · 1 comment

System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: NVIDIA GeForce GTX TITAN/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 473.04

Blender Version
Broken: version: 3.4.0, branch: master (modified), commit date: 2022-12-07 11:39, hash: rB175bd3820151
Worked: Never

Short description of error

This issue is not a bug but rather a consistency issue which I though is worth reporting. The following script works for all types defined in Id Type Items except for LIGHT_PROBE which deviates from the naming convention used for all other types. Every enum type just concatenates all words together without an underscore like GREASEPENCIL, CACHEFILE, WINDOWMANAGER, PAINTCURVE, LINESTYLE, etc. I noticed this problem when I answered this thread.

Exact steps for others to reproduce the error

  1. Create any Light Probe object via Add > Light Probe
  2. Run the following script:
def get_id_type(obj):
    return obj.bl_rna.identifier.upper()

obj = bpy.data.lightprobes[0]
id_type = get_id_type(obj)
print("Id Type: ", id_type)
  1. Notice it prints LIGHTPROBE instead of expected enum LIGHT_PROBE. All the other types such as GREASEPENCIL, CACHEFILE, WINDOWMANAGER, PAINTCURVE, LINESTYLE, etc work. LIGHT_PROBE is the only enum with an underscore. That is a consistency issue and also creates problems like in that code where you end up needing to resort to hard-coding additional unnecessary checks like if id_type == LIGHTPROBE: id_type = LIGHT_PROBE. LIGHT_PROBE enum should be renamaed to LIGHTPROBE for consistency.
**System Information** Operating system: Windows-7-6.1.7601-SP1 64 Bits Graphics card: NVIDIA GeForce GTX TITAN/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 473.04 **Blender Version** Broken: version: 3.4.0, branch: master (modified), commit date: 2022-12-07 11:39, hash: `rB175bd3820151` Worked: Never **Short description of error** This issue is not a bug but rather a consistency issue which I though is worth reporting. The following script works for all types defined in [Id Type Items](https://docs.blender.org/api/current/bpy_types_enum_items/id_type_items.html#rna-enum-id-type-items) except for `LIGHT_PROBE` which deviates from the naming convention used for all other types. Every enum type just concatenates all words together without an underscore like `GREASEPENCIL, CACHEFILE, WINDOWMANAGER, PAINTCURVE, LINESTYLE`, etc. I noticed this problem when I answered [this thread](https://blender.stackexchange.com/questions/290548/how-to-get-a-object-id-type-in-python/290717). **Exact steps for others to reproduce the error** 1. Create any Light Probe object via _Add > Light Probe_ 2. Run the following script: ``` def get_id_type(obj): return obj.bl_rna.identifier.upper() obj = bpy.data.lightprobes[0] id_type = get_id_type(obj) print("Id Type: ", id_type) ``` 3. Notice it prints `LIGHTPROBE` instead of expected enum `LIGHT_PROBE`. All the other types such as `GREASEPENCIL, CACHEFILE, WINDOWMANAGER, PAINTCURVE, LINESTYLE`, etc work. `LIGHT_PROBE` is the only enum with an underscore. That is a consistency issue and also creates problems like in that code where you end up needing to resort to hard-coding additional unnecessary checks like `if id_type == LIGHTPROBE: id_type = LIGHT_PROBE`. `LIGHT_PROBE` enum should be renamaed to `LIGHTPROBE` for consistency.
Harry McKenzie added the
Severity
Normal
Type
Report
Status
Needs Triage
labels 2023-04-15 04:39:49 +02:00
Harry McKenzie changed title from Naming Inconsistency with LIGHT_PROBE being the only Id Type enum with an underscore to Naming Inconsistency with LIGHT_PROBE causing problem 2023-04-15 04:48:15 +02:00
Iliya Katushenock added the
Interest
Grease Pencil
Interest
Python API
labels 2023-04-15 10:27:29 +02:00
Germano Cavalcante removed the
Interest
Grease Pencil
label 2023-04-17 22:04:06 +02:00

Thanks for the report, but the issue reported here is a request for modified/improved behavior and not a bug in current behavior.
So closing as this bug tracker is only for bugs and errors.

For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests

For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug

Thanks for the report, but the issue reported here is a request for modified/improved behavior and not a bug in current behavior. So closing as this bug tracker is only for bugs and errors. For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-04-17 22:04:33 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 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#106978
No description provided.