Mesh.attributes.new() returns None if named the same as a Vertex Group #103410
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
9 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#103410
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: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 517.40
Blender Version
Broken: version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash:
a95bf1ac01
Worked: Never? Doesn't work in 3.3 at least
Since
101d04f41f
, this now crashesShort description of error
When creating a new attribute if it is named the same as an existing vertex group
None
is returned and no information is given as to why it was returned NoneExact steps for others to reproduce the error
C.object.data.attributes.new('Group', 'FLOAT', 'POINT')
None
without any information given that it is because it's named the same as a Vertex Group but that you can't access Vertex Groups through attributes (or something)I understand Vertex Groups are in this quasi-middle area right now between object and mesh and this is probably why this happens but maybe an error should be thrown since nothing is returned even though the command was correct.
Added subscriber: @Zeastin
Added subscriber: @scurest
Added subscribers: @HooglyBoogly, @mod_moder
This is because the vertex weights will be completely replaced by attributes.
And in that case, it's a feature request.
@HooglyBoogly
All I'm asking for in this report is just some feedback for the programmer when using the attributes.new() command until vertex groups can be fully moved over to attributes. This happens in the current LTS (3.3) as well which won't get any updates or new features for another 6 months when the next LTS is released.
Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
I think it's reasonable to expect an error message here. Unfortunately that's more difficult than it should be internally, since the attribute API doesn't give error messages now. But it's theoretically possible.
Could it bump up to the next name, eg.
Group.001
, as ifGroup
existed?Good idea, that might be a more consistent solution.
For any developers interested in implementing this, that would involve also looking through vertex group names (
Mesh.vertex_group_names
) inBKE_id_attribute_calc_unique_name
.Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'
Should the tribute capture attribute node take this into account too?
I've added a check to create attribute names.
So everything works.
But it seems that it is needed not only for creating attributes...
Here I first created the attributes, and then the weights of the vertices:
Added subscriber: @Baardaap
The vertex group code doesn't know about attributes at all. So I think it's pretty hard to check for already existing attribute names over there. At least the warning is displayed when the attribute system detects the collision, though it's a pity it's only displayed on the (by default collapsed) attributes panel and not also on the Vertex groups panel.
Vertex groups probably won't be attributes for quite a long time, because vertex groups can be stored sparsely (which is absolutely needed for armature weights) while attributes can't. So it might be worth it to display this warning also in the Vertex Group panel?
Or maybe we should just factor in a check for existing attributes in the vertex group system after all. I think it was not done because 'eventually vertex groups go away'...
Added subscriber: @Suyash-Sapkal
Added subscriber: @Fiona-Gallagher
Crash in recent versions due to failure in finding customdata-layer.
Since
101d04f41f
, this now crashesWill check why that is and temporarily raise priority until at least the crash is gone again
Will (at least temporarily) put on my desk
@Baardaap : pushed some code around so we can run both callbacks on both places,, if you are interested, put up a PR, see #109910