# How to show only certain vertices in Geometry Nodes?

The objects have a Custom Property called RequiredVerticesArray, which stores the indices of the vertices that should be displayed.

How to read this array through Geometry Nodes and display only these vertices?

Essentially, I need the Mask Modifier functionality, but without creating a separate vertex group for each object. Because different objects can have the same mesh, but must display different vertices.

If I cannot directly pass RequiredVerticesArray, is it possible to pass it as a string like "1, 2, 3, 4, ..." and then convert it into an array inside the geometry nodes?

• Well you need to discriminate those vertices somehow... By their position? By the fact they're not connected to any edges? You could specify in the modifier panel how many such vertices they are and require that those vertices have the first indices... Commented Jun 25 at 10:33
• No, it is not possible. You should store data inside Attributes Commented Jun 25 at 11:04
• @Crantisz what is impossible specifically? Commented Jun 25 at 11:33
• @MarkusvonBroady Pass array/string into Geometry Nodes Commented Jun 25 at 11:34
• @Crantisz I think OP by array means vertices, which act as an array as far as data is concerned - see How to instantiate objects on individual/selected points in geometry nodes? (section: "Using another geometry"). Also you can pass a string as an input in the modifier panel. Commented Jun 25 at 11:38

Passing an array/string into Geometry Nodes is not possible, You should store data inside Attributes.

Here is an example how you can do this using Python:

import bpy
import random
import bmesh

obj = bpy.context.object

# Get BMesh to manipulate mesh data:
me = obj.data
bpy.ops.object.mode_set(mode='EDIT')
bm = bmesh.from_edit_mesh(me)

# Make an int attribute:
if 'Test Int' not in bm.verts.layers.int.keys():
bm.verts.layers.int.new('Test Int')

intLayer = bm.verts.layers.int['Test Int']

# Set a random int in each vertex:
for v in bm.verts:
v[intLayer] = random.randint(1,10)

bmesh.update_edit_mesh(me)


In my example, I store random integer in each vertex, you should put your code here, that reads data from file or so

After that, you can get Test Int attribute like this:

If you have identical geometry, you can transfer data from one to another using Sample nearest node:

Sample nearest finds nearest point at given geometry and returns index of this point, that you can use in Sample Index node. Sample Index can return the attribute value from this point.