Add operators to convert generic attributes into task specific data (UVLayers, etc) #91379
There should be an operator to convert a generic attribute to a task-specific one.
With the functionality to manage generic attributes on a geometry there is a need to edit this data manually. This is currently not yet possible and will be a longer standing goal for a while.
Combined with the fact that there are separate namespaces for the different legacy attribute types causing name collisions very easily, there is a need to convert generic attributes into task-specific attributes that Blender understands within their context.
A geonodes modifier is applied on a bush scattering leaves
the UVs and vertex colors are now generic attributes and not editable with the respective editors
there are name collisions with newly created UV/vertex color layers
I like this idea. It means we can solve the generic attribute problem properly, but there would be a workaround in the meantime.
It would be helpful if this task defined a list of conversions that would be helpful. I'll start out with a guess maybe?
- 2D Vector -> UV
- Float -> vertex group
What are the other essential ones?
The only other one I'd consider essential would be:
- Color -> Vertex Color Layer
Then nice to have would be:
- 3D Vector -> Shapekey
Nice could also be conversion on the edge domain:
- bevel weight
Might be personal preference, but I don't consider face maps as important.
But in general I don't think we should necessarily enforce specific data types or domains for the conversions.
This sounds like a good solution I think It would address a majority of at least the dealbreakers i have been hitting with geo nodes.
Does this design task also takes into consideration making it possible to output UVs and vertex colors from geo nodes?
For example, when exporting geo nodes meshes?
Tried building with diff and the conversion doesn't seem to work right now, newly created attribute is pitch black. Also, for some reason attribute disappears when converted to a vertex group, which doesn't happen in other cases
Please check the video:
You'll probably have to apply the modifier in that case-- writing to a vertex color will still make it into a generic attribute, this patch doesn't change that.
It's not shown in the video, but I also tried converting to a vertex group and a UV map, which also didn't work. Maybe I am doing something wrong, idk
The operator in the patch only works on "applied geometry". The modifier just overwrites the existing attribute. You can see that by applying the modifier again.
I did find that there are issues when sculpt vertex colors are enabled. That's because of how
node_shader_gpu_vertex_color is implemented currently.
This issue was referenced by
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?