4
$\begingroup$

i'm learning Geometry Nodes and I'm trying to catch the value of a node to debug it. I think this should be achieved with the Viewer node, which has two inputs : Geometry & Value.

Connecting a mesh to the geometry input give me a feedback in the spreadsheet, as expected :

enter image description here

Now, I would like to inspect a value, but I don't see where the data gets rendered:

enter image description here

Can someone explain ?

Thanks !

$\endgroup$
0

1 Answer 1

11
$\begingroup$

The value sockets are divided on two types in GN, field and singular ones. More about that here: Why node socket shape is different (diamond vs circle)?

Field values

The value without geometry doesn't make sense. If you connect a random value node to some geometry, you will get a random value for each item in the set:

enter image description here

To make it clear, let's look at this setup:

enter image description here

Here, as you can see a plane with 4 points is created, and each of 4 points is moved in z direction at random value. Then the plane is subdivided 4 times and each of the resulted point is moved at random value, forming a noise pattern.

I think you expect to see 2 different random generators for each step. But it's not necessary, because random generates values for geometry plugged in.

So if you try to debug first step, you should do this like this:

enter image description here

4 values generated.

And for second step:

enter image description here

289 values.

Another example is then you add this random value to some point position:

enter image description here

If you don't connect this to some geometry, where Blender should get positions of vertices?

Singular values

But what about singular values? We need to note, that Random value node by default is not a singular one. To make it singular, we need to plug in a singular value in the ID value, so then it will be used as singular value (round socket) Geometry Nodes: How to use the Random Value node? (Output is red) :

enter image description here

So to debug singular values (round socket) you don't need a special node. Just hover mouse over the socket to preview its value:

enter image description here

but the node should be connected somehow to output to be calculated:

enter image description here

$\endgroup$
8
  • 2
    $\begingroup$ "The value without geometry doesn't make sense." - well, why ? It might help me debug my setup and understand what values some nodes do output. $\endgroup$
    – gordie
    Apr 2, 2022 at 11:13
  • $\begingroup$ In Geometry Nodes all values are in the context of a geometry. You could do some static calculation and bind it to the output node. But there would be no reason to use Geometry Nodes for that. $\endgroup$ Apr 3, 2022 at 8:11
  • $\begingroup$ @gordie I've updated answer. $\endgroup$
    – Crantisz
    Apr 3, 2022 at 12:33
  • 1
    $\begingroup$ you can always have a 'Value to String' and a 'String to Curves' pair of nodes, maybe group them with a Set Position or Transform node and call it INFO or something... I've used this quite a few times $\endgroup$
    – alambre
    Apr 3, 2022 at 23:48
  • 1
    $\begingroup$ Thanks for this amazing answer. But I don't see how it cannot be useful to get feedback on some computed values (eg. math operations), like Animation Nodes did - see here ? $\endgroup$
    – gordie
    Apr 4, 2022 at 8:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .