Dependent/Linked CustomData layers #97174
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#97174
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?
When moving from an AoS to an SoA paradigm and mving compound structs to separate CD_PROP_* generic attribute layers, there needs to be a system to tie the various layers that used to be combined into a single struct together.
I'll describe the problem with the CD_MLOOPUV datalayer as an example, but I think it would be nice to solve this in a generic way because other parts of blender will likely have the same need to store 'structs' of related information in attribute layers.
First I'll desribe the original situation:
It is easy to access all the information elementwise. Accessing a single element gives you all information in an MLoopUV struct.
Now the new situation:
Possible solutions (ideas welcome):
A) Just tag on the extra specifier to the name, using some sort of reserved coupling character.
B) Add an extra list of dependent layers to the CustomDataLayer struct .
C) Add an extra sub-name field in the CustomDataLayer struct.
The prototype in D14365 more or less does A , but it doesn't handle renaming/deleteing.
Added subscribers: @Baardaap, @HooglyBoogly
I think some solution that maintains
CustomData
's flat array of layers would be preferable. Any sort of hierarchy is likely more complex and more costly to traverse, which I think is the case to optimize for rather than removal.For the selection and pinning layers, my hunch is that some other sort of attribute identifier similar to
AnonymousAttributeID
would be helpful, since I see them more as UI data. On the other hand, I'm not sure we've decided explicitly that such UI data shouldn't show up somehow in the attributes list.A seam layer seems more useful to control procedurally.
Here's another solution:
D) Add an array of "child/dependent attributes" to the parent custom data layer
Maybe some combination of these ideas makes sense, we'll see.
To be clear: your D) is what I meant wit my B).
I wasn't talking about actually nesting layers. Just linking them via a list of dependent layers. Which conceptually creates a hierarchy (but still is stored as a a flat list).
If we make them anonymous layers that would make it easier I guess, as then the naming problem doesn't really exist.
About: https://hackmd.io/@II9-Bkl4TJifCqGL2jgbUw/BJkCE9BVq
In general I like the proposal a lot. Keep it simple.
How do you propose to handle this:
Just append the name of the original UV layer?
How hard would it be (backwards compatibility-wise) to increase the max size of the layers names? With these sort of longish prefixes the 64char limit can get rather tight I think.
Yeah, that's the suggestion for handling those layers.
We talked about changing the layer name to
char *
instead of an array. Then arbitrary lengths could be supported.DNA could detect that change and apply it automatically when loading a file (as another
eReconstructStepType
possibly).There's one piece of the puzzle still missing from this proposal. (Though maybe that's out of the scope of this specific proposal?)
Optional attributes.
For some attributes it would be very nice if they could return a default value when reading from a layer that doesn't exist. And it would be even nicer if the layer would be created on demand when trying to write to certain non-existent layers.
This way we could prevent uv_vertsel,uv_pinned and uv_edgesel layers being created for each and every FLOAT2 layer even though they never will get used.
The first property (reading giving a default value when the layer doesn't exists) could maybe be handled with a specialized BM_CD_ELEM_GET_*_OPTIONAL() macro which would return a default value if the base offset is -1.
For the writing I don't really see how it could be done directly from the access macros. But that's not too bad because writing happens way less than reading. It would be nice if there were a set of CustomData_get_or_add_named_layer_* () functions which would create the layer if it doesn't yet exists or return it when it does.
I think reading attributes with a default value should be handled by the reader of the attribute, so with a macro like you suggest for BMesh.
In the C++ attribute API we already support this, with an optional default value argument to functions like
attribute_get_for_read
.Adding a
CustomData
function to add an attribute only if it doesn't exist sounds good.Though for
Mesh
, I think we should move towards using the C++ attribute API rather than theCustomData
API (that doesn't apply to BMesh).Added subscriber: @JacquesLucke
I posted a proposal that solves this and a bunch of other problems: #97452.
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
What is the status of this? Superseeded by #97452?
This issue was referenced by
6c774feba2
What was implemented in D14365 is more or less #97452 (option B)
Changed status from 'Needs Developer To Reproduce' to: 'Resolved'