Hey everyone,
I’ve made a simple script operator that uses the closest point on a spline to determine the speed vector, and while it works perfectly it is incredibly slow even with very few particles (sub 1000). I’ve read through the “How to make it faster” portion of the help and done all I could to optimize this, but I’m curious if you MXS masters out there have any suggestions?
on ChannelsUsed pCont do
(
pCont.useSpeed = true
)
on Init pCont do
(
)
on Proceed pCont do
(
count = pCont.NumParticles()
for i in 1 to count do
(
pCont.particleIndex = i
pCont.particleSpeed = (pathTangent $Shape10 (nearestPathParam $Shape10 pCont.particlePosition)) * ((length pCont.particleSpeed) * .95)
)
)
on Release pCont do
(
)
Much appreciated! :bowdown:
