Allow generic Vector2 face-corner attributes that aren’t treated as UV layers
Description
Currently, any mesh attribute with
domain='CORNER'
and
data_type='FLOAT2'
is automatically recognized as a UV layer in Blender 4.3 and later.
This makes it impossible to store non-UV per-corner Vector2 data (for example, procedural coordinates, mapping data, or custom geometry information) without cluttering the UV Layers panel or being interpreted by exporters as TEXCOORD data.
Proposed Solution
Add a simple property to
bpy.types.Attribute
, for example:
bpy.types.Attribute.role = Enum(('AUTO', 'UV', 'GENERIC'))
Only attributes with
role='UV'
would be listed as UV layers.
Attributes with
role='GENERIC'
would remain accessible through
mesh.attributes
but stay hidden from the UV UI and ignored by exporters that only handle UV data.
Existing UV maps would default to
role='UV'
, preserving full backward compatibility.
Example
import bpy
mesh = bpy.data.meshes.new("Example")
mesh.from_pydata([(0,0,0),(1,0,0),(0,1,0)], [], [(0,1,2)])
# Create a per-corner 2D attribute for generic data
attr = mesh.attributes.new("CornerData", 'FLOAT2', 'CORNER')
print(mesh.uv_layers.keys())
# Current: includes "CornerData" as a UV layer (unwanted)
# Proposed: only visible if attr.role == 'UV'
Benefits
- Prevents non-UV attributes from cluttering UV layers and the UV Editor
- Keeps exporters and add-ons from misinterpreting custom Vector2 attributes
- Fully backward compatible with existing files and workflows
- Minimal implementation change with long-term flexibility
1 Comment
Helped alot