Le he hecho unas cuantas modificaciones para que soporte un número de puntos arbitrario.
Código:
fn attachShapeToPoints points = (
theShape = SplineShape()
addNewSpline theShape
for i = 1 to points.count do (
addknot theShape 1 #corner #line points[i].pos
)
updateShape theShape
local ctrlSource = "target.pos * (inverse owner.transform)"
animateVertex theShape #all
for i = 0 to (points.count - 1) do (
local ctrl = Point3_Script()
ctrl.addNode "target" points[i + 1]
ctrl.addNode "owner" theShape
ctrl.script = ctrlSource
ctrl.update()
theShape[4][8][i * 3 + 2].controller = ctrl
)
-- Comentar estas dos líneas si no se quiere congelar la spline
theShape.showFrozenInGray = false
freeze theShape
OK
)
Por ejemplo puedes hacer que se cree una spline con todos los helpers de tipo "Point" que tengas en la escena:
Código:
attachShapeToPoints $Point*
Saludos.
PD: he hecho que la spline se congele para que la manipulación de los puntos sea más sencilla.