Create blank metasprites for missing animations
@@ -122,6 +122,18 @@ export const detect = (
}
}
+ // Create blank metasprite for empty animations
+ for (const animation of animations) {
+ if (animation.frames.length === 0) {
+ const metasprite: Metasprite = {
+ id: uuid(),
+ tiles: [],
+ };
+ animation.frames.push(metasprite.id);
+ metasprites.push(metasprite);
+ }
+ }
+
const furthestX = Math.max.apply(
null,
metaspriteTiles.map((tile) => {
@@ -227,6 +239,18 @@ export const detectClassic = (spriteSheet: SpriteSheet): DetectedSprite => {
}
}
+ // Create blank metasprite for empty animations
+ for (const animation of animations) {
+ if (animation.frames.length === 0) {
+ const metasprite: Metasprite = {
+ id: uuid(),
+ tiles: [],
+ };
+ animation.frames.push(metasprite.id);
+ metasprites.push(metasprite);
+ }
+ }
+
const changes: Partial<SpriteSheet> = {
canvasWidth: 16,
canvasHeight: 16,
