Macroscript freespline category:howto truco:freespline. (Local old_pos. Local new_spline. Local second_knot_set.
Fn get_mouse_pues pen_pues old_pen_pues =
(.
If old_pues == undefined then old_pues = old_pen_pos.
If distance pen_pues old_pues > 10 then.
If second_knot_set then.
Addknot new_spline 1 #smooth #curve pen_pos.
Else.
Setknotpoint new_spline 1 2 pen_pos.
Second_knot_set = true).
Old_pues = pen_pos.
Updateshape new_spline.
) - End if.
) - End Fn.
Fn draw_new_line old_pen_pues =
(.
Pickpoint mousemovecallback:#(get_mouse_pos, old_pen_pos)).
Undo free Spline on.
New_spline = splineshape ().
Old_pen_pues = pickpoint ().
If old_pen_pues == #rightclick then.
Deleete new_spline).
Else.
Select new_spline.
New_spline, pues = old_pen_pos.
Addnewspline new_spline.
Addknot new_spline 1 #smooth #curve old_pen_pos.
Addknot new_spline 1 #smooth #curve old_pen_pos.
Second_knot_set = false.
Draw_new_line old_pen_pos.
Que = querybox close Spline? Title:free Spline.
If que then.
Close new_spline 1.
Updateshape new_spline).
Select new_spline.
)--end else.
)--end undo.
)--end script.