I add Geometry Nodes to the default Cube but instead of using its geometry I use a Curve Line:
How to get this Curve Line data with
bpy
?
I've tried the following and failed:
bpy.context.object.data.splines
- raises ValueError, because the initial object type is Mesh which doesn't havesplines
attribute.ob = bpy.context.object.evaluated_get(bpy.context.evaluated_depsgraph_get())
andob.data.splines
- raises the same Error- in
bpy.context.evaluated_depsgraph_get()
I could not find anything related to the object special types, except instances
For this particular example the data can be partially obtained by accessing bpy.data.node_groups['Geometry Nodes'].nodes['Curve Line'].inputs
, but if the curve has further processing e.g. resampling with Resample Curve, offsetting points locations with Set Position node and Noise Texture, randomizing, converting to mesh, processing and converting back to curve, etc. - it becomes harder and harder to track and reproduce in Python the final data of the curve in this way. So is there a way to get this data directly?
By the data I mean points locations, tilt, radius, handle types and handle points location, etc.