0
$\begingroup$

Note: I reported bug on this but they replied this is not a bug. Then following this logic I think there should be some ways to resolve this that I don't know. I would like to ask for help in blender stack exchange. I just try to paste the content from the bug report.

I made the attribute with label 'aa' and and the sum of the face area of each geometry. I wanted to reuse their attribute values collectively from another new node tree by creating the collection info. However, I cannot get the value from the instance "mode" but it only produces the corresponding values in "points mode" even if I specified them in "instance mode". It looks this is a bug

Exact steps for others to reproduce the error

  1. generate individually for each geometry a geonode to calculate the sum of its area
  2. store the attribute as name 'aa' with the stored named attribute
  3. and connect the sum attribute('aa') to the group output labelled as 'area'
  4. create the new node with collection info to try to reuse the 'aa'(sum of area of each node)
  5. try to get the value from the mode of instance but failed. It can only be retrieved with the mode of points!

enter image description here However, I use the "Realize Instances" node and I can show the value in "points" but this is not what I wanted.

enter image description here The individual geometry "cube" is to show how the setting is made for "instances mode" so I checked it with ticks to show I selected the adequate nodes with instance mode.

enter image description here I removed the "Realize Instances", I still cannot get the thing right. It still shows the value for 'aa' is 0 by the viewer.

$\endgroup$
5
  • $\begingroup$ "Realize Instances" node converts instances to "real" geometry. There can't be any instances after this node, because they are all supposed to be realized. This is not a bug. $\endgroup$ Oct 8, 2023 at 18:14
  • $\begingroup$ I understand this but I remove the "Realize Instances", I still cannot get the thing right. It still show the value for 'aa' is 0. However, I use the "Realize Instances" and I can show the value in "points" but this is not what I wanted. $\endgroup$
    – Patrick
    Oct 8, 2023 at 18:31
  • $\begingroup$ Your screenshots don't show this aa being 0, your .blend file also doesn't show this. $\endgroup$ Oct 8, 2023 at 19:19
  • $\begingroup$ Sorry that it is a little bit confusing and it is also the tricky point perhaps I need to further explain. The second screenshot is the individual geometry "cube" to show how the setting is made for "instances mode" so I checked it with a tick. The first screenshot is the problematic situation I encountered that even all settings are "instanced" orientated, the viewer still shows nothing or zero in the instances row. Thus, I made a question mark to show the problem. Hope you can understand this issue. I really feel this is a bug after reviewing a few times!! $\endgroup$
    – Patrick
    Oct 9, 2023 at 2:12
  • $\begingroup$ After reviewing the comment again, I added a third screenshot to show how the viewer display "0" for all instances. In this setting, the "Realize Instance" has been already muted. $\endgroup$
    – Patrick
    Oct 9, 2023 at 2:23

2 Answers 2

1
$\begingroup$

generate individually for each geometry a geonode to calculate the sum of its area

this is a bad error reproduction instruction, because it's too vague. Instructions how to reproduce an error shouldn't be subject to interpretation. Maybe you think the .blend file serves as a specific example, but sometimes it may be unclear which elements were specifically added to the starting project (e.g. if you have a different default template or did something not clearly visible like parenting...)

On your 1st screenshot you capture an integer attribute, but never use it, therefore the node has no meaning and can be removed. Then you capture named attribute aa as an anonymous copy, realize instances and read it. Perhaps you expect to read it before the instances were realized, but that's not how attributes work:

What Does Capture Attribute Add to Geometry

If you have good understanding of geonodes, and there indeed is an error (I don't see one), then ideally you would take two steps (two sides of a green link), presented the geometry data in the form of a table like I did in the answer linked, one table per each step, and then also the 3rd table describing what you expect either step to be instead.

It seems what is your problem is that you expect the attribute in point domain, to travel up into the instance domain, when you convert geometry to an instance. This doesn't happen automatically. The only time when something similar happens, is when you use "Instance on Points" node, but then the attribute is copied from a spawning point to an instance, not from instance's geometry to instance. Below I capture instance index, realize geometry, delete every former instance's point except the first, then the indices of instances to realized points map one-to-one and the data can be moved onto the instances:

$\endgroup$
3
  • $\begingroup$ Thank you for teaching me many things. That is very valuable. However, if I want to sort out the geometry with the maximum face area among all, what I can do to achieve this task? $\endgroup$
    – Patrick
    Oct 9, 2023 at 13:10
  • $\begingroup$ Using the above setup, you can use Attribute Statistic node to find the maximum value of an attribute, and then you can use that attribute with a comparison node to delete all points /instances with another value. If you use points, they already have former index captured, so you can still access this captured index after real indices get reduced to a single integer $0$ due to deletion. And this captured index is the index of the instance that had the maximum attribute. $\endgroup$ Oct 9, 2023 at 20:28
  • $\begingroup$ Thank You Markus! I spent a few days on this and eventually get thro' via your solution although I am not quite satisfied that the instancer is so limited that it is hard to convert the face domain into instance domain even if the counting is matched for the index. $\endgroup$
    – Patrick
    Oct 10, 2023 at 18:47
2
$\begingroup$

I'm not sure if I understand correctly what you want to do: do you need the separate face areas of each individual object in the GN nodetree on the "Circle" object or do you just want to calculate the area sum of all objects in the collection?

If the latter, there is no need to calculate them individually with separate GN on each object. Just realize the instances from the Collection Info node, plug a Face Area node into the Attribute Statistic node and take the Sum.

If you want to keep the objects as instances, just plug them directly (without the detour through the Realize Instances node) into a Group Output or Store Named Attribute node or whatever you want to do with it:

face area of collection

If you want them altogether as if it was a joined object, you can even disable Separate Children on the Collection Info node which makes all objects a single instance:

single instance

The good thing about this method is, you can always add objects to the collection and their area will automatically be added to the face area without the need to put another GN nodes modifier on them to calculate their individual face area:

adding Suzanne

$\endgroup$
3
  • $\begingroup$ Thanks for your suggestion. Actually, I wanted to calculate the maximum face area among all the geometries and sort the one out with the maximum value and do some operations on it but up to now, unfortunately, I can't something similar that could accomplish this task. $\endgroup$
    – Patrick
    Oct 9, 2023 at 13:07
  • $\begingroup$ @Patrick Okay, I'm sorry I have no solution for that right now. But honestly, sorting out the one with the maximum value is nowhere stated in your question. If you would tell what you really want, maybe somenone would find a way to do it even if it is not based on what you've started with. $\endgroup$ Oct 9, 2023 at 13:17
  • 1
    $\begingroup$ That's very kind of you. I just worked and stuck at this stage before I can go further for the sorting so I just publish the work for discussion. I thought this a bug. Anyway, thank you for your reply. $\endgroup$
    – Patrick
    Oct 9, 2023 at 13:24

You must log in to answer this question.

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