Regression: Creating the first vertex color on a mesh does not always make it active/default #103761
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#103761
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Operating system: Linux
Blender Version
Broken: blender-3.5.0-alpha+master.1beaec46b8e3-linux.x86_64-release
Worked: blender-3.3.2-stable+v33.bd3a7b41e2b3-linux.x86_64-release
Originally caused by
6514bb05ea
Needs a similar fix as
101d04f41f
Short description of error
(Continuation of #103564)
Creating a color attribute on a mesh that didn't have color attributes should make the new attribute active and default (by which I mean that little camera next to the name, not sure what it's called). This works in 3.3.2 and it's also how UV maps work.
Exact steps for others to reproduce the error
I've found at least two more cases where this does happen.
Using the old Python
vertex_colors
API. Create a new cube, runC.object.data.vertex_colors.new(name="Color")
in the console, observe the new attribute is neither active nor default. Note that if you delete the attribute using the UI, and then run the same line again, the second time it does work correctly!Using importers. Import a .dae or .obj file with vertex colors and the color attribute will be active but not default.
Using a
Data Transfer
modifier and usingGenerate Data Layers
(or using theTransfer Mesh Data Layout
operator) has the same issue: observe the new attribute is neither active nor default.Added subscriber: @scurest
Added subscriber: @lichtwerk
Added subscriber: @HooglyBoogly
Bisecting says the first bad commit is
6514bb05
(D15169).cc @HooglyBoogly
Creating the first color attribute on a mesh does not always make it active/defaultto Creating the first vertex color on a mesh does not always make it active/defaultChanged status from 'Needs Triage' to: 'Confirmed'
Creating the first vertex color on a mesh does not always make it active/defaultto Regression: Creating the first vertex color on a mesh does not always make it active/defaultAdded subscriber: @Wahooney
I will add to this the following (will update the report description as well):
I have the fix for case
1
and2
the newly spotted issue needs a bit more work...CC @Wahooney
This isn't exactly the same but definitely related: when entering Vertex Paint mode on a mesh with no color attributes and you start painting, it auto-creates a new attribute and calls it Attribute, where creating a new attribute in the Object Data Panel defaults to naming it Color. It's something I ran into when making the example for #103799 (Data Transfer doesn't work in some situations (geometry nodes modifier preceeding the Data Transfer modifier)). Consistency there would be preferable.
Added subscriber: @JulienKaspar
This changed in
6514bb05ea
which now bypassesLayerTypeInfo
default name (which is still "Col") and uses whatBKE_id_attribute_calc_unique_name
gives when no name is provided (which is "Attribute" by default)Sculpt mode painting does its own thing
BKE_sculpt_color_layer_create_if_needed
(calls it "Color", hardcoded)Adding the attribute via
GEOMETRY_OT_color_attribute_add
(in the UI list that is) also hardcodes this to "Color"(then there is also adding a canvas in sculptmode, which will call it e.g. "Material Base Color" -- this makes sense though)
Same is true for UVMaps btw.
@HooglyBoogly , @JulienKaspar : I think we should settle on one consistent name, no? Afaict, we can still rely on
LayerTypeInfo
defaultname. (changing this to "Color" might be good then)Another possibility would be to put this into
AttributeMetaData
?NOTE: this should be its own report though I guess.
Here is a patch that would get the default layer names from
LayerTypeInfo
P3437: default layer names from LayerTypeInfo (#103761)
Wouldn't it be better to move it into the attribute creation logic instead?
BKE_id_attribute_new
, as mentioned in D16898, appears like it would have fixed bothvertex_color.add
and the OBJ importer (but not Collada I think).we could move it there, but like you said, still does not garuantee everything is right... No strong opinion here, might also be better to drop the comment in D16799, might be forgotten otherwise
Assume you meant D16977?
Yeah, sorry, typing this on a phone with fat fingers :)
Note that removing a color attribute with eg
mesh.color_attributes.remove
can also leave the mesh in a state with no active/default color attribute. This is also a regression from 3.3.2.thx noting, will add that as well