Hello Nate, Harald,
Can you guys provide or generate serialisation c# ( other languages ) classes for all your export settings?
Thanks, Marek.
Hello Nate, Harald,
Can you guys provide or generate serialisation c# ( other languages ) classes for all your export settings?
Thanks, Marek.
What would this be for? The export JSON is on the editor side of things, not the runtimes / game toolkits side.
We can use it to export via command line directly from the Unity. We have hundreds of spine projects and without our tool we would be lost in exporting and importing. Right now I have to write each Export Option class that you have in Spine Editor manually. And certainly that is prone to mistakes and it requires a lot of tweaking and testing. If I have classes from you ( I suppose that would be matter of few clicks ) then we can rely on that we have the latest parameters and options available in our tool.
Can Harald include it in Unity Runtime Editor scripta please?
I don't think this makes sense to include in the Spine Runtimes. This is more about tool integration with Spine. We're happy to help, just not by putting classes that represent the editor export settings into the Spine Runtimes.
I've prepared for you (Java) classes that represent the export settings data. This should be sufficient for your needs, but keep in mind the export settings format is subject to change (mostly additions but sometimes an option becomes obsolete and is removed/replaced).
abstract class ExportSettings {
String output;
}
class ExportJson extends ExportSettings {
String extension = ".json";
String format = "JSON";
boolean prettyPrint;
boolean nonessential = true;
boolean cleanUp;
@Null SpinePackerSettings packAtlas;
String packSource = "attachments"; // imagefolders, attachments
String packTarget = "single"; // perskeleton, single
boolean warnings = true;
String version = latestVersion;
}
class ExportBinary extends ExportSettings {
String extension = ".skel";
boolean nonessential;
boolean cleanUp;
@Null SpinePackerSettings packAtlas;
String packSource = "attachments"; // imagefolders, attachments
String packTarget = "single"; // perskeleton, single
boolean warnings = true;
}
/** Render export that doesn't support multiple frames within a single file. */
abstract class ExportRenderSettings extends ExportSettings {
String exportType;
ExportOption skeletonType;
String skeleton;
ExportOption animationType;
String animation;
ExportOption skinType;
boolean skinNone;
String skin;
boolean maxBounds;
boolean renderImages;
boolean renderBones;
boolean renderOthers;
boolean renderSelection;
float scale = 100;
int fitWidth;
int fitHeight;
boolean enlarge;
@Null Color background;
float fps;
boolean lastFrame;
float cropX;
float cropY;
int cropWidth;
int cropHeight;
int rangeStart = -1;
int rangeEnd = -1;
boolean pad;
int msaa;
int smoothing = 8;
}
/** Render export that supports multiple frames within a single file. */
abstract class ExportRenderSettingsMulti extends ExportRenderSettings {
ExportOutputType outputType;
}
abstract class ExportRenderSettingsMultiAnim extends ExportRenderSettingsMulti {
int animationRepeat = 1;
float animationPause;
}
class ExportApng extends ExportRenderSettingsMultiAnim {
int compression;
int repeat;
}
class ExportGif extends ExportRenderSettingsMultiAnim {
int colors;
float colorDither;
int alphaThreshold;
float alphaDither;
AlphaDitherType alphaDitherType = AlphaDitherType.pattern;
AlphaDitherOption alphaDitherOption = AlphaDitherOption.normal;
int quality;
boolean transparency;
int repeat;
}
abstract class ExportRenderPacked extends ExportRenderSettings {
SpinePackerSettings packAtlas;
}
class ExportJpeg extends ExportRenderSettings {
int quality;
}
class ExportPng extends ExportRenderPacked {
int compression;
}
abstract class ExportVideo extends ExportRenderSettingsMultiAnim {
String encoding = "";
int quality;
int compression;
boolean audio;
}
class ExportAvi extends ExportVideo {
}
class ExportMov extends ExportVideo {
}
class ExportPsd extends ExportRenderSettingsMulti {
String encoding = "";
int compression;
}
enum ExportOption {
all, separate, single, current;
}
enum ExportOutputType {
singleFile, filePerAnimation, filePerFrame, frame, layers;
}
enum AlphaDitherType {
diffusion, pattern, noise
}
enum AlphaDitherOption {
normal, compress, expand
}
class SpinePackerSettings {
boolean stripWhitespaceX = true;
boolean stripWhitespaceY = true;
boolean rotation = true;
boolean alias = true;
boolean ignoreBlankImages;
int alphaThreshold = 3;
int minWidth = 16;
int minHeight = 16;
int maxWidth = 2048;
int maxHeight = 2048;
boolean pot;
boolean multipleOfFour;
boolean square;
String outputFormat = "png";
float jpegQuality = 0.9f;
boolean premultiplyAlpha = true;
boolean bleed;
int bleedIterations = 2;
float[] scale = {1};
String[] scaleSuffix = {""};
Resampling[] scaleResampling = {Resampling.auto};
int paddingX = 2;
int paddingY = 2;
boolean edgePadding = true;
boolean duplicatePadding;
TextureFilter filterMin = TextureFilter.Nearest;
TextureFilter filterMag = TextureFilter.Nearest;
TextureWrap wrapX = TextureWrap.ClampToEdge;
TextureWrap wrapY = TextureWrap.ClampToEdge;
Format format = Format.RGBA8888;
String atlasExtension = ".atlas";
boolean combineSubdirectories;
boolean flattenPaths;
boolean useIndexes;
boolean debug;
boolean fast;
boolean limitMemory = true;
boolean currentProject = true;
Packing packing = Packing.rectangles;
boolean prettyPrint;
boolean legacyOutput;
}
@Null
means the field can be null.
Great. Thank you very much. Can this be part of your git hub please? So that we have access to latest version? I can possibly use some tooling and convert it to c# classes automatically on our side.
https://assetstore.unity.com/packages/tools/sprite-management/integrator-tool-2d-25491
IMO, that's too expensive.
I can give substantial discounts in special cases. :-)