Support Strings Attributes in Geometry Nodes and Shader Nodes
I'm working on a new 3MF file Import/Export addon and I'd like to implement the ability to preserve as much of the data contained within the file in a non-destructive but editable and accessible-to-nodes manner. Currently strings as Named Attributes can be created and seen in the spreadsheet editor but the string type is missing from geometry nodes' implementation of named attributes and also not present in shader nodes.
Background and motivation
For the last couple years now multi-material 3d printing has really become a lot more accessible and it's now possible to paint a mesh different colors within the slicer. But as the size of each face can be quiet large, it's more than just color data applied to each face. The slicers split up each face and store that on each triangle as a segmentation string so that fine details can still be painted. For better or worse the current way this is stored in the 3mf file is as a segmentation string attribute on each triangle tag in the 3mf 3dmodel.model xml This isn't great but it's the world we live in until slicers start supporting storing color data on UV mapped textures as is supported by the standard one would hope would be used.
Using lib3mf, I can easily extract this segmentation string and store it as an attribute on each face but I can't then visualize it with an OSL shader because string types are not supported so there's be no way to decode the segmentation string. Granted any subsequent operations that impact the topology of the face would have to remove/clear that attribute for that face as there isn't a great way of propagating the attribute to child faces created on a face that has a segmentation string.
The lack of string attributes has resulted in some really elaborate and clever workarounds but in this case I would far prefer if such workarounds were unnecessary.
0 Comments