Import asset
import_assetCopies a local image or sound file into a project's img or audio folder, detecting the real format from its file header and only replacing an existing asset when overwrite is enabled.
Instructions
Copy an image or sound file from this computer into the project: //.. source must be an absolute local path to a regular file (no relative paths, network/UNC shares, devices or symbolic links). The type is read from the file's header, never its extension: img/* folders take files with a PNG header (max 32 MiB; only the signature + IHDR is checked, not the whole image), audio/* folders take files whose header is Ogg (OggS) or ISO-BMFF/M4A (ftyp) (max 128 MiB; only the header is checked, not the codec or the full file); the extension (.png, .ogg, .m4a) is chosen from the detected header. name defaults to the source file name without its extension and must be 1-64 characters from A-Z a-z 0-9 space _ ! $ ( ) - (no dots, no path); a '$' prefix on a character sheet means one character per sheet, '!' means no offset. An existing file with the same name (letter case ignored) is only replaced with overwrite: true; the session backup (list_backups / restore_backup) keeps the file as it was before this server session first touched it (until set_project is called again, which starts the snapshots over), so a file that was itself created or changed earlier in the same session has no backup of that intermediate version. Nothing is converted or resized; warnings flag sheet sizes that do not fit the folder's layout, and for audio a missing sibling format (MV's web build needs both .ogg and .m4a). Refused while a changeset is open (binary files cannot be staged): commit or discard it first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | File name without extension; defaults to the source's base name | |
| folder | Yes | Destination asset folder, e.g. img/characters or audio/bgm | |
| source | Yes | Absolute path of the file to import, e.g. C:\art\Hero.png or /home/me/art/Hero.png | |
| overwrite | No | Replace an existing file with this name |