noouch
12-26-2007, 11:03 AM
I'm pretty new to scripting, and at the moment I'm trying to get particles to spiral relative to their age with a script operator.
It works when the script looks like this:
on ChannelsUsed pCont do
(
pCont.useTime = true
pCont.useSpeed = true
pCont.useAge = true
)
on Init pCont do
(
)
on Proceed pCont do
(
count = pCont.NumParticles()
frameMult = 10
circleRadius = 0.03
spiralMult = 0.0001
for i in 1 to count do
(
circleTimeIndex = currentTime.frame
pCont.particleIndex = i
pCont.particleAge = 1
pCont.particleSpeed = [(sin(circleTimeIndex*frameMult))*(circleRadius-((circleTimeIndex)*spiralMult)), 0, (cos(circleTimeIndex*frameMult))*(circleRadius-((circleTimeIndex)*spiralMult))]
)
)
on Release pCont do
(
)
except for the fact that i'm using absolute time instead of particle age to drive it.
But whenever I replace the currentTime.frame value of the variable circleTimeIndex with pCont.particleAge, the whole script stops working.
Any idea what i'm doing wrong here?
It works when the script looks like this:
on ChannelsUsed pCont do
(
pCont.useTime = true
pCont.useSpeed = true
pCont.useAge = true
)
on Init pCont do
(
)
on Proceed pCont do
(
count = pCont.NumParticles()
frameMult = 10
circleRadius = 0.03
spiralMult = 0.0001
for i in 1 to count do
(
circleTimeIndex = currentTime.frame
pCont.particleIndex = i
pCont.particleAge = 1
pCont.particleSpeed = [(sin(circleTimeIndex*frameMult))*(circleRadius-((circleTimeIndex)*spiralMult)), 0, (cos(circleTimeIndex*frameMult))*(circleRadius-((circleTimeIndex)*spiralMult))]
)
)
on Release pCont do
(
)
except for the fact that i'm using absolute time instead of particle age to drive it.
But whenever I replace the currentTime.frame value of the variable circleTimeIndex with pCont.particleAge, the whole script stops working.
Any idea what i'm doing wrong here?
