Store named attribute to use it on another part of the node tree

Hello,

I have tried everything up to my knowledge on how to store one value at some point of the node tree and reuse it on another part of the same node tree, but I have been failing hard (not sure if it is possible tho).

Here is a glimpse of the whole node tree:

As you notice in the node tree, these noodles are bugging me (aesthetically only):

My logic says that I can store the value produced by this node (zooming in) in a Store Named Attirbute node and then use a Named Attribute node somewhere else to avoid having those noodles crossing the node tree.

Am I totally wrong here or maybe there is something that I’m missing.

uhm…how should we now…we cannot read any of your nodes…sorry

You are right sorry, that happens when you are way too many hours on something so it makes sense only to myself :sweat_smile:

On the whole node tree, I’m zooming in on the part that produces the value I want to store, which is the Y on the Separate XYZ node.

And my idea is to store that Y value on a Store Named Attribute and use it somewhere else.

Well, yes, yes. Have you acted upon that idea ? because you have to know… it will work !

Well, no :sweat_smile:.
I have a simplify version where I’m storing the Y value, but cannot be used on something else.
Note, I know that the Store Named Attribute output socket has to be connected but then the bounding box will be visible which I don’t want.

This does not work for two reasons :

  1. the attribute “my_value” does not exist on the cone geometry. If you wanted to transfer it, you’d have to use a sample index node (or some other way of transferring an attribute between two geometries)
  2. there are no geometry fields, so you can’t generate many primitives at once. See this page for an explainer around “fields” https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/fields.html#index-0

To solve your actual problem I’d need to know what you’re trying to make and how.

That was what I was thinking.

On my original setup I have been using sample indexes and any other node. The only reason I’m asking is to avoid having to cross some noodles across the whole node tree to destination, so I was thinking on using the Store Named Attribute as a “portal” to use the value stored on that node somewhere else.

I hope this answer your questions.

If both the source and the target are part of the same node tree, then no, there is no way to have a “cordless” link between them for transferring an attribute. Portal nodes have been proposed as a way to avoid clutter, but so far they were not implemented.

1 Like

Just a suggestion… reorganize your node-tree into node-groups… Since you are producing a “single value” you can have multiple copies of the Group Input node…

e.g.:
Feed in the value


and use it wherever:

…remember to set the Single Value option:
image

Here I’m also prefixing the node-group name with a full stop (.) to ensure it isn’t visible in the Add → Group menu.

Hope that helps.

4 Likes

Now that you mention it, I have a vage memory of some talkings aboit it. Hopefully it will revisited at some point.

Thank you for the tip, I think I will be able to manage with that :+1:

1 Like