05-16-2019, 12:37 PM
(05-15-2019, 10:43 AM)insertmesh Wrote: trying to implement this in my flow, but I´m getting some errors:
try this:
Code:
public void simulationStep()
{
for (int i = 0; i < eventParticleCount; i++) //this for-loop iterates through all particles in this event
{
int sInx = tf.GetSimIndex(i); //for each event particle, we fetch its simulation index
if (tf.GetEventAge(sInx) == 0)
{
tf.SetCustomTM(sInx, "localTM", tf.GetTM(sInx) * Inverse(obj001.GetTM())); //when particles are born, save their initial offset from the object transform
}
tf.SetCustomTM(sInx, "worldTM", tf.GetCustomTM(sInx, "localTM") * obj001.GetTM()); //continuously update the worldTM channel with the saved localTM x the object's currentTM (ie, the updated TM)
}
}
There was a missing closed bracket in this line tf.SetCustomTM(sInx, "localTM", tf.GetTM(sInx) * Inverse(obj001.GetTM())) -- should have 3x ")" at the end.