Fix #114760: new attribute does not get active for some domains #114797
No reviewers
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#114797
Loading…
Reference in New Issue
No description provided.
Delete Branch "lichtwerk/blender:114760"
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?
Problem here is that
BKE_id_attribute_to_index
[whichBKE_id_attributes_active_set
uses] does not matchBKE_id_attribute_from_index
which can lead to "wrong" indices (thereare "wrong" layers included while iterating such as ".corner_vert" or
".corner_edge" for faces).
Deeper reason is that
get_domains_types
swapsATTR_DOMAIN_FACE
andATTR_DOMAIN_CORNER
(originally introduced ineae36be372
-- but unclearat this point why this was done). Historically, this was used for operators
[vertex color rotate/inverse] introduced in
c75e1598dd
&771a4dee0b
,assumption is that
eae36be372
was trying to make this more generic and makeit work for other domains as well (ATTR_DOMAIN_MASK_COLOR -- the tootip
was also changed from "Rotate vertex colors inside faces" to "Rotate color
attributes inside faces"), however, at this point in time the tools clearly only work
for the corner domain (and this was made more specific in
ee18b625ca
as well).So now, remove the swapping all together and make
BKE_id_attribute_from_index
&BKE_id_attribute_to_index
in sync.Also change the tooltip of said operators to use "face corner color attribute".
Could we just remove the swapping in
get_domains_types
? Indeed that seems very weird.Hm, while I could not get any particular functionality to misbehave with swapping removed, I dont feel confident enough to do this as part of this bugfix. So this either needs even more investigation or is just for another commit...
Removing the swapping seems reasonable. If we find something misbehaves with that gone, we can fix it in another way, or at worst add it back. But currently no one can understand why it's there, best to remove it.
OKi, while usually I tend to lean in the "never-change-a-running-system" direction (as opposed to "take-down-and-rebuild-if-neccessary"), I will do the changes
Made some more research (updated the PR description), now also more confident that removing the swapping is the right thing to do (and should be safe).
@ -3262,3 +3262,3 @@
ot->name = "Rotate Colors";
ot->idname = "MESH_OT_colors_rotate";
ot->description = "Rotate color attributes inside faces";
ot->description = "Rotate vertex colors inside faces";
"Vertex colors" isn't a concept in Blender anymore (ideally anyway). How about "face corner color attribute"?
Well, it is still all over the place:
Maybe make this a cleanup afterwards?
Agh, good point. That transition was so incomplete :/
I'd still suggest to use the new terms in new code.
@ -839,2 +823,2 @@
for (int i = 0; i < ATTR_DOMAIN_NUM; i++) {
if (!(domain_mask & (1 << domains[i])) || !info[domains[i]].customdata) {
for (const int domain : IndexRange(ATTR_DOMAIN_NUM)) {
CustomData *customdata = info[domain].customdata;
const CustomData
Thanks a lot for fixing this! ❤️
Will it be added in 4.0.3?
I have added it to #114706