Help please. I want to add geometry nodes using Python.
I assume/guess the steps are
Create a primitive
bpy.ops.mesh.primitive_plane_add()Add a new geometry node
bpy.ops.node.new_geometry_nodes_modifier()Add the node I want
from_node = bpy.ops.node.add_node(use_transform=True, type="GeometryNodeCurveArc")Connect the new node to the output
to_node = nodes["Group Output"] links.new(from_node.outputs["Curve"], to_node.inputs["Geometry"])Start using the node
Needless to say, this does not work. What, please, is the correct code?
RuntimeError: Operator bpy.ops.node.add_node.poll() failed, context is incorrect
bpy.ops. [...]). See this q. $\endgroup$