I want to add custom data to faces to be used by geometry nodes. Suppose I have a grid and I want to put boxes on most of the faces and cylinders on selected faces (not randomly), something like this:
An option is to assign two materials to the faces of the grid, one for the cubes and another for the cylinders, and filter by material index, but I want to know if there is a better option. I was looking at Object Data Properties to see if I could use something from there. Vertex Groups can be used by nodes but don’t work for faces. I also see two panels I never used before called Face Maps and Attributes:
On Face Maps I can select faces and assign them similar to how Vertex Groups work but I don’t see it on the spreadsheet and don’t see any node to access it. Attributes appear on the spreadsheet but I don’t know how to manipulate data there and how to access it through nodes.
Vertex Colors is one way (being replaced by a more generalized “Attributes” in 3.3(I think)), and you can use Vertex groups to select faces (with some limitations)…
In 3.1, when you add a vertex color it will appear as an Attribute:
…and you select it in the modifier panel:
To keep to painting faces use the face mask in Vertex Paint view:
You can also use Vertex groups to select faces if you treat the input as a float… you just need to capture the vertex group’s data in the face domain and compare to 1.0 (faces that don’t have all vertices selected will have a value below 1.0)… Unfortunately, that does mean that setups like this won’t work:
… because the face in the middle will share those vertices.
Workaround for that is to disconnect those faces or inset them, which isn’t great.
Thanks @zeroskilz, I didn’t know I could use Vertex Colors for that. It still doesn’t feel like the best solution but unfortunately Face Maps is not available as an attribute.
@rigoletto Vertex Groups is not the best solution because the problem pointed by @zeroskilz but the video you shared helped me to understand how to use attributes as selection, so thanks for that.
For anyone interested in how to do it, there are the nodes to do something like in the first image I posted.
Reviving this. You can set the custom attributes by using the “Mesh->Set Attribute” or “search → Set Attribute”. But its very manual. Would be cool to be able to use the paint functions to for instance “paint” face attributes.