# Animation nodes - sorted group transformation

Let's say i have a 5x5x5 group of cubes, my goal is to have them all sorted from top to bottom, scaling down to a set size one by one with about a frame of delay between each cube, after scaling they then move to a set location with the same order and delay

I attempted to create this effect using animation nodes by running a group list (containing the objects) through two "sort list" nodes, sorting by x location and z location. Creating the scaling effect was successful using a loop subprogram, but once I attempted to have the objects translate from point A (the original positions of the individual objects) to point B (set location to converge on) it seems as though their changing location interfered with the initial sorting nodes and causes them to move very irregularly, even continuing to move when I pause the timeline.

Any help with correcting my method or another method of achieving this affect would be greatly appreciated. I am new to using animation nodes and my knowledge of it is very limited, but I'm excited to hear what you have to say and to learn more about it. If any of my explanation needs clarification im happy to answer any questions

• why are you not use object instancer? Are your cubes different? – Crantisz Jan 19 '18 at 10:35

## 1 Answer

You can sort objects by using AN tools menu in T Tools tab:

Select all cubes, then in index panel press sort, and setup sort method. After this the objects will get unique integer value, that you can use in sort node. To copy this id, press RMB on this value slider and chose copy data path.

And paste this data path in sort list, after "e"

Also you should try use initial transforms, that can be used similar way.

• Thanks so much! looks like this is the exact solution I needed, I forgot to specify in my op that the cubes do differ in texture and some in proportion, but it looks the copy data path function is exactly what I was missing – OptimusRhymes Jan 19 '18 at 18:58
• @OptimusRhymes Don't thank in the comments, this site works best if you upvote the answer (but now you don't have enough reputation). If it solved your problem consider making it as accepted. blender.stackexchange.com/help/someone-answers – Crantisz Jan 19 '18 at 18:59