Skip to content

Setting Attribute Value in Edit Mode

00004707 edited this page Aug 9, 2023 · 1 revision

In this example, you will learn how to create an attribute that can be used with Selection Input of the Instance On Points node in Geometry Nodes

This will allow you to select the vertices on which the instances will appear without use of vertex groups.

  1. Create a subdivided plane

    • Add a plane object and switch to the edit mode.
    • Select all vertices and press Right Mouse Button and then select subdivide.
    • Repeat the subdivision few times or use Number Of Cuts in the pop-up menu in lower left corner of the 3D View.

blender_QAOhjg8VUv

  1. Add this Geometry Nodes Modifier

    • You can use a custom mesh instead of a cube.
    • Adjust the scale if the instances are too large

blender_n4urhMFEhe

  1. Create a new Boolean Vertex Attribute

    • Locate the Attributes Menu located in Data tab of the Properties panel, and press the + button

    blender_9QRc5NwORM

    • Set the name to "Selection" (or any other you like), with domain set to Vertex and data type set to Boolean

    blender_ge22F1YX8v

    This attribute will store True/False values for each vertex of the mesh.

  2. Add a Named Attribute node to the Geometry Nodes setup

    • Add a new node and press the box next to Name input to select new attribute

    blender_BNmw9u71Dl

    • Connect the Attribute output to Selection input of Instance On Points Node

    blender_dmxKa86xsG

    • The instances will disappear
  3. Switch to edit mode and select the new Attribute

    • Select the new Attribute on the list in Attributes Menu

    blender_FWqUwgTppj

    • Under Assign button you will see a tickbox with the attribute value that will be set to selected vertices in edit mode.

    blender_tbuWQOrcs3

  4. Select few vertices in edit mode

    blender_8RT7EMwjWb

  5. Assign new value to the attribute

    • In Attributes Menu make sure the Vertex Boolean Value checkbox is checked

    blender_tbuWQOrcs3

    • Press the Assign button to store the True value in selected vertices.

    blender_4mmPRP3LmX

  6. Preview the result

    • Instances should appear on the vertices holding True value.

    blender_j0CBWwB0oD

    • You can also see the values in the spreadsheet tab.

    blender_sGRmSK400O

  7. Finish!

Selection buttons

blender_7fa2aRMO5m

Select True button will allow you to select vertices holding the True value if those vertices are deselected. You can also deselect them with appropriate button.

Inverting values

To invert the values quickly, use the Invert Attribute operator in the dropdown menu.

blender_gMwqtDejOl

Other uses

You can use this method to

  • limit your geometry nodes to specific faces, edges or vertices
  • quickly select certain parts of the mesh generated by geometry node setup after the modifier was applied
  • modify color attributes of specific face corners
  • ...