Notifications
Clear all

[Closed] Path constraint applied on specific objects

I need to adapt the following code, that instead of creating new objects called YellowPoint_ use the objects that are already created in the scene called Point_
Thank you!

function createPoints pointArray = (
	for i = 1 to pointArray.count do (
		p = Point name:(uniquename "YellowPoint_" ) p.wirecolor = color 255 225 0 
			p.size = 0.1
				p.cross = off
					p.Box = on

		a = p.pos.controller = Path_Constraint path:$Spline p.pos.controller.constantVel = off
		b = a.percent.controller = float_script()
		c = a.percent.controller.script = ("nearestPathParam $Spline $" + pointArray[i].name + ".pos steps: 1000")
	)
)
createPoints ($Point_???_Bn)

Instead of creating new nulls with path constraint, I want to apply path constraint on objects named Point_ that were already in the scene.

test scene.max (724 KB)

the solution is here: