tyFlow Forum
Set SimIndex to EventIndex - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: General Discussion (https://forum.tyflow.com/forum-2.html)
+--- Thread: Set SimIndex to EventIndex (/thread-2870.html)



Set SimIndex to EventIndex - coresmith - 01-23-2022

Hi,
Is there a way to change particle SimIndex to the EventIndex (Order of entering the event)?
Thank you

Maybe I approached it wrong.
I am trying to morph particles from one object to another based on the objects' vertices numbers with SurfaceTest and FindTarget Operators.
IMAGE:: https://drive.google.com/file/d/17uMZbcX-IbAs9UgYQ6NfgEbTpc6vDPrT/view?usp=sharing

I use a script that I found with a FindTarget operator:

//Here is a sample script showing how to modify particles in this event:
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
tf.SetCustomVector(sInx, "target1", obj001.GetVert(sInx));
tf.SetCustomVector(sInx, "target2", obj002.GetVert(sInx));
tf.SetCustomVector(sInx, "target3", obj003.GetVert(sInx));
tf.SetCustomVector(sInx, "target4", obj004.GetVert(sInx));
tf.SetCustomVector(sInx, "target5", obj005.GetVert(sInx));
}

But it sends particles based on SimIndex. Problem is that I want to change the order of particles to be sent based on the SurfaceTest Operator.
How can I do that?