Addons with gpu rendering may not work in 4.0.0 #114359

Closed
opened 2023-11-01 10:35:54 +01:00 by Inês Almeida · 2 comments
Member

Blender Version
Broken: 4.0.0-beta, commit date 2023-11-01
Worked: 3.6

Short description of error
Due to changes in the Python API for builtin shaders, addons may no longer work in 4.0.
They won't display as expected, due to an error such as this:

ValueError: expected a string in ('FLAT_COLOR', 'IMAGE', 'IMAGE_COLOR', 'SMOOTH_COLOR', 'UNIFORM_COLOR', 'POLYLINE_FLAT_COLOR', 'POLYLINE_SMOOTH_COLOR', 'POLYLINE_UNIFORM_COLOR'), got '2D_UNIFORM_COLOR'

Longer description
While usage of the bgl module had a deprecation warning, removal of gpu.shader.2D_UNIFORM_COLOR and 2D_IMAGE came as an unexpected surprise (at least to me :).
I tested the addons I maintain with a development version of 4.0 a couple months ago, made sure they're updated from bgl to gpu and today I gave them a quick check before 4.0 release and was surprised that they don't work at all.

It seems related to this change 223665b994, but it mentions it intends to keep API backwards compatibility, I'm not sure when that was lost.

Maybe backwards compatibility is intended, but not working?
Or, please provide instructions for addon developers to update their addons to work both in 4.0 and 3.6LTS.

There are other addons with the same issue: #113004

**Blender Version** Broken: 4.0.0-beta, commit date 2023-11-01 Worked: 3.6 **Short description of error** Due to changes in the Python API for builtin shaders, addons may no longer work in 4.0. They won't display as expected, due to an error such as this: `ValueError: expected a string in ('FLAT_COLOR', 'IMAGE', 'IMAGE_COLOR', 'SMOOTH_COLOR', 'UNIFORM_COLOR', 'POLYLINE_FLAT_COLOR', 'POLYLINE_SMOOTH_COLOR', 'POLYLINE_UNIFORM_COLOR'), got '2D_UNIFORM_COLOR'` **Longer description** While usage of the `bgl` module had a deprecation warning, removal of `gpu.shader.2D_UNIFORM_COLOR` and `2D_IMAGE `came as an unexpected surprise (at least to me :). I tested the addons I maintain with a development version of 4.0 a couple months ago, made sure they're updated from bgl to gpu and today I gave them a quick check before 4.0 release and was surprised that they don't work at all. It seems related to this change https://projects.blender.org/blender/blender/commit/223665b994d785672c023432ac3861d4d2c0ffb6, but it mentions it intends to keep API backwards compatibility, I'm not sure when that was lost. Maybe backwards compatibility is intended, but not working? Or, please provide instructions for addon developers to update their addons to work both in 4.0 and 3.6LTS. There are other addons with the same issue: https://projects.blender.org/blender/blender/issues/113004
Inês Almeida added the
Module
Python API
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-11-01 10:35:55 +01:00
Author
Member

Simply using the new names seems to also work for 3.6 and 3.3LTS :)

Example:
gpu.shader.from_builtin('2D_UNIFORM_COLOR')gpu.shader.from_builtin('UNIFORM_COLOR')

Updating Edit Breakdown addon: 8ea7be3024

Simply using the new names seems to also work for 3.6 and 3.3LTS :) Example: `gpu.shader.from_builtin('2D_UNIFORM_COLOR')` → `gpu.shader.from_builtin('UNIFORM_COLOR')` Updating Edit Breakdown addon: https://github.com/britalmeida/edit_breakdown/commit/8ea7be30244b519d99bdf7b93a34d5d6170527fb
Iliya Katushenock added
Interest
EEVEE & Viewport
Interest
Python API
and removed
Module
Python API
labels 2023-11-01 12:51:02 +01:00

'2D_UNIFORM_COLOR' and '3D_UNIFORM_COLOR' were the same 'UNIFORM_COLOR' for quite a while.

A compatibility code has been implemented in 8cfca8e1bd to prevent breakage.
But this compatibility was removed in 9a8fd2f1dd

As it appears to be intentional, we cannot confirm this issue as a bug, unfortunately :\

Please try to contact the developers to propose reverting to the previous behavior: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests

(This report can be opened after approval)

`'2D_UNIFORM_COLOR'` and `'3D_UNIFORM_COLOR'` were the same `'UNIFORM_COLOR'` for quite a while. A compatibility code has been implemented in 8cfca8e1bd to prevent breakage. But this compatibility was removed in 9a8fd2f1dd As it appears to be intentional, we cannot confirm this issue as a bug, unfortunately :\ Please try to contact the developers to propose reverting to the previous behavior: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests (This report can be opened after approval)
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-11-01 20:53:59 +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
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#114359
No description provided.