Preview a sheet import
Needs a key withsprites:read
Reads a sheet you uploaded without importing anything: its ground (clear, a key colour or neither), its grid (found from its gutters and the figures' spacing, or yours completed), the empty cells, frames per row, a suggested mapping of rows to actions and directions, what the master frame measures and warnings in plain words (mixed sizes, too many colours, feet off the baseline, figures cut off).
Requires scope sprites:read.
apiKeyx-api-key<token>An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.
application/json- body
characterId?stringThe character it would go to: its actions are offered. Left out: a new character's standard actions.
1 <= length <= 128gameId*string1 <= length <= 128grid?Your grid. Left out: it's found from the sheet.
image*An image you uploaded.
key?|The background colour to take out, as #rrggbb; null keeps every pixel. Left out: the sheet's own ground is found (a flat colour round its border).
masterFrom?The frame the master is made from. Left out: the first row's first frame for a new character, and the character's own master otherwise.
rows?array<>Your mapping so far, for its warnings. Left out: the suggested one.
items <= 32What the sheet is and how it would import.
application/json- response
actions*array<>The actions a row can be (the character's, or the standard ones).
background*The sheet's ground: clear (alpha), a flat colour (key, with its hex) or neither (none).
cells*integerCells in the grid.
directions*array<>Directions a row can be: the camera's drawn ones (left-facing ones are flipped on export).
emptyCells*array<integer>Cells with no figure, as row × cols + col.
grid*The grid, in sheet px.
height*integerkey*|The colour that would be taken out, or null.
measurements*What the sheet measures.
rowFrames*array<integer>Frames (cells with a figure) in each row.
rows*array<>The suggested mapping, a row each.
warnings*array<string>In plain words: mixed sizes, too many colours, feet off the baseline, figures cut off.
width*integercurl -X POST 'https://api.remagica.com/api/v1/sprites/imports/preview' \ -H 'Content-Type: application/json' \ -d '{ "gameId": "5c2a9e1d-7b3f-4a6e-8d0c-2f1e3a4b5c6d", "image": { "key": "uploads/org_123/5d1c…/frame.png" }}'{ "actions": [ { "key": "generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png", "name": "Autumn campaign" } ], "background": { "hex": "string", "kind": "alpha" }, "cells": 1, "directions": [ "E" ], "emptyCells": [ 1 ], "grid": { "cellH": 1, "cellW": 1, "cols": 1, "gapX": 1, "gapY": 1, "offsetX": 1, "offsetY": 1, "rows": 1 }, "height": 1280, "key": "generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png", "measurements": { "cell": [ 0, 0 ], "colourCount": 1, "feetRow": 1, "heightPx": 1, "palette": [ "string" ], "widthPx": 1 }, "rowFrames": [ 1 ], "rows": [ { "actionKey": "generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png", "actionName": "string", "direction": "E", "frames": 1, "row": 1 } ], "warnings": [ "string" ], "width": 1024}