0
$\begingroup$

When i'm converting a poly type curve to a bezier type curve, the tilt of the vertices is dropped:

enter image description here

Am i doing something wrong?

$\endgroup$

2 Answers 2

0
$\begingroup$

The mesh data has no stored angles or quadratic regions for the Bezier angle to interpolate.

You can tell because all the quadratic regions are all flat and angled at rough directions, and they all have the same scale.

enter image description here

Unfortunately in this scenario it would be easier to remake the angle from scratch.

You already have the vertices in the right position because you converted it, now you just need to grab the region handles (the bars sticking out of the side of every vertex) and move them around until the angle matches your mesh.

$\endgroup$
2
  • $\begingroup$ I guess i didn't communicate correctly what i meant. I wasn't asking for the angle of the bezier handles. I was asking for the tilt angle (check the transform tab in the item tools panel). Also it's not a mesh i am converting, but a spline set to type "poly". So it is a spline already, i'm just changing the type. $\endgroup$
    – clawjelly
    Dec 22, 2021 at 14:12
  • $\begingroup$ You can edit the tilt of a spline vertex with the ctrl-t shortcut. $\endgroup$
    – clawjelly
    Dec 22, 2021 at 14:21
0
$\begingroup$

Alright, seems this is simply due to the fact that bezier spline points are defined differently than "normal" spline points. While both incorporate the tilt value, the conversion seems drop that value when moving from poly/nurbs to bezier.

Nevermind, i created a script that does it correctly:

def convert_to_bezier_with_tilt(obj):

    bpy.ops.object.mode_set(mode='OBJECT')
    bpy.ops.object.duplicate()
    data=bpy.context.active_object.data
    bpy.ops.object.mode_set(mode='EDIT')

    for spline in data.splines:
        if spline.type=="NURBS":
            bpy.ops.curve.select_all(action='DESELECT')
            spline.points[0].select=True
            bpy.ops.curve.spline_type_set(type='POLY')
        if spline.type=="POLY":
            bpy.ops.curve.select_all(action='DESELECT')
            spline.points[0].select=True
            tilts=[p.tilt for p in spline.points]
            bpy.ops.curve.spline_type_set(type='BEZIER')
            for pid, point in enumerate(spline.bezier_points):
                point.tilt=tilts[pid]
                point.handle_left_type="AUTO"
                point.handle_right_type="AUTO"

    bpy.ops.object.mode_set(mode='OBJECT')
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .