grapefrukt / grapefrukt-export

a set of actionscript tools to export animations and graphic assets made in flash authoring to other formats.
197 stars 29 forks source link

FrameRate not Exported. #8

Closed IkonOne closed 11 years ago

IkonOne commented 11 years ago

The framerate is never exported, even when using:

Settings.defaultFramerate = -1

(Is it even possible to get the framerate of a MovieClip?)

grapefrukt commented 11 years ago

Framerate like other values won't be exported unless it's set to a non-default value, and, seeing as a single .swf only ever has one frame rate (that's available as a property on the stage btw), the only way to set a non-default framerate for either an Animation or a MultiframeBitmapTexture is to manually set the value on that specific object once it's been parsed.

If you want to explicitly export the framerate for everything, you can do this if you're using the "advanced" style export. Set the Settings.defaultFramerate to any other value (-1 might be a good choice) just before serializing the data, then the animations will differ from the default and be put into the xml.

Using the SpriteSheetAnimation example, replace the second to last block with this:

_queue.add(function():void {
    // by now, all the actual graphics are already output, but we still need to create the 
    // xml file that contains all the sheet data
    Logger.log("Main", "exporting sheet xml");
    // Set the default framerate to a different value than the already parsed one to make it appear in the export
    Settings.defaultFramerate = -1;
    _file_serializer.serialize("sheets.xml", _data_serializer.serialize(_textures));
});
IkonOne commented 11 years ago

My mistake. I was under the impression that the framerate set on the timeline was being exported. Thank you for the correction.