AttributeGroup API: "active" is meaningless (always refers to all attributes, not the specific AttributeGroup) -- e.g. mesh.color_attributes.active #107194
Labels
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#107194
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Blender Version
Broken: blender-3.5.1-candidate+v35.eaf13ebc6776-linux.x86_64-release
Worked: blender-3.3.6-stable+v33.948f8298b982-linux.x86_64-release
Short description of error
Accessing the active color attribute through
mesh.color_attributes.active
returnsmesh.attributes["position"]
instead.API is basically broken since
eae36be372
the particular example in this report was exposed by
1af62cb3bf
Exact steps for others to reproduce the error
None
.Also if you create a color attribute by going into Vertex Paint mode, it will still incorrectly return
attributes["position"]
. If you create a color attribute by going through the Properties editor however, it behaves correctly.Hi, thanks for the report. I can confirm. Checking...
Caused by
1af62cb3bf
@HooglyBoogly ^
Python: wrong mesh.color_attributes.activeto Regression: Python: wrong mesh.color_attributes.activeI can have a look, have been busy in this area.
Note: even in 3.3, the logic is wrong.
color_attributes.active
will always return the active attribute (no matter if color or not).It just happens to be that in 3.3, there is no real attribute there yet on the default cube
Same seems to be true for setting btw.
See
rna_AttributeGroup_active_get
/rna_AttributeGroup_active_set
, this does not have a relation the AttributeGroup, this just handles all attributes.Not sure if the original plan with attributes was really to have multiple
AttributeGroup
, @brecht @HooglyBoogly ?eae36be372
made up a newAttributeGroup
, breaking some of the API...Regression: Python: wrong mesh.color_attributes.activeto AttributeGroup API: "active" is meaningless (always refers to all attributes, not the specific AttributeGroup) -- e.g. mesh.color_attributes.activeHm. this make it a bit above my pay grade ;-) .
I could still look into it if others don't have time, but I'd be slow.
Thinking about it further, making some of the API specific to the actual
AttributeGroup
, we could get rid of lots of handling of color vs. other attributes:active_color
vsactive
active_color_index
vsactive_index
render_color_index
,default_color_name
,active_color_name
, ... could all just be in the colorsAttributeGroup
AttributeGroup
)but I see there's also a rna_AttributeGroup_active_color_get shouldn't it just use that one instead? That does limit the search to color attributes.
C.object.data.color_attributes.active_color does call the correct function and return the correct result. But that's rather counterintuitive
I think @lichtwerk 's suggestion above is the way to go.
As a workaround, using
C.object.data.color_attributes.active_color
gives the correct result.Just as PSA: I don't have time to look into this at the moment. In case someone hoped I would ;-)
I think this is not a bug per-se . It's more a case of bad documentation and a slightly clumsy api.
I think we could remove the hi prio