09-12-2019, 01:13 PM
Hey Tyson. Thanks for your answer.
I´ve tried to store the Shape ID and use it in the Birth Flow shape operator. It didn´t work. Shape distribution was not the same.
Figured out that there is an "off by 1" bug.
With this script it is working.
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
var shapeID = tf.GetCustomFloat(sInx, "shape");
shapeID = shapeID +1;
tf.SetCustomFloat(sInx, "shape",shapeID);
}
Is there a way to store the Shape ID in TyCache and use it later with BirthFlow?
Thank you.
I´ve tried to store the Shape ID and use it in the Birth Flow shape operator. It didn´t work. Shape distribution was not the same.
Figured out that there is an "off by 1" bug.
With this script it is working.
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
var shapeID = tf.GetCustomFloat(sInx, "shape");
shapeID = shapeID +1;
tf.SetCustomFloat(sInx, "shape",shapeID);
}
Is there a way to store the Shape ID in TyCache and use it later with BirthFlow?
Thank you.