Attribute Names for Multiple Domains #86206

Closed
opened 2021-03-02 21:14:48 +01:00 by Hans Goudey · 7 comments
Member

Many planned attributes can exist on multiple domains:

  • Normals Point, Face, Corner
  • Index Point, Face, Edge, Corner
  • ...

While the attribute system could try to automatically choose which domain based on a single name (i.e. we have multiple attributes with the same name), it's very nice to know explicitly which domain the data comes from, and many things become simpler to the user and the code when we don't try to handle the case of multiple attributes with the same name.

So we discussed using a different name for each domain. Here is one initial proposal:

  • normal
  • face_normal
  • corner_normal
  • point_index
  • edge_index
  • face_index
  • corner_index

It was suggested to put the domain name after the attribute name like normal_corner, however, the resulting combinations sound quite unnatural, and even a bit incorrect (i.e. index_edge), so I would actually prefer not to do that.

The idea with normal was that vertex normals are the most common, so we don't need to repeat "vertex" at the beginning of the name, just for brevity. However, I'm beginning to question that too, since vertex normals are read-only, it seems strange to emphasize them with a special name.

With all that said, here is my proposal for a naming pattern for multi-domain attributes:

  • vertex_normal Use the full name here, it's long but it's clear
  • face_normal
  • corner_normal
  • point_index Use the name of the domain, because point clouds would have "point_index" too
  • edge_index
  • face_index
  • corner_index

We have talked about this a few times, but I wanted to clarify the ideas and push a little bit more, because this is an important decision, attribute names are not easy to change later with versioning, and also my opinions have changed slightly.

Many planned attributes can exist on multiple domains: - **Normals** Point, Face, Corner - **Index** Point, Face, Edge, Corner - ... While the attribute system could try to automatically choose which domain based on a single name (i.e. we have multiple attributes with the same name), it's very nice to know explicitly which domain the data comes from, and many things become simpler to the user and the code when we don't try to handle the case of multiple attributes with the same name. So we discussed using a different name for each domain. Here is one initial proposal: - `normal` - `face_normal` - `corner_normal` - `point_index` - `edge_index` - `face_index` - `corner_index` It was suggested to put the domain name after the attribute name like `normal_corner`, however, the resulting combinations sound quite unnatural, and even a bit incorrect (i.e. `index_edge`), so I would actually prefer not to do that. The idea with `normal` was that vertex normals are the most common, so we don't need to repeat "vertex" at the beginning of the name, just for brevity. However, I'm beginning to question that too, since vertex normals are read-only, it seems strange to emphasize them with a special name. With all that said, here is my proposal for a naming pattern for multi-domain attributes: - `vertex_normal` *Use the full name here, it's long but it's clear* - `face_normal` - `corner_normal` - `point_index` *Use the name of the domain, because point clouds would have "point_index" too* - `edge_index` - `face_index` - `corner_index` *We have talked about this a few times, but I wanted to clarify the ideas and push a little bit more, because this is an important decision, attribute names are not easy to change later with versioning, and also my opinions have changed slightly.*
Hans Goudey self-assigned this 2021-03-02 21:14:48 +01:00
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member
Added subscribers: @HooglyBoogly, @JacquesLucke, @SimonThommes, @pablovazquez, @dfelinto
Author
Member

We talked about this earlier today. The team doesn't seem to have very strong opinions about the attribute names e.g. "normal" vs. "vertex_normal". But the consensus was that "vertex_normal" is okay.

Another piece of feedback is that index should not be handled as an attribute, but rather an expression. For example, if the attribute isn't displayed by the spreadsheet and it isn't stored as an attribute on the geometry data, is it really an attribute?
On the other hand, the difference is not that apparent on the user level anyway, and attribute system would be a nice shortcut to expose indices. This needs a bit more thinking though.

We talked about this earlier today. The team doesn't seem to have very strong opinions about the attribute names e.g. "normal" vs. "vertex_normal". But the consensus was that "vertex_normal" is okay. Another piece of feedback is that index should not be handled as an attribute, but rather an expression. For example, if the attribute isn't displayed by the spreadsheet and it isn't stored as an attribute on the geometry data, is it really an attribute? On the other hand, the difference is not that apparent on the user level anyway, and attribute system would be a nice shortcut to expose indices. This needs a bit more thinking though.
Member

Added subscriber: @CharlieJolly

Added subscriber: @CharlieJolly
Member

From a user perspective I'd like to use indices as though they were a read-only attribute but perhaps cleaner to have an Index to Attribute node? 🤔

From a user perspective I'd like to use indices as though they were a *read-only attribute* but perhaps cleaner to have an **Index to Attribute** node? 🤔

This issue was referenced by f117ea2624

This issue was referenced by f117ea26246355f423fd78785a3b00a2490bd9a4

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
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
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#86206
No description provided.