Valentina 2 Seamly Converter Script

Yesterday Gemini and me did a little marathon to set up a script that converts Valentina files into Seamly files. This is because I have a lot of old patterns made in Valentina and I did not want to reconstruct them all in Seamly.

After 45 versions, we got to the point where the script converts all the files I tried without Seamly crashing.

It is clear that this is a stub and far from perfect, but it converts at least the construction, which is the most elaborate part.

So here is the python script for anyone who may want to use it. It gets rid of pattern pieces and only converts the construction, but that was fine for me.

Konverter.py (6.3 KB)

4 Likes

Nice, @Buggi - I’m happy that you haven’t lost any of your files :blush:

1 Like

Seamly wil still open and convert any Valentina patterns from val ver 0.6.0 and before. After that the schemas diverge and become less compatible.

3 Likes

I found several issues when trying to convert a 0.6.1 val file…

    1. Minor - The output file is not being written as proper XML… opening and saving in Seamly will format file correctly.

    1. Even though the pattern file had an attached measurement file, the conversion is requesting the hard coded Helena.vit from the script.

      image

    1. Also can’t read German:

      But upon translating not quite sure what the info means: “Spline attributes have been protected, and intersection points corrected.”

    1. The output is not implicitly writing the <images/> tags in the correct order after the <groups> which can cause issues with the file crashing if the app writes the missing <images/> tags before the <groups>.

      Needs to be:

2 Likes

Seamly wil still open and convert any Valentina patterns from val ver 0.6.0 and before. After that the schemas diverge and become less compatible.

I know, but my files are all much newer, as I opened them all in newer Valentina versions which saved them in >0.8 version Format. So no chance to open them in Seamly.

This was because I had the issue that Seamly did not ask for the pattern file sometimes and then all formulas were not recognized. We then implemented a measurement file name no one has to force Seamly to ask for the file, but Gemini renamed that while we were working on a pattern for a dress I made for my daughter Helena :wink:

This is Ai, it always wants to tell that it corrected the last errors that showed up. As I am lazy,I did the whole conversation in German, so all output is also in German.

Thanks for this input, I will try to prompt that to Gemini so it may get corrected.

1 Like

Thanks, I need to rework them and newly set up the pattern pieces, but this is still far better than constructing the whole thing again in Seamly.

One of them is a jacket constructed in the Haka/ Müller & Sohn System which is fairly complicated.

2 Likes

What difference would there be if you actually used the measurement file name in the pattern vs a made up file name? Of course if the pattern doesn’t use a measurement file Seamly is not going to ask if you want to use another file if it can’t find it. The point is the message box is should supply the name of the file it’s looking for, not some made up file name.

It’s not a last error. Its a hardcoded info message box that always shows that text

messagebox.showinfo("v45", "Spline-Attribute wurden geschützt und Kreuzungspunkte korrigiert.")

And again… I’m still not sure what it means?

Yeah… this one surpised us too when we added the images. The orginal dev did not write all the (empty) tags out, and when we added the <images> it could get written before the <groups> breaking the schema. :roll_eyes: We fixed it within a week, but we’re still getting users reporting issues with patterns with the two tags in reverse order 9+ months later. :frowning:

BTW adding

 ET.indent(new_tree)  # Adds indentation for readability (Python 3.9+)

here will fix the xml output.

2 Likes

Thanks Douglas, I was unclear on this. In every of the 45 versions, gemini fixed an import error and hardcoded the last one in the script. So this was the last error fixed from version 44 to version 45 :slight_smile:

You can completely disregard this, in a final version, nothing like that should show up.

Will be adressed in the next round!

It could be used, would imho be the best solution, if the absence of a measurement file is detected and then a made up file is inserted to work around that error. Good point! Will try to get Gemini to implement it.

3 Likes