← All ideas
  • Published 6 Jun 2023

Recursive Geometry Nodes

Feature: Add Recursion into geometry nodes

Recursion in this context is the ability to store an action within itself.

Every node in geometry nodes can not be called within itself. This feature request is for allowing that ability.

There are many use cases for this. The Fibonacci algorithm is a famous example.

Fibonacci: image_2023-06-06_135151819.png

The Fibonacci node is inside itself here. So every call to the node will switch between returning "1" or returning the sum of two more Fibonacci calls.

This functionality can be used for so many fractal patterns and search algorithms.

It also can be used as a "hack" for loops. We don't have loops in geometry nodes yet. We only have the simulation nodes. But recursive nodes would allow us the ability to call nodes over and over again until a condition is met. This is sort of like a while loop in programming but has the added benefit of handling data more like a tree structure and not just a single list.

Overall, the addition of recursive calls in geometry nodes would significantly enhance their capabilities, allowing for more sophisticated and versatile procedural geometry generation and manipulation.

90%

Development Status: Open

Upvote 9 Downvote 1
spicymelon1
6 Jun 2023

3 Comments

AgentA1cr

This would be quite useful, but I suspect it would require its own dedicated type of node group to avoid a massive risk of runaway.

2
spicymelon1 Author

yeah that makes sense. I know that one of the "fears" of adding this to blender is that it allows for an easy way to crash the program. And blender devs probably try staying clear of that. But thats an intrinsic part of recursion and while loops so I think it sort of has to be presented as such.

ken.jinks

It is somewhat easy to limit the stack in a recursion. You instantiate the recursive function with a maximum depth and before it instantiates a new object it checks to see if the value has reached 0, if not instantiate a new object with maximum depth -1. This could be a hidden variable the devs could put in to limit the depth. The max depth could be derived by the resources divided by the size of the object to prevent crashing. Just a thought...