Supports Spine atlas with paths as file name

This commit is contained in:
fgnm
2022-05-21 10:16:01 +02:00
parent 93b58b1ef7
commit f986aecbce
3 changed files with 4 additions and 1 deletions
@@ -11,6 +11,7 @@ import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.regex.Matcher;
/** Unpacks a texture atlas into individual image files.
* @author Geert Konijnendijk
@@ -98,6 +99,7 @@ public class TextureUnpacker {
// check if the parent directories of this image file exist and create them if not
File imgOutput;
region.name = region.name.replaceAll("/", Matcher.quoteReplacement("$"));
if (prefix != null) {
imgOutput = new File(outputDirFile,
String.format("%s%s.%s", prefix, region.index == -1 ? region.name : region.name + "_" + region.index, extension));
@@ -184,6 +184,7 @@ public class SpineAsset extends Asset {
for (JsonValue slotEntry = skinMap.getChild("attachments"); slotEntry != null; slotEntry = slotEntry.next) {
for (JsonValue entry = slotEntry.child; entry != null; entry = entry.next) {
String name = spineName + entry.getString("name", entry.name);
name = name.replaceAll("/", Matcher.quoteReplacement("$"));
deleteSingleImage(resolutionName, name);
projectManager.deleteRegionFromPack(projectManager.getCurrentProjectInfoVO().animationsPacks, name);
}