A new 'variable' domain for storing single values.
If I want to store a single value for later use, I currently have to store that identical value in every single point/edge/face etc, which uses a lot of memory, and is very slow to read/write.
I'm proposing a new 'variable' domain, so you would have: variable, Mesh, Curve, Grease Pencil and Point cloud. The variable element would be accessible to all domains in the geometry, and would only have a single row, so reading and writing to it would be instantaneous instead of the code having to traverse hundreds of thousands of sub elements needlessly when they're all storing the same value.
8 Comments
I would also love something like this. Currently I am storing the data on the point cloud domain since I am not using that. It works but it is clunky, and it involves splitting the geometry out at the beginning of each node network so that nodes that can't handle point clouds don't complain.
Something like this (storing named attributes on the object as a whole) would be incredibly useful for creating more complex stacks of node networks.
I agree. I often need something like this with the new hair system, where I use multiple geometry nodes modifiers and need a global variable that I can access anywhere in the stack. An example could be a factor that influences the general noisiness of the hair.
The "for each element" zone does exactly this; you get attributes as "single value" for each element
I don't know what you mean. There's a repeat zone and a simulation zone available only.
I don't want a single identical value stored in each element, I want a single value stored once in the geometry. So for example if I had a 1000 vertices, in my single geometry, I'd want the value storing once instead of the identical value storing a thousand time.
reduces memory, and the time taken to store/read the attribute.
You're right, there isn't yet; I think it's planned to be in 4.3. If I understand your need you might use a "geometry to instance node" at the end of your node tree and then store the attribute on the instance
Thanks. I just had a look at the for each element node. I could be misunderstanding, but It doesn't seem to address this proposal, it just allows you to loop over the each element. Putting a store named attribute inside of that would still store the single value inside every point.
Just to clarify, what I'm proposing is a new 'variable' domain in which single values can be stored. The variable element would only have a single row, so reading and writing to it would be instantaneous instead of having to traverse hundreds of thousands of points/faces/edges etc needlessly when they're all storing the identical value.
I'll update the proposal, I don't think I've been very clear.
Ok, that kind of domain sounds like an "object domain", since you don't want to store on any element of the geoemtry. I highly suggest to try the method I mentioned before, you woulod end up with just 1 element on which you can store the value. You can even use it in the shader editor via the instancer
Either once in the geometry, or once in the object would be fine 👍
I've used your suggested method previously, but I'm sure you'll agree the proposal is far simpler/more elegant and much better than a messy workaround 👍