05-17-2019, 03:53 PM
(05-16-2019, 03:20 PM)insertmesh Wrote: Thanks man, how did I not get this right? I added and deleted brackets left and right but apparently I missed the right combo...
This works!
Well...somewhat...
It only works as long as the target shapes transforms end within the time the particles are in the same event as the script. As soon as the particles move to the next event, the tm seems to not be updated anymore and I can´t just copy the script op.
It also doesn´t work on deforming meshes, for that we probably need some more help...
Yes it does not work on deforming meshes, but for the event thing, just execute the script again without the localTM.
The localTM is only calculated on frame 0, the worldTM is updated on every frame of the event (multiplying localTM - which is fixed - by the obj TM - which keeps changing).
In the next event just call the same class functions and set the worldTM again, then get it back using custom properties.
So, for example you can in another event do just 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
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)
}
}
and use a custom properties in that event to GET the custom TM and put "worldTM" in the channel box
For the deforming mesh it's trickier and i'm trying to wrap my head around it still.