Sprite Production Field Notes

sprite ai

Make an AI Reference Load Safe Between Two Sprite Editing Passes

A sprite repair script can open a palette or an AI reference halfway through processing the original character. A saved editor object does not necessarily keep pointing at that character. Cache the source identity as plain data and confirm the current document again before any mutating step.

An illustrative regression starts with a red actor file and a blue reference file of equal dimensions. Have the script read one value from the reference, then return to the actor and mark an intended pixel. Save copies of both documents to a clean test folder, reopen them, and confirm only the actor changed. Using the same dimensions makes it harder for an incorrect check to pass by relying on width. Compare stable file paths and a known pixel instead.

The technical guide and test fixture shows a LibreSprite 1.3 scripting proxy reading the newly active document after another file is opened, even though the variable referring to it was saved earlier. If a script cannot reliably switch back, split the read and write into two invocations. Pass only the palette or other immutable data between them and verify the receiving invocation starts with the expected actor.

Prepared by the FrameSprite Workflow Team with AI assistance. Examples are illustrative unless attributed to a linked fixture.