I`m trying to snap the ends of a curve, to two points in space. However, I can't get past the fact that It requires worldspace input of a matrix instead of a vector. I've tried to convert worldspace to local, and backwards but its not my strongpoint.
Any ideas are more then welcome. Thank you!
import bpy from bpy import context, data, ops from mathutils import Euler, Matrix, Quaternion, Vector # Create bezier path. ops.curve.primitive_nurbs_path_add(enter_editmode=True) #ops.curve.subdivide(number_cuts=0) ops.transform.resize(value=(2.0, 2.0, 3.5)) ops.object.mode_set(mode='OBJECT') curve = context.active_object curve.name = 'line' # snap one end of curve to A other to B location_a = (1,1,0) # (XYZ) location_b = (2,2,0) # (XYZ) curve.data.splines.points.co = Vector(location_a) # error -> # Line 20 -> ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 4 items, not 3 ```