fieldOfView / Cura-CustomJobPrefix

A Cura plugin that lets the user set a custom print job prefix
GNU Affero General Public License v3.0
24 stars 5 forks source link

Double Prefix on saving files since upgrade to latest #20

Closed PlasmaSoftUK closed 3 years ago

PlasmaSoftUK commented 4 years ago

I’ve just updated the plugin to the latest version, now when I save a file that already has a prefix on it, the extension is adding it again.

For example I have a the prefix on my printer set as “CR10S” and a file called "CR10S_Skull_Small30mm.3mf”, when I come to save the file the extension is now adding CR10S again so the file name is CR10S_CR10S_Skull_Small_30mm.3mf” this didn’t use to be the case with the old version.

I went in to the settings and re-Typed in the prefix of CR10S but it still happens, I’m using Cura under macOS Catalina.

fieldOfView commented 4 years ago

It is tricky for the plugin to find out what the original name without a prefix was. In your case, where the prefix is a fixed text and there is no postfix, the prefix could be easily removed, but you can imagine that it is harder when for example the current time at the time of slicing is part of the prefix or postfix, or when the prefix is changed after saving the project.

If you save a project with the new version installed, the plugin stores the original "base" name in the 3mf file so it can be restored when loading. This information is missing for previously saved projects.

In the next version I will see what I can do at a best effort basis to remove the prefix and postfix from the filename if the basename is not stored in the file. But it will not be 100% reliable.

PS: Thanks for opening an issue.

fieldOfView commented 3 years ago

This is already fixed for newly saved projects, but I can't fix this retroactively for previously saved projects.