diff options
Diffstat (limited to 'embroider_input.py')
| -rw-r--r-- | embroider_input.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/embroider_input.py b/embroider_input.py index 39a0e424..e3a7b0c2 100644 --- a/embroider_input.py +++ b/embroider_input.py @@ -1,8 +1,9 @@ import sys +import os from libembroidery import * from inkex import etree import inkex -from inkstitch import PIXELS_PER_MM, _ +from inkstitch import PIXELS_PER_MM, INKSCAPE_LABEL, _ from inkstitch.stitch_plan import StitchPlan from inkstitch.svg import render_stitch_plan @@ -45,6 +46,11 @@ def main(embroidery_file): }) render_stitch_plan(svg, stitch_plan) + # rename the Stitch Plan layer so that it doesn't get overwritten by Embroider + layer = svg.find(".//*[@id='__inkstitch_stitch_plan__']") + layer.set(INKSCAPE_LABEL, os.path.basename(embroidery_file)) + layer.attrib.pop('id') + print etree.tostring(svg) if __name__ == '__main__': |
