I wanted to create a tool that would allow users to be able to save a version of the mesh they are working on and be able to revert to that saved version if they feel they made a big mistake without worrying about losing progress.
Disclaimer: While not for the whole project, ChatGPT was used to help with parts I was having trouble understanding/implementing, as I am still new to Python scripting.
Before I wanted to get into programming the tool and what it can do, I decided to start with the UI so that I had a template to work off of when and have a decent layout for the tool.
Now, programming the tool itself, this chunk of code allows for the saving of the mesh that you are working on, as long as it is currently selected. It saves the mesh by duplicating and placing the mesh in a hidden group, and adds the name of the mesh to the text scroll list. It records the name of the mesh, so to keep organized, use naming conventions!
I was able to get help through GPT with understanding how the code works for naming conventions.
The most important part of the tool, the Revision, is, in this code, checking whether or not the version/name of the saved in the scroll list I selected or clicked on is a different version than the mesh that is currently selected, or if there is anything selected.
Finally, we get to the cleaning-up part. This portion of the script allows for the asset you selected to revert to delete it from the world and replace it with the saved version. After deleting the original mesh, it brings out the saved version from the hidden group and places it into the world, making it visible. It also gives the users the ability to, if they save a duplicate of the same version of the mesh, delete the duplicate save from the scroll list.
I did use ChatGPT to help me with getting the replacement mesh and placing it in the world working.
The final version of the tool is designed straightforwardly and simply that can be adjusted by stretching the edges. It is capable of saving multiple different assets and reverting to their previous versions. I plan to continue working on this tool, adding features like mesh exporting.