2
$\begingroup$

I've set a "length" attribute in the Group Output node of my Geometry Nodes object:

enter image description here

Now, in a new Geometry Nodes object, how can I "get" that Length attribute ? I thought it would be available from the Object Info node, but it isn't.

Thanks !

$\endgroup$

2 Answers 2

3
$\begingroup$

I think you want to save a single data, not the field. But anyway, the only way to save data is to store it into some attribute.

enter image description here

If the data is singular, you can get the singular value using attribute static node

$\endgroup$
3
  • $\begingroup$ Everything is called value, not easy to understand :) But I almost got it unless this: how can I pass the output attribute variable from the first GN to the input attribute of the second GN ? imgur.com/a/NFbTszG $\endgroup$
    – gordie
    Apr 6, 2022 at 12:39
  • $\begingroup$ Click on the button on left side of the field $\endgroup$
    – Crantisz
    Apr 6, 2022 at 12:50
  • $\begingroup$ actually if the data is singular, it is better to use the "Sample Index"-node instead of the "Attribute Statistics"-node, cause it doesn't performs any calculations on the whole domain (which can be very large) ... $\endgroup$
    – Andy
    Jan 31 at 11:15
1
$\begingroup$

In the first GN modifier, push the output data into an Attribute. Then in the second GN modifier, access that Attribute as an input:

  1. In Object Data Properties/Attributes, create an attribute to store your data. Choose the right Domain and Data Type. I'm using a Boolean on Points to test the principle. screenshot showing creating a new attribute store

  2. In your first GN, connect your data to the Group Output node (as you have done). Check the Type and Domain in the flyout. screenshot showing node output settings

  3. In that first GN modifier you will have a new Output Attribute. Select your attribute store (from item 1) to route the output data into that attribute store. screenshot showing first GN modifier settings

  4. In the second GN, connect from the Group Input to whatever node is going to use the data. I'm using my boolean to select which points to place an instance on. screenshot showing second node layout

  5. In the second GN modifier, you will now have an Input Attribute slot. Press the button (spreadsheet icon) to switch from a single input to a field input. Select your attribute to route the data into the modifier.

screenshot showing node input settings.

I used the Viewer in each of my node layouts to see that the data was being transferred through. And here is my finished object, showing the starting cube with little cube instances on points 4 to 7: screenshot showing finished cube

$\endgroup$
2
  • $\begingroup$ Thanks for the reply. The "attributes" tab is only available for Meshes, not curves ? $\endgroup$
    – gordie
    Apr 6, 2022 at 12:57
  • $\begingroup$ Yes. It looks like Attributes are a Mesh thing: docs.blender.org/manual/en/latest/modeling/meshes/properties/…. However, as a workaround, you could pass data values from one GN modifier to another using the Curve Tilt or Curve Radius, if you are not using those for other purposes? $\endgroup$
    – David Wood
    Apr 11, 2022 at 14:48

You must log in to answer this question.

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