Skip to content
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

Added Incremental Saving #2386

Merged
merged 3 commits into from
Aug 29, 2024
Merged

Conversation

Azagwen
Copy link
Contributor

@Azagwen Azagwen commented Jun 16, 2024

This PR adds incremental saving, similar to what can be seen in Blender and Autodesk Maya.

electron_C324kLsoPc.mp4

This would be useful to keep past versions of a given project file, without having to set up boilerplate version control tools like Git.

Would close #2360

Copy link

netlify bot commented Jun 16, 2024

Deploy Preview for blockbench-dev ready!

Name Link
🔨 Latest commit 24ea9f3
🔍 Latest deploy log https://app.netlify.com/sites/blockbench-dev/deploys/66d0e9070abbd8000852db11
😎 Deploy Preview https://deploy-preview-2386--blockbench-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Azagwen
Copy link
Contributor Author

Azagwen commented Jun 16, 2024

At the moment this uses RegEx to isolate and add to the file name before .bbmodel, let me know if I should try another maybe more reliable or proper way

@Azagwen Azagwen changed the title added incremental Saving from added incremental Saving Jun 16, 2024
@Azagwen Azagwen changed the title added incremental Saving Added Incremental Saving Jun 16, 2024
@Azagwen
Copy link
Contributor Author

Azagwen commented Jun 16, 2024

an issue I found with the current ways this works; re-saving incrementally from a previous version overwrites versions above it
I could fix this by either:

  • changing it so that the version nb is based on the date & hour instead of a flat integer
  • checking if a file named the same exists in this spot, and saving a "bis" version if it does exist

Let me know your thoughts!

@Azagwen
Copy link
Contributor Author

Azagwen commented Jun 17, 2024

another thing; this doesn't seem to work on the web version, since there is no project path when editing in a web browser

@JannisX11
Copy link
Owner

I changed some things. I made the action only available when it'll actually do something useful. And I added a check for if the file already exists. I added a modification to the file name, since I think numbers are more intuitive than something like date or time in this case.

@JannisX11 JannisX11 merged commit 22082ba into JannisX11:next Aug 29, 2024
4 checks passed
@Azagwen
Copy link
Contributor Author

Azagwen commented Aug 30, 2024

Something I've been thinking of recently to complement this:
The interation number could be written to the saved file, this would technically fix web app not incrementing, and be a reliable way beyond just the file name to tell which iteration a given file is 🤔

@Azagwen
Copy link
Contributor Author

Azagwen commented Aug 30, 2024

I changed some things. I made the action only available when it'll actually do something useful. And I added a check for if the file already exists. I added a modification to the file name, since I think numbers are more intuitive than something like date or time in this case.

Nice! And yeah that makes sense, most other apps also only do this with a single number that gets incremented

@JannisX11
Copy link
Owner

Something I've been thinking of recently to complement this: The interation number could be written to the saved file, this would technically fix web app not incrementing, and be a reliable way beyond just the file name to tell which iteration a given file is 🤔

I think the file name is reliable enough for remembering the number, and it gives the user a way to manually tweak it without needing a UI for it. And I'm not concerned about the web app not having it. On the web app just pressing Save Project already pretty much does the same thing, at least unless you have file saving dialogs enabled in the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants