-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
2021.01 - Export filename not remembered #3649
Comments
I was about to agree with you because this sounds like a regression as you describe it. But I think the issue being resolved there was involving multi-tab editing, where the last export ends up pretty inappropriate as a starting point if you switch tabs. So it's not as simple as reverting that change. To restore the old behavior without adding weirdness for tabbed editing, I think it would need to track last export in some manner that can stay associated with the tabbed windows. |
This is annoying as I added the original code to remember it and I don't use tabs as most things don't make sense with them. |
I don't see any problem tracking that per tab, that seems to be the most useful way to do it anyway. |
I'm glad to see this is flagged as a bug and added to the the possible Bugfix Release. From looking at the above mentioned change (#3029) it looks (to me) that the culprit here is the call to activeEditor->filepath (lines 2972-2975). I pulled that entire part out and put back the code from the 2019-05 release (path = path_it->second;) and it seems (so far) to work as it did. This isn't a total fix, just a hack so I don't have to revert to the 2019-05 release. The final code looks like this:
|
I've done research in the algorithm that suggests export paths and filenames and also played with the behavior of the application. To make sure i'm in the right page i'll first take down the existing algorithm and then suggest another one (built on top of it) that hopefully covers better the requirements. Existing algorithmWhen exporting an .scad file to a suffix (.stl, .obj etc.): For the path
For the basename
At the end
State
Proposed algorithmIntroduce a seperate suffix->path map data structure for each tab open in the editor ( So, again, when a exporting an .scad file to a suffix (.stl, .obj etc).
Thoughts ? |
I only rarely use multiple tabs for multiple projects, and so hadn't noticed that the current behavior surprises me: I expected that when I export a Your proposal would improve that; at least if I'd exported from a particular tab it would go where I expected when I came back to that tab. However, I don't think that falling back to a central "sticky" registry is right. I think that what I do for exports in one tab should not affect what I do in another tab. That is, if I open So I would suggest a modification, dropping out the central registry.
There may reasonably be people who want to have all of their
People like me who put the People who want to collect their People who want to do something special for this project would have to select the alternate location once per session, but thereafter it would be sticky for that tab. The basename remains as you say: same as the |
Sounds good.
Clarifying basename:
Does this look ok ? |
I suspect that the path and the base name discussions can be kept independent, and that's probably best. I don't have a strong feeling on the question you ask - but the key thing is that you're not proposing to change it, right? |
Sorry, it's been so long since I commented on this issue, so I'm going to be a little behind on this. First I don't use multiple tabs. If I'm working on multiple projects I use separate instances of OpenSCAD. The description above is actually describing the issue, not the solution. If I change the file name to Check how the 2019-05 release handles this - that's the expected behaviour. The reason this is important is for parameterized scad files. I have a scad that creates custom funnels and nozzles. If I'm using it to create a funnel, I want to keep calling the STL funnel-something.stl. Not FunnelNozzleMaker.stl. If I tweak a setting in the customizer it's annoying as hell to keep having to change the name of the exported file back form FunnelNozzleMaker.stl to Funnel-something.stl. If I'm creating multiple sized objects using the parameter settings then I'm going to want the export window to show what my last export filename was. This is what 2019-05 did and it worked perfectly. Your changes would not address this. The name associated with the STL export should be attached to the structure keeping track of the file tab. You have to keep details for the current tab tracked somewhere for saving/reading/updating/parameters/code trace/etc. so just attach the STL export file name to that same tab tracking structure and use the same algorithm that you used in the 2019-05 release just with that new variable from within the tab tracking structure. The only change here should be just the name of the variable itself from a single "global" value to one connected to the active tab. There's not an issue with the 2019-05 algorithm, the issue how the new multi-tab system was implemented in it. |
I don't have a strong feeling about whether the export file name should be sticky (as you request). But it does seem like the path and basename questions can be addressed independently, especially since there are proposals floating around for having the OpenSCAD program suggest the basename. |
I agree. We can address the proposed path and basename aspects independently. Path comes first. Modify existing mechanism so that it suggests a sensible export path in a per-tab fashion. Having this in place will also provide some flexibility to reusing last export filename. It will be in the proposed directory and user will just have to click on the previously exported filename to re-use it. That's just a one click away trip. As a second iteration on the issue we can tweak the proposed basename behavior which will be easy. Even in the existing algorithm the full path including the last used filename is kept internally. In the end, this is an "Export filename not remembered" issue. So, moving forward i plan to implement the per-tab algorithm as suggested by @jordanbrown0 above:
For the preferences, i was thinking to utilize this preference group: I'm just wondering whether it makes sense (a) to just add a single export directory override (for all suffixes) or (b) have a list of them i.e. a different textbox for each suffix. I think (a) is better. Adds a degree of flexibility but is easier to implement and easier to maintain. |
The "Advanced" tab is getting overfull; it might be appropriate to add a new "Export" tab. But that can be done at any time. |
… ref openscad#3649 * Use previous export path for this suffix and tab if available. * Fallback to "defaultExportDir" preference. * If this is not available either use same path as .scad file. * Fallback to system wide setting if .scad has not been saved yet.
In 2019.05, when exporting it remembers the filename used and presents it again on the next export.
e.g.
Open file
Some fantastic design.scad
File/Export
, the pre-filled filename isSome fantastic design.stl
,edit that to
Some fantastic design-with-2021-01-a.stl
, save.File/Export
, the pre-filled filename isSome fantastic design-with-2021-01-a.stl
,so it is easy to change 'a' to 'b', save.
In 2021.01, it doesn't remember and just offers
Some fantastic design.stl
.The only mention in the release is 'Fix export format name handling',
a search here found #3029, that didn't get much review at the time.
I believe the original behaviour is better.
Other's may differ?? Perhaps as an option?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: