Looping particle positions
#6
(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. 
  Reply


Messages In This Thread
Looping particle positions - by moonjam - 04-24-2019, 11:31 AM
RE: Looping particle positions - by alexgiel - 04-24-2019, 01:07 PM
RE: Looping particle positions - by moonjam - 04-24-2019, 03:05 PM
RE: Looping particle positions - by tyFlow - 04-25-2019, 05:38 AM
RE: Looping particle positions - by insertmesh - 05-15-2019, 10:43 AM
RE: Looping particle positions - by chromodome - 05-16-2019, 12:37 PM
RE: Looping particle positions - by insertmesh - 05-16-2019, 03:20 PM
RE: Looping particle positions - by chromodome - 05-17-2019, 03:53 PM
RE: Looping particle positions - by insertmesh - 05-17-2019, 08:37 PM
RE: Looping particle positions - by tyFlow - 05-17-2019, 10:37 PM
RE: Looping particle positions - by chromodome - 05-18-2019, 12:16 AM
RE: Looping particle positions - by tyFlow - 05-18-2019, 02:52 AM
RE: Looping particle positions - by tyFlow - 05-20-2019, 04:17 AM
RE: Looping particle positions - by insertmesh - 05-20-2019, 08:21 AM
RE: Looping particle positions - by Pflow - 01-28-2020, 11:17 PM

Forum Jump: