diff --git a/Exporter.exe b/Exporter.exe index b818c2a..96c6dda 100755 --- a/Exporter.exe +++ b/Exporter.exe Binary files differ diff --git a/Exporter.exe b/Exporter.exe index b818c2a..96c6dda 100755 --- a/Exporter.exe +++ b/Exporter.exe Binary files differ diff --git a/Exporter.swf b/Exporter.swf index a249f37..ba2b0f3 100644 --- a/Exporter.swf +++ b/Exporter.swf Binary files differ diff --git a/Exporter.exe b/Exporter.exe index b818c2a..96c6dda 100755 --- a/Exporter.exe +++ b/Exporter.exe Binary files differ diff --git a/Exporter.swf b/Exporter.swf index a249f37..ba2b0f3 100644 --- a/Exporter.swf +++ b/Exporter.swf Binary files differ diff --git a/GraphicExportDef.as b/GraphicExportDef.as index 2e4b25b..f3454a0 100755 --- a/GraphicExportDef.as +++ b/GraphicExportDef.as @@ -15,6 +15,9 @@ private var _exportType:int = 1; public function get exportType():int { return _exportType; } + private var _className:String = null; + public function get className():String { return _className; } + private var _name:String = null; public function get name():String { return _name; } @@ -40,13 +43,17 @@ { this.parentJob = parentJob; this.index = index; - if (!details.hasOwnProperty("type") || !details.hasOwnProperty("name") || !details.hasOwnProperty("input")) + if (!details.hasOwnProperty("type") || + !details.hasOwnProperty("name") || + !details.hasOwnProperty("input") || + !details.hasOwnProperty("class_name")) { - Fail("graphic export is missing a required name, type, or input"); + Fail("graphic export is missing a required class_name, name, type, or input"); return; } _exportType = parseInt(details.type); _name = "" + details.name; + _className = "" + details.class_name; input = Base64.decode("" + details.input); _padding = details.hasOwnProperty("padding") ? parseInt(details.padding) : 0; _scale = details.hasOwnProperty("scale") ? parseFloat(details.scale) : 1; @@ -78,17 +85,17 @@ { try { - var classDef = e.target.applicationDomain.getDefinition(name); + var classDef = e.target.applicationDomain.getDefinition(className); if (classDef == null) { - Fail("didn't contain a definition for " + name); + Fail("didn't contain a definition for " + className); return; } var clip = new classDef(); if (!(clip is MovieClip)) { - Fail(name + " wasn't a movieclip"); + Fail(className + " wasn't a movieclip"); } Utils.RecursivelyStop(clip); diff --git a/Exporter.exe b/Exporter.exe index b818c2a..96c6dda 100755 --- a/Exporter.exe +++ b/Exporter.exe Binary files differ diff --git a/Exporter.swf b/Exporter.swf index a249f37..ba2b0f3 100644 --- a/Exporter.swf +++ b/Exporter.swf Binary files differ diff --git a/GraphicExportDef.as b/GraphicExportDef.as index 2e4b25b..f3454a0 100755 --- a/GraphicExportDef.as +++ b/GraphicExportDef.as @@ -15,6 +15,9 @@ private var _exportType:int = 1; public function get exportType():int { return _exportType; } + private var _className:String = null; + public function get className():String { return _className; } + private var _name:String = null; public function get name():String { return _name; } @@ -40,13 +43,17 @@ { this.parentJob = parentJob; this.index = index; - if (!details.hasOwnProperty("type") || !details.hasOwnProperty("name") || !details.hasOwnProperty("input")) + if (!details.hasOwnProperty("type") || + !details.hasOwnProperty("name") || + !details.hasOwnProperty("input") || + !details.hasOwnProperty("class_name")) { - Fail("graphic export is missing a required name, type, or input"); + Fail("graphic export is missing a required class_name, name, type, or input"); return; } _exportType = parseInt(details.type); _name = "" + details.name; + _className = "" + details.class_name; input = Base64.decode("" + details.input); _padding = details.hasOwnProperty("padding") ? parseInt(details.padding) : 0; _scale = details.hasOwnProperty("scale") ? parseFloat(details.scale) : 1; @@ -78,17 +85,17 @@ { try { - var classDef = e.target.applicationDomain.getDefinition(name); + var classDef = e.target.applicationDomain.getDefinition(className); if (classDef == null) { - Fail("didn't contain a definition for " + name); + Fail("didn't contain a definition for " + className); return; } var clip = new classDef(); if (!(clip is MovieClip)) { - Fail(name + " wasn't a movieclip"); + Fail(className + " wasn't a movieclip"); } Utils.RecursivelyStop(clip); diff --git a/job.py b/job.py index 619ff79..989c991 100644 --- a/job.py +++ b/job.py @@ -14,7 +14,9 @@ "properties":{ "swf":{"type":"string"}, "type":{"type":"number","default":1}, - "scale":{"type":"number","default":1} + "scale":{"type":"number","default":1}, + "class_name":{"type":"string"}, + "name":{"type":"string"} }, "required":["swf"] } @@ -79,16 +81,18 @@ f.write(pretty_dumps(graphic_and_asset)) else: with open(os.path.join(base_path, self.name + ".asset"), "w") as f: - f.write(json.pretty_dumps(data)) + f.write(pretty_dumps(data)) for name,details in data.iteritems(): with open(os.path.join(base_path, name + ".graphic"), "w") as f: - f.write(json.pretty_dumps(details)) + f.write(pretty_dumps({"data":self.name + ".asset"})) class Graphic: def __init__(self, folder, json): self.json = json if "name" not in json: json["name"] = os.path.splitext(os.path.split(json["swf"])[1])[0] + if "class_name" not in json: + json["class_name"] = json["name"] self.swf_path = os.path.join(folder, json["swf"]) json.pop("swf") with open(self.swf_path, mode="rb") as f: