How to count the number of items in an output node?

Screenshot_2022-05-03_095750

I know how to do this in Grasshopper, but how do you do this in Geometry Nodes?

The nodes following this wants an index, and the only index node I see gets it’s index “from thin air”*, and this can only be plugged into a relevant input node, but I want to do some index manipulation depending on my domain.

PS. Isn’t it weird that Geometry Nodes doesn’t have its own section on this forum?

/* Yes, I’ve watched this, and it’s still confusing as hell. Also, weirdly, my 100+ instance geometry nodes object has currently 2 entries in the instance category…

Use the domain size node to get the number of items in any geometry domain. To get the number of points on a spline, set it to point cloud.

More info on the docs:
https://docs.blender.org/manual/en/3.1/modeling/geometry_nodes/attribute/domain_size.html

2 Likes

Hi @eobet,

Without knowing what you plan to do with this value, I can only suggest this as a possible option:

As you have an input for the length of the curve-to-points and you obviously have a curve that this references, you can do some simple maths with this info and retrieve the value in a seperate branch - here I’ve plugged the result into a viewer node , which allows you to see what values are at any point in a geometry pipeline. Here it’s 8 points, confirmed by hovering the mose over the Points output of the curve-to-points node ( green highlight ).

Hope that’s of help.

Cheers,
Dj.

ps. @Charles_Weaver ( above post) has a much simpler solution, but be sure to switch the type to Point Cloud:

2 Likes

:man_facepalming:

Sometimes you get so blind going down a rabbit hole that you can’t see the solution in front of you… I was trying to use “Attribute Statistic” and stuff like that… notice how I even used the word “domain” in my original post!

Thank you both!

1 Like