FashionFreedom / Seamly2D

Open source patternmaking software to democratize fashion.
https://seamly.io
GNU General Public License v3.0
574 stars 108 forks source link

BUG: с переменными #1135

Open Tzenzikk opened 2 weeks ago

Tzenzikk commented 2 weeks ago

После создания переменной и присвоения ей формулы она всё считает, но как только нажимаешь обновить или пытаешься использовать эту переменную, то выскакивает ошибка. Скриншот приложил.

DSCaskey commented 1 week ago

There is no screenshot attached so I'm not sure where you're having an issue. I just added a custom variable, set it to 40mm, and used it in a formula and it works fine.

image

Screenshot 2024-07-04 115513

If you know the varianle name you can just type it in a formula field, otherwise you can click the FX button to open the Formula editor... from there you can select Custom Variables and select a variabe from the list to add to the formula. When you click OK it updates the formula in the tool dialog.

Screenshot 2024-07-04 120421

Tzenzikk commented 1 week ago

Hello! I recorded a video of the problem. Video by link: https://disk.yandex.ru/i/iQSrDADDL1ZI0g I'm waiting for a comment!

DSCaskey commented 1 week ago

Hello! I recorded a video of the problem.

Thank you for the video. Now I understand the issue. This is a known limitation of the Variables Tables, in that the variables are parsed in the pattern before any tools. If you reference a tool's line length for example... when you click Refresh, the pattern is reparsed and the custom variable referencing the line length is reset to 0 as the tool has not been created yet so there is no value. In other words Custom Variables are limited to using measurements, functions, or other custom variables as long as they appear in the table list before the one you're editing a formula for.

For example: This is OK Screenshot 2024-07-06 091018

This is not: image

Hope this makes sense. At some point I need to figure out how to disable the tool variables in the FX Editor when entering a Custom Variable formula.

Tzenzikk commented 1 week ago

Thanks for the reply. But I didn't understand, will this be improved in the next versions?