6
$\begingroup$

I need to bake a part of my node tree via the bake node for an add-on. This requires a correct session_uid to press the button with Python.

An explicatory screenshot

I already tried bpy.data.node_groups["Geometry Nodes"].session_uid, which wasn't the same:

session_uid of the node group

$\endgroup$
3
  • $\begingroup$ Can you explain, how did you get the bake_id - to run bake operator? $\endgroup$ Commented May 18 at 21:37
  • $\begingroup$ Ok, got it in - obj.modifiers['GeometryNodes'].bakes[x].bake_id $\endgroup$ Commented May 18 at 21:54
  • $\begingroup$ So we got session_id, and bake_id - but how do we match them to bake_node? If there is only one bake_node, then we can use (sessionn_uid, obj.mods[].bake[0].bake_id), but what if we have multiple bake nodes - how to match them to proper obj.mods.bake[?].bake_id ? $\endgroup$ Commented May 19 at 12:44

1 Answer 1

7
$\begingroup$

You can get this id from the object:

bpy.context.active_object.id_data.session_uid
$\endgroup$

You must log in to answer this question.

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