Storing particle positions


#1

Hi, hope someone can help, I’ve done a forum search but couldn’t find what I was looking for. Pretty sure there’s a simple solution using a script or some simple ADM. Here’s what I’m trying to achieve:

I have a ‘pixelated’ world map (flat on plane) made up of loads of cubes in a grid. This was generated using Birth Texture, a black and white world map bitmap, and choosing vertices/edges.

I want this position of the cubes to be the last frame. So, they’ll all start off scattered off somewhere, or maybe come in a bit like this Particle SKull vid: https://vimeo.com/110292438

Either way, I need to find a way of storing the first position, as I believe I can then use Find Target with ‘By Script Vector’ ?

I did some digging and found a tutorial where the guy mentioned a script by Allan Mckay, which I cannot find anywhere. I copied the code line by line, form the video, but it did’t seem to do anything.

I then tried to make a data operator: Particles (Closest particle position) => Output Standard (Script Float) - thinking that might give me some kind of position data, but no luck there either.

I’ve attached the max file, with my failed script attempts. Any help would be greatly appreciated, but please bear in mind I’m a novice at ADM and scripting. Max file and texture attached :slight_smile:


#2

Hey Olly. I would create a 2nd system and use a Initial State to ‘save’ the particles position (and keep it there forever). Then you can store this position to an Output New (with a Data Operator) and, inside a 3rd system, you can can get this position data using an Input New + Proxy System.

Then you just have to send this position to a Script Vector and use it on the find target.

Just did a small example. Let me know if you have any doubts on it:
http://goo.gl/htYgGe

Btw, couldn’t open your 2015 file. Next time it would be better if you save it on some other versions as well, at least 2014 :wink:

Best,

Alvaro


#3

Cheers Alvaro,

Much appreciated. In one of my failed attempts I did try to use Initial state, but didn’t know how to capture the positions. To be honest I don’t really understand the proxy system. The initial state grabs the position form PF1, then the data op stores the actual position. Then, is the data operator in PF3 calling on PF2 in someway… is it basically saying ‘use the particles from PF2, but as a proxy, and pass the vector info on as a script vector’?

My friend Zoubein also gave me a solution that used a data operator to capture the position. I was on the right tracks! I can’t attach the max file as it’s over 322kb (tiny limit!) but here’s a grab of the flow, which I’ve had to zip because the max limit for a jpeg is 97k…

Thanks again for your help, it’s really helping me understand these data operators too!


#4

Cool :slight_smile:

About the Initial State, I think that only data that it will always get is the position. So you dont have to worry about it.

About the Proxy System, i’m not sure why doesn’t work without it. In my opinion, if it’s storing the position on the 2nd system and i’m able to open that information on the 3rd one, it should work. However it only works if you specify that system with the proxy option. :shrug:

Then you’re right. It wright the position information into a script data and pass it to the Find Target.

I would recomend you to create a dropbox account! Store stuff here is pretty limited.