I have the following code which creates two Bezier curves which share a control point:
import bpy
def CreateBezier(cp1, cp2):
bpy.ops.curve.primitive_bezier_curve_add(enter_editmode=True, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
bpy.context.object.data.resolution_u = 10
bpy.context.object.data.bevel_resolution = 0
bpy.context.object.data.bevel_depth = 0.06
points = bpy.context.active_object.data.splines[0].bezier_points
SetBezierSplinePoint(points[0], cp1)
SetBezierSplinePoint(points[1], cp2)
bpy.ops.object.editmode_toggle()
def SetBezierSplinePoint(point, cp):
point.co = cp["co"]
point.handle_left = cp["handle_left"]
point.handle_right = cp["handle_right"]
point.tilt = cp["tilt"]
cp1 = {"co" : (0,0,0), "handle_left" : (-.5,0,0), "handle_right" : (.5,0,0), "tilt" : 0}
cp2 = {"co" : (1,1,.5),"handle_left" : (1,.5,0), "handle_right" : (1,1.5,0),"tilt" : 0}
cp3 = {"co" : (2,.5,0.5),"handle_left" : (2,2.1,.4),"handle_right" : (2,1.9,.6),"tilt" : 0}
CreateBezier(cp1, cp2)
CreateBezier(cp2, cp3)
The problem is where both bezier curves meet - the "tilt" is different between them:
Is it possible to programmatically match the tilt of the first curve when creating the second?