Scripting: creating a corner-domain color attribute doesn't make it active #103564
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#103564
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.3340cc810203-linux.x86_64-release
Short description of error
Creating a color attribute with "Face Corner" domain on a mesh with no color attributes does not always make the new attribute active.
Exact steps for others to reproduce the error
Create a cube and then run this script.
Observe that the active color attribute is
None
for both CORNER domain cases.Somewhat bizarrely, this does work if you use
mesh = bpy.data.meshes.new('TestMesh')
instead of your cube.Added subscriber: @scurest
Added subscriber: @mod_moder
Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
I've found strange behaviors in how the active attribute works exactly.
Is it normal for an attribute to not be active?
Yes, as described in the report, the code will print only the first 2 attributes as active of the 4 created
Added subscriber: @JulienDuroure
I don't know if this is related, but creating the color attribute also doesn't make it active for rendering (the little camera next to the name). This is different that how UV maps behave. This also means it doesn't work with eg. Color Attribute nodes with a blank name. I know this used to work in previous versions.
Added subscriber: @HooglyBoogly
This definitely sounds like a bug. But I think the new behavior for making a color attribute active is better. Just creating a new color attribute with the Python API probably shouldn't change the active status, in case it was set explicitly by the user.
The report is about creating the first color attribute though. I expect if there's only one, it's active. I'm not sure what the behavior is when there are already other color attributes.
edit: For UV maps, creating the first UV map makes it active. Creating subsequent ones does not change the active map. I think this is how color attributes should work (and I think they did use to work that way).
Ah, I see. That sounds more reasonable I suppose. Thanks.
Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'
This issue was referenced by
101d04f41f
Changed status from 'Confirmed' to: 'Resolved'
Sorry, I just tried blender-3.5.0-alpha+master.1beaec46b8e3 and this still seems to work only sometimes.
Adding a vertex color through the old API
C.object.data.vertex_colors.new(name="Color")
to a newly created Cube does not make the color attribute active/default. Note that if you select the color attribute in the UI, delete it, and then run the same line again though, the second time it does make it active/default. So there's something weird going on.Importing a .dae/.obj file with vertex colors results in a color attribute that's active, but not default (the little camera).
@lichtwerk
@scurest : could you create a new report for both of these? (since these are a bit different than
color_attributes.new
.Feel free to subscribe me there (or even assign to me)