yes, I’ve been trying but I’m still a graphic artist and no programmer - A little hint pls, script is attached:
I have got a spritesheet (see screenshot) that I need to convert to a regular image sequence.
- Manually input rows + columns - 21 x 3 in this case
- Crop comp size
- Set position keyframe
- Go to next frame, re-position
- loop 4. until end of frames (in my case the last 2 frames would be empty, I would crop this manually)
I made it until setting keyframes while doing (i guess) nested loops for moving through the matrix.
Thx for your help!
Spritesheet to Frames.zip (2.4 KB)
Hi @thepetercoin , nice work!
I changed your automation a bit:
- you don’t need to loop over the items in the project the get the active comp, you can just create an item variable and select custom and then “active composition”.
- I changed the duration of the comp to the duration of the number of frames (frame time * number of frames), the frame time is 1 second / frame-rate.
- I added a loop that loops over the layers in the active comp and moves the anchor point to the top left (0,0) so it will be easier to modify the position, we can just subtract the width/height of the comp to move it by frames dimensions.
- then I have added a loop custom amount of times, that runs over the number of rows, and on each row loop cycle it runs another loop that goes through the columns in this row. in the rows loop we each time calculates the new y position for the next lines of images, and in the columns loop we calculates the x position of the current row, and we combine them to add a keyframe to the position.
Download (updated to fix a bug) -
Spritesheet to Frames v2.zip (3.4 KB)
Please let me know if you have any questions,
THANK YOU VERY MUCH!
One thing I needed to change tough: It stopped moving in x after the 2nd column. Now the position X value is reset when it jumps to the next row. Working. Saving me massive amounts of time. Hopefully also other people.
Spritesheet to Frames v3.zip (3.9 KB)
@thepetercoin , Sorry about that, I actually updated the post and fixed this issue earlier but if you downloaded it from the initial mail, you probably got the old version, anyways great job for fixing it by yourself!