You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Synfig may damage the project with exported values on save #3538
When we have a bunch of exported values in a project, Synfig may damage it when saving the project to disk. The reason for this is that the order of the nodes gets messed up and we get a bunch of "Unable to resolve" messages on loading the project.
In layers panel->Vertices (PATH)->Vertex 001->Vertex->Right click->Export Value...->Name: TEST->Export
Save the project under a different name
Menu->File->Revert and you get a bunch of "Unable to resolve TEST" messages
Reproducible since version 1.0.2.
My thoughts
This is a very serious issue because it leaves the project damaged and non-tech savvy users have no choice to seek help on the forum. Good thing that I finally was able to create a reproducible example but how did I get there? I honestly don't know.
I did the usual thing... You know, exported a bunch of nodes, made some converters, exported some more stuff in a nested manner to make Synfig fail but it all worked fine. I think the problem arrived after I unexported some nodes and then exported them again but I don't know if all that is relevant.
@Svarov-RZM, I think I may have found the cause of the bug.
I have noticed that after exporting a value to the project library and saving the file, the data of the exported value in the save file is at the end of <defs> tag. Like this:
I just moved the tag block <vector id="TEST"> ... </vector> to the beginning of the <defs> tag such that all the stuff that reference TEST is at the end. This change seems to load the file properly.
However, does this break anything? I respectfully request other maintainers to guide me on this so that I can do the code changes and submit a pull request.
It doesn't in case of this particular file. You got the cause of the bug right - the problem is that Synfig places TEST node below other ID's that reference this exact node, so after you place it above them you fix the issue.
I see that you linked a pull request that solves the problem. I am no developer, but I can at least test it on weekends to see if it breaks anything when saving other, more complicated projects.
I can at least test it on weekends to see if it breaks anything when saving other, more complicated projects.
Your testing would be greatly appreciated! While I did test the fix for the above linked file and it seemed to have worked fine, it’s always good to check for any unintended side effects in more complex projects. Let me know if you run into any issues, and thanks for taking the time to test it!
Activity
shreyaspranav commentedon Apr 1, 2025
@Svarov-RZM, I think I may have found the cause of the bug.
I have noticed that after exporting a value to the project library and saving the file, the data of the exported value in the save file is at the end of
<defs>tag. Like this:Assume the name of the exported value to be
TESTI just moved the tag block
<vector id="TEST"> ... </vector>to the beginning of the<defs>tag such that all the stuff that referenceTESTis at the end. This change seems to load the file properly.However, does this break anything? I respectfully request other maintainers to guide me on this so that I can do the code changes and submit a pull request.
fix: Fix bug displaying "Unable to resolve <val>" on project load.
fix: Fix bug displaying "Unable to resolve <val>" on project load
Svarov-RZM commentedon Apr 2, 2025
It doesn't in case of this particular file. You got the cause of the bug right - the problem is that Synfig places TEST node below other ID's that reference this exact node, so after you place it above them you fix the issue.
I see that you linked a pull request that solves the problem. I am no developer, but I can at least test it on weekends to see if it breaks anything when saving other, more complicated projects.
shreyaspranav commentedon Apr 2, 2025
Your testing would be greatly appreciated! While I did test the fix for the above linked file and it seemed to have worked fine, it’s always good to check for any unintended side effects in more complex projects. Let me know if you run into any issues, and thanks for taking the time to test it!
Best,
Shreyas.
fix: Fix bug displaying "Unable to resolve <val>" on project load (#3540