-
Notifications
You must be signed in to change notification settings - Fork 293
Project recovery after Pencil2D crashes #1436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@chchwy Great news! Thank you for working on this. A recovery feature is certainly needed and one thing we discussed on discord a while ago among the many permutations of possible recovery methods was the following: In addition to your proposals outlined here which covers the cases related to files actually existing untouched by the OS or Pencil2D automatic removal, we discussed the necessity to add a direct file copy / backup functionality which would occur prior to opening the actual file making a carbon copy of the file in the state previous to starting the work session. Ideally this would make a copy, number it and allow Pencil2D users to have up to X number of copies handy to recover from unforeseen bugs and to cover the cases where all the files are wiped without trace or the PCLX files are "zeroed" out becoming a garbage file. These issues have been found to occur by a combination of the OS privacy & security handling, Pencil2D's unseen memory leaks and an interruption of the saving procedure. This was my proposal: This was @scribblemaniac 's proposal at the time (along some thoughts related to the actual implementation): In summary, and after some afterthought, while we've discussed auto save ideas for months we managed to settle that having backup files on the same folder was agreeable. If the user dislikes the idea of having extra packed or unpacked (PCL) backup files on the project folder (a la Blender), at most we could move it to APPDATA and keep the list of backups there so we can load them without issues. The reason I mention using the APPDATA folder as opposed to the TEMP which has the unpacked version of the working file during a work session is because this folder tends to be erased either by the OS or by the users and due to the privacy keepers in each Os getting more annoying, using that folder for recovery seems an inconvenient risk. Besides even though we now have a direct access to the TEMP folder, since there was also a conversation about moving settings to APPDATA in preparation for MyPaint brush configuration settings, there could also be a direct access to APPDATA via a similar button in case people want to explore the potential backups manually along other settings. |
|
Thanks @Jose-Moreno. I didn't know there is a proposal. It would be great to be written down somewhere (forum etc.) rather than buried in the discord chat history. I read both your proposal. They are great and I agree with most of the opinions. Many of your ideas have been in my mind for a long time. However, this PR is focusing on the recovery part. I will send more PRs sooner or later for the file-save things. |
|
This is a great step forward, I look forward seeing this merged.
|
|
Mmm...the layers should be renamed only when the |
|
@candyface I fixed the layer renaming issue |
|
Just found that Windows will clear the temp folder even if force closing the app by the task manager. So you will need an actual crash to test this feature on Windows. |
|
I'd have preferred if this was reviewed before merging. |
|
@scribblemaniac you can still review any code anytime if you like, I would appreciate it. I am trying to utilize my limited time and making progress. |
|
I agree with @scribblemaniac, let's try to keep the PR process and make sure things are reviewed and accepted by at least one before merging. You can still utilize your limited time but making progress should be a team effort. That's just my two cent. |
|
Right. I will follow next time. |
Try to restore the last unsaved project, usually because of Pencil2D crashes.
A recovery popup will show if the app finds any project files left in the temp folder.
There are two recovery modes:
main.xmland images (.png and .vec) are fine. In this case, just load the project up from the temp folder.main.xmlis broken. Then try to rebuild the main.xml based on the images left indatafolder, and then call mode 1. In this mode, the images are no way to be on the correct position anymore.Things need to do next but not included in this PR:
How to test:
main.xml