Remove duplicate cel script?

Hello, I am looking for a script that would remove any duplicate cels. Anyone know if one exists?

What specifically do you mean by removing duplicate cels? Within a frame, where different layers contain duplicate data? In a layer, perhaps converting them to linked cells instead? All across the image, potentially messing up the appearance of some frames?

I’m trying to import a sprite sheet then remove any frames that are identical. I would do it manually but I would be going through hundreds of frames for each sprite sheet that I want to process this way.

Ah, so you’re trying to remove duplicate frames, not cels. A cel is the intersection of a frame and a layer, a frame may be composed of multiple cels.

The next question is whether you want only consecutive duplicates removed (and have the durations for the remaining frames adjusted), or if you’re just looking to reduce your spritesheet to unique frames, with no consideration of how those frames are used in animation.

In the latter case, you could export your animation as a spritesheet with “Merge duplicates” checked. That’ll give you a spritesheet with only your unique frames. If you export the accompanying JSON as well, that will preserve your animations/tags (if any) and it will preserve the information about the different frames, except the frames will all point to the same spot in the spritesheet.

Exporting using merge duplicates did exactly what I was looking for. Thanks for the help!

1 Like