-- Manu's Shape along path script -- Version 1.0 -- http://www.manueltausch.com pf = $PFSource endFrame = 250 fIncrement = 5 numPart = pf.numParticles() -- disableSceneRedraw() for i in 1 to numPart do ( newShape = splineShape() addNewSpline newShape newShape.name = ("ParticleSpline_" + i as string) newShape.thickness = 2 newShape.sides = 8 newShape.displayRenderSettings = False newShape.renderable = False newShape.displayRenderMesh = False newShape.adaptive = True newShape.wirecolor = [random 0 255, random 0 255, random 0 255] ) for t in 0 to (endFrame/fIncrement) do ( slidertime = (t* fIncrement) for i in 1 to numPart do ( pf.particleIndex = i pID = pf.particleID if t == 0 then ( if pID != 0 then ( particleSplineShape = execute ("$ParticleSpline_" + pID as string) addKnot particleSplineShape 1 #smooth #line pf.particlePosition ) ) else ( with animate on ( if pID != 0 then ( particleSplineShape = execute ("$ParticleSpline_" + pID as string) addKnot particleSplineShape 1 #smooth #line pf.particlePosition ) ) ) ) ) for i in 1 to numPart do ( pf.particleIndex = i pID = pf.particleID if pID != 0 then ( select (getNodeByName ("ParticleSpline_" + pID as string)) updateShape $ ) ) -- enableSceneRedraw() -- redrawViews() for i in 1 to numPart do ( myCyl = cylinder name:("cylinder_" + i as string) myCyl.sides = 8 myCyl.radius = 1.2 myCyl.height = 30 myHeight = myCyl.height myCyl.heightSegs = (myHeight / 2) tStart = 0 tEnd = 250 PD = SpacePathDeform() addModifier myCyl PD mySpline = execute ("$ParticleSpline_" + i as string) NS = Normalize_Spline() addModifier mySpline NS NS.length = 20.0 PD.path = mySpline myCyl.transform = mySpline.transform animate on ( at time tStart (PD.Percent_along_path = 0) at time tEnd (PD.Percent_along_path = 85) ) for k in myCyl.modifiers[1].percent_along_path.controller.keys do ( k.outTangentType = #linear ) )