5
$\begingroup$

I have a GN node tree with an output value as a float.

enter image description here

Blender tells me the path to it, which is great. And i got...if i execute it...an "x" ...umpf.

Hoped for a value. How do i get the value?

$\endgroup$
4

1 Answer 1

7
$\begingroup$

You need to refer to the object attributes, so if the attribute is a vector you can do:

obj = bpy.context.object.evaluated_get(bpy.context.evaluated_depsgraph_get()).data

obj.attributes[0].data[0].vector

You might need to adjust the indexes for your attributes.

$\endgroup$
3
  • 2
    $\begingroup$ Hi! Is there a systematic way of chasing this kind of information down, or is it just something you have to know?, and is there a way of guaranteeing the index? e.g finding index for name? $\endgroup$
    – Robin Betts
    Commented Jan 12, 2022 at 13:58
  • 2
    $\begingroup$ Hi. This is somewhat explained here: <b3d.interplanety.org/en/…> $\endgroup$ Commented Jan 12, 2022 at 16:03
  • 1
    $\begingroup$ Thank you! Good source :) $\endgroup$
    – Robin Betts
    Commented Jan 12, 2022 at 16:13

You must log in to answer this question.

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