grapefrukt/grapefrukt-export

Duplication of assets

Opened this issue · 1 comments

Due to the direct coupling between Textures and Animation Parts there is duplication of texture assets when assets are reused. We have for instance a scene with multiple butterflies that use the same sprite sheet animation. For each butterfly in the scene the exporter will create a separate animation texturesheet. This is hugely wasteful especially for big animation sheets.

Is this something you have run into or something you plan to do something about?

I'm not really using this library anymore, so I don't expect getting back to working on it.

If you want to start picking things apart yourself, the animation frames are merged into sheets here and the code that runs is here.

I also have an experimental de-duper for sheet packing, but once you have enough textures it may become unreasonable to do this in actionscript.

It would definitely be possible to hijack the call to the MultiFrameUtil and compare it to previously merged animations to avoid re-exporting the same thing over and over.