← All ideas
  • Published 6 Jul 2021

Geometry Nodes: Lists

list-node.png

This proposal is for a new concept: 'Lists' of values.

Lists can be created by plugging multiple values into a List node.

Lists have a type. Eg: Lists of strings, lists of floats, lists of vectors. Mixed types in a list is not permitted.

Lists inputs or outputs are represented by the multi-input 'vertically stretched' plug socket.

Example Use: Point Instance Input

The current point instance.

current-point-instance.png

This current design for Point Instance has two major limitations:

  1. You can not use generated geometry as an input.
  2. You can not combine multiple sources of input together.

Here's what the Point Instance node could look like, re-imagined with Lists :

redesigned-point-instance.png

Modifying Lists

list-get-remove.png

list-sort-reverse-randomise-2.png

Lists can be modified after they're created.

Lists can be:

  • Split
  • Sorted
  • Randomised
  • Reversed
  • Repeated
  • Combined

You can also:

  • Fetch a value from an index
  • Add new values anywhere in the list
  • Remove a value from a list
  • Find and replace values
  • Count the length of a list
  • Find the index of a value

Example Use: String manipulation

sort-list-of-names-2.png

In this example a string value which contains a list of names separated by commas is processed. The operation is to sort the list of names alphabetically.

First the string is separated into a list of string values using the 'Split String into List' node. The list is then sorted using the Sort List node, then recombined into a string using the 'Join List into String' node.

This kind of operation would either require many specialist nodes or tedious node groups to perform without lists.

Looping With Lists - For Each

list-for-each-the-group.png

The For Each node is a special kind of Group node.

Visually and functionally almost identically to a Group node, with Group Inputs and Group Outputs.

The For Each node allows users to select a node group and apply the node group to every value within a list.

Hence, "For Each" , as in, "For each value, do this:" .

To use:

  1. Add a For Each node
  2. Create or select a node group
  3. Add For Each Value node to receive each value in the List for every execution of node group.
  4. (Optionally) Add For Each Input & For Each Output . These function like Group Input/Group Output. Plug a value into the For Each Output to make that value available to the next execution of the For Each via the For Each Input.

Example Use: Stacking Books

stack of books.png

In this example a stack of books is created using a list of geometry (from a Collection) and For Each node.

list-stacking-books-1.png

The For Each Input and For Each Output nodes are used to progressively combine geometry from the For Each Value. Each piece of geometry is combined by calculating the top height of the geometry, transforming the new book up to the top, then joining it to the growing stack.

list-stacking-books-3.png

There are other interesting ways this could be used, such as first sorting the list of geometry by size to put the largest books at the bottom of the stack automatically, randomising the order, etc.

Bonus Example Use: Separating 3D Photoscan

3d-scan.png

This node group separates a piece of geometry into a list of geometry parts, then keeps only the largest piece.

list-keep-highest-vertex-count-geometry-piece.png

The custom sort method sorts geometry by it's vertex count.

list-keep-highest-vertex-count-geometry-piece-3.png

98%

Development Status: Open

Upvote 96 Downvote 2
mindinsomnia
6 Jul 2021

8 Comments

willisthewillow

I was just googling to see if Geonodes had this feature, and it doesn't, but it really should!

2
roelant.rijs

I could really use this for configuring geometry, a bit like the way L-systems are described. A string-to-value node would also help, but this is even more useful.

1
constantinesis

Please make this real! Is essential for the workflow logic! I was using Grasshopper and the List tools are the first thing that i looked for in Geometry Nodes but did not find

1
Luxious

Hi! I think you did a great job explaining the possibilities of the Lists. It is often used in scripting and Nodes are, in the end, a kind of coding.

I was thinking to suggest the same but with a little difference.

In my proposal, I was trying to solve an issue when it is needed to transfer the parameters from a Group Input to a nested Group, or even though several nested groups, or instances of nested groups. When we have to manage each value as a wire, it is tedious. But with Lists, it is much easy. Also, as you suggested, we can modify the individual items of the list, so the possibilities are huge.

In this case, it is necessary that the list accept any kind of variable (I think you suggested using only one kind per list). Also, "List" should be a new type (as string, float, integer, etc).

Example

  1. Take all the values from the Group Input and connect each to a "Combine List" node. The output is a List.
  2. On the nested Group, define an input as a List. Once do the link, you will get all the inputs of the root Group.
  3. Use a node "Separate List" to expose each variable of the list.

Another turn in the screw on this idea is to get the List directly from the "Group Input" node (as an option in the node to combine all the outputs of the node as a List). Then you only need to link this wire.

I made a drawing but I cannot see where to attach it to the comment.

1
smeebit

I'm not very knowledgeable of geometry nodes. But the more I learn, the more I encounter limitations that making a list would solve. I didn't know it was possible until I just googled it and found this thread. Now I'm sad it's not real.

brunnerh

I have been thinking about a for each node as well. One problem that came up was dealing with dynamically created geometry where the count of objects is not fixed.

There probably would need to be a conversion node for splitting geometry into a list using various modes:

  • Linked (like the Select Linked operation, could also support the various options: Normal , Material , etc.)
  • Attribute (similar to Point Separate where an attribute is used as a mask)
  • Faces
  • Edges
  • Vertices
mindinsomnia Author

I just added an example similar to what you mention. A 'Separate Geometry' node that would separate geometry into a list of geometry using various methods, I gave the example of loose parts, but methods such as 'by Vertex' or 'by Face' or 'by Material' etc could exist too.

1