-
Automated position shift based on composition size
This one’s an easy one for any AExperts who know anything about expressions. Thanks in advance for your help!
I’m working with sprite sheets of varying widths based on how many characters they contain (comps at 30fps). I started out thinking the relative position between the frames in the sprite sheet would be the same (in this particular instance, 242px), so I used this:
posterizeTime(30);
x = (time / thisComp.frameDuration) * -242;
value + [x, 0]This worked great until I realized that the other sprite sheets that I would be getting would all be different in width, so I need a script to do the math based on the comp width in pixels and the total number of frames.
I used different variations of thisComp.Width and thisComp.duration, but seem to be missing something to complete the calculation – any suggestions?
Extra super thanks if you can tell me how to automate moving to the next row on the sprite sheet once I come to the rightmost frame!
posterizeTime(30);
x = (time / thisComp.frameDuration) * -242;
value + [x, 0]