6
$\begingroup$

Transferring data between different objects in Geometry nodes

I know we can use the Object info node to get the geometry data from another object and use the geometry data but what about a specific data field.

img1

Example: I'm trying to transfer the float data of the inner radius of object 1 to object 2 outer radius

Data to be taken from object 1 (inner hole radius).

img2

Data to be transferred to object 2 (Outer hole radius).

img3

What I've tried.

I can see the rt_rad attribute created

img4

But how do I get the second object to access the Named Attribute. A link seems to be missing.

img5

Attached file.

$\endgroup$
4
  • 2
    $\begingroup$ You store the value with Store Named Attribute in the first node tree, and read it in the second node tree with Named Attribute. This way you can use the attributes of other objects. $\endgroup$
    – quellenform
    Nov 1, 2022 at 9:51
  • $\begingroup$ I can see the rt_rad attribute created. But how do I get the Named Attribute node to access it in the second object? A link seems to be missing....I also added images. $\endgroup$
    – Rick T
    Nov 1, 2022 at 12:11
  • $\begingroup$ How did you get geonodes working in Blender 2.79? ;) $\endgroup$ Nov 1, 2022 at 12:24
  • 1
    $\begingroup$ @MarkusvonBroady lol is the 2.79 comment because of my color scheme :-D $\endgroup$
    – Rick T
    Nov 1, 2022 at 12:27

2 Answers 2

5
$\begingroup$

When you create a new geometry using "Primitive" nodes, you're asked for values describing those objects, like a cylinder radius. Those are single, constant values, because each such node is creating a single object, for which only a single value makes sense: a cylinder has only one radius.

However, you try to transfer that value from an attribute array, which stores multiple values, one for each element of the attribute's domain. In order to get just one, you can use an attribute statistic node:

With this technique, typically it doesn't matter if you use min, max, mean or average output of the Attribute Statistic node. However in your case you're joining multiple geometries, some without the named attribute, which then is set to default 0 upon joining - so I decided to use the max.

$\endgroup$
2
  • $\begingroup$ Thanks geometry nodes keeps blowing my mind. With this ability I can now make sets of bolts, nuts, and washes that will be 3D printing ready just by changing one value. WOW! $\endgroup$
    – Rick T
    Nov 1, 2022 at 13:18
  • 1
    $\begingroup$ it is better to use the "Sample Index"-Node instead of "Attribute statistics", see my solution below $\endgroup$
    – Andy
    Jan 31 at 14:08
4
$\begingroup$

You don't need to use the Attribute Statistics-Node to retrieve a named attribute of different objects like Markus von Broady suggested.

1. Accessing attributes with Geometry-Nodes

Actually it is better to use the "Sample Index"-Node instead as shown in figure below, cause it does no aggregation-calculations on the whole domain, which can be pretty large.

Named Attribute on Cube used on Cylinder

Store an attribute on Cube

2. Accessing attributes with Python

If you need to retrieve the value of the named attribute in your Python script you have to do it via the evaluated object in conjunction with its dependency graph :

enter image description here

$\endgroup$
3
  • 2
    $\begingroup$ You're correct, I think Sample Index didn't exist back in 2022... $\endgroup$ Jan 31 at 16:48
  • $\begingroup$ but actually very clever and creative workaround with statistics node ;-) ... $\endgroup$
    – Andy
    Jan 31 at 16:52
  • $\begingroup$ I even have a proof I already knew about Sample Index in 2023 :D blender.stackexchange.com/a/296337/60486 $\endgroup$ Jan 31 at 17:11

You must log in to answer this question.

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