in advance.
I'm writing a script to change Z, for every control point in a bezier, so the final curve will have the same initial shape, but will follow a 'descending' path, from start to end.
Steps can be either constant or heights can be read from a list/array.
With the following code, I've been unable to get bpy.ops.curve.select_nth(), inside a loop, giving me the result I was expecting (as in each control point being selected, individually, in order to be translated)...
import bpy
segs = 5
height = 10
step = height / (segs + 1)
bpy.ops.curve.select_all()
bpy.ops.curve.subdivide(number_cuts=(segs - 1))
bpy.ops.curve.select_all()
for i in range(segs):
bpy.ops.curve.select_nth(nth=2)
bpy.ops.transform.translate(value=(0.0, 0.0, (step * i)))
Even outside the loop, it seems bpy.ops.curve.select_nth() does not work (or I'm missing something).
Any suggestion?