Copying UVs from one single PRT to the full PRT sequence

Hi,

I am trying to get some UV coordinates onto Naiad exported fluids. I took a single frame from the exported Naiad PRT sequence and applied a magma modifier to get UVs from a plane. I then took the full sequence and attempted to copy the UVs across so that they would “stick” with each particle. Problem is that Naiad doesn’t have your regular PRT Index channel but it does have a Particle-ID channel that I am attempting to use. At the moment I am not really having any success, would you mind looking at my Magmas and see if I have it correctly setup? If it’s properly setup then I know it has something to do with the Naiad ID channel but maybe I made a mistake in my magma flow when copying the texture coordinates across?


This is the magma flow I used to get the texture coordinates from a single frame of the PRT sequence. (This Part works)


This is my attempt at copying the texture coordinates across using the Naiad exported ID channel. (This doesn’t work, it doesn’t produce an error but the render is garbled)

Thanks in advance!

Tobbe

When you debug the ID channel, does it look correct?

Hi Tobbe,

Currently this case cannot be solved with Magma, because the particle access operators use the Index channel and there is no way to access a particle by ID.
The Index channel ALWAYS exists in Magma, it is the implicit counter of the main loop. It is generated automatically and always goes from 0 to N-1 where N is the particle count on the current frame. The Particle operators expect to know the Index of the particle to access, but you need to find the particle with the matching ID to keep a value consistent over time.

In other words, we would have to add an operator that, given a known ID and a particle system returns the correct Index so you can pass that to the ParticleQuery operator to read the right data. So if you are on frame 10 and Index 42 and the ID is 12345, but on frame 1 the particle with ID 12345 has Index of 3, you need to pass 12345 to an operator to get 3 back. Then you can pass that result to the query.

Your setup could work only if all particles exist on all frames and their order never changes (so the Index list and the ID list are always matching). This is a special case that can exist, but I don’t expect it to apply to your situation.

Right now your only (very slow!) solution would be scripting.

Thanks for your explanation!

I was looking at some old Stoke sims (my license ran out on June 30) and I noticed that since I am emitting from the texture coordinates, the particles get the texture coordinates. So using Stoke I could advect particles through the fluid sim and get UVs from another object (in my case it would be a meshed version of the first frame of the liquid simulation). Chalk that up to another great use for Stoke!