UserFlows icon indicating copy to clipboard operation
UserFlows copied to clipboard

Connections in Exports

Open sonburn opened this issue 8 years ago • 2 comments

First of all, great plugin, thank you!

When exporting artboards from some files, like to Zeplin, the connections seem to somehow get picked up in the export as well. This only happens in some of my files, others work as expected. The connections group is non-modified, and hasn't been accidentally been brought into the artboard. I believe this has something to do with the file itself, which has been around for a while (from back in the day where each artboard had a checkbox to ignore/include anything above it). Does this sound realistic to you, and do you have any suggestion for how I might look under the hood to figure this out?

sonburn avatar Mar 23 '17 16:03 sonburn

@sonburn I looked at the example files you posted in the sketchplugins forum and found that for artboards which show this issue, the value for artboard.exportOptions().layerOptions() was 0. Changing that value to 2 will fix it. Im not sure what causes the export options to be set to 0 in some documents, but perhaps it has to do with older documents like you mentioned.

So to fix the problem in your faulty document, run this code in the custom script window:

var allArtboards = context.document.valueForKeyPath("[email protected]"),
    loop = allArtboards.objectEnumerator(), artboard;
while(artboard = loop.nextObject()) {
    artboard.exportOptions().setLayerOptions(2)
}

abynim avatar Mar 25 '17 12:03 abynim

Hmmmm.. looks like it breaks again when a new artboard is created. Probably makes sense to clean all artboards as part of redrawing connections so it always works as expected. I'll add this in an update later today.

abynim avatar Mar 25 '17 12:03 abynim