Creatide / AnimateMate

Create your animations directly in Sketch using AnimateMate.
http://AnimateMate.com
MIT License
1.33k stars 78 forks source link

Export scaling doesn't work after Sketch 41 #21

Open niittymaa opened 8 years ago

niittymaa commented 8 years ago

It seems that scaling in export dialog is broken after Sketch 41 update.

Problem was caused MSExportRequest command and I guess it's changed in Sketch 41 API.

var scaleSlice = [MSExportRequest requestWithRect:utils.artboardRect scale:scaleValue];
utils.doc.saveArtboardOrSlice_toFile_(scaleSlice, fileName);

I disabled it for fast fix for 41+ versions until I found how it works now. Anyone have idea how it should be now?

alpower commented 7 years ago

Looks like they now define the export scaling options when exporting pages or artboards

function onExportArtboards(context) {
    var sketch = context.api()
    var options = { "scales" : "1, 2, 3", "formats" : "png, jpg" }
    sketch.selectedDocument.selectedPage.exportArtboards(options)
};

...I guess you would have to amend how you export things to achieve this.

see http://developer.sketchapp.com/examples/plugins/exporting/

niittymaa commented 7 years ago

Thanks @alpower for pointing this one!

alpower commented 7 years ago

No problem! A lot of people use things like InvisionApp at 2X for prototyping on retina screens, so being able to export at 2X sure would be handy, for doing things like GIFs for more complex transitions.

...Love the tool so far otherwise - really great!