ID:2787704
 
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
When editing overlays, it's often easier for artists to export DMIs as a sheet. Opening a DMI file in any image editing software will actually show the entire sprite as a single sheet.

Unfortunately, saving your edits will destroy the metadata stored in the ztxt block that defines how icon_states and their animations work.

We can use PNG tools like tweakpng to jam that metadata back in by coping it from another dmi that shares the same structure, but it really feels like this functionality should be baked into Dream Maker.

Import sheet:

A new command should be added to the Graphic menu of Dream Maker that would allow you to import a sprite sheet over the top of an existing icon. Any image data that is currently present in the file will be overwritten by the selected sheet file. The icon's size may or may not be allowed to change during this import process, but it should preserve the metadata and frame structure of icons.

Export sheet would also be a useful option to export the entire icon, even though just loading a DMI file does the same thing. Just strip the metadata. Having this exposed directly will clue users into the fact that this functionality exists, and working with sprite sheets is possible in DM.

Import metadata:

A new command should be added to the Graphic menu for DMI files, which will duplicate the state/frame data and animation delays from a selected DMI file into the current file. Any metadata currently in the icon will be lost in the process. Any existing frames will be jammed into the imported structure in order. An icon size can be specified if the current file has zero frames. Otherwise, it will use the current canvas size of the icon file instead of the metadata source file's icon size.

Command Line:

It would also be useful to be able to do this from the command line. DM.exe should get a new command line argument that would take a source icon, a source sheet, and a destination (folder or file) to write/overwrite.

This would make automated builds of entire folders of formatted sprite sheets easier for developers with the chops to write batch files.

Command line format:
dm.exe -makedmi "sprites/herp/derp.png" "graphics/herp/base.dmi" "graphics/generated/herp.dmi"
Can you elaborate on the command line request a bit? In this case, derp.png is essentially a DMI file without metadata---tiled by states, dirs, frames---and base.dmi is a stub DMI with the metadata defining the states, etc?

tl;dr you just want to take the zTXt from base.dmi and put it in derp.png to produce herp.dmi?
Yep. Just want the built-in tools to take the ztxt out of base, grab the imagedata with the png, and output a dmi with both.

I can already do this with third party tools, but it feels like something the engine should give the developer tools to do.
I second this, would be extremely useful. Vscode also has an extension that's able to read dmi files and there's a sprite sheet importer on byond from 2012, it really feels like this should be something byond can just do at this point
In response to Crystalwarrior160
Do you have a link the sprite sheet importer?


EDIT: Nvm, found it.