-
Notifications
You must be signed in to change notification settings - Fork 430
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
Support for .zip files in drag-and-drop and file menu #658
base: SteamEngine
Are you sure you want to change the base?
Conversation
I like the idea, but I think I have a better idea for the implementation. As you said, extracting temp files is not that nice. Reading zip files could actually be implemented as a meshloader, in util/meshLoader which extracts the files in memory, and loads the resulting file in memory with the right meshLoader (the meshLoaders need to be adjusted to accept memory blocks then, but that's not too difficult) |
but I wouldn't like a zip file being reduced to only this. A zip file is general format for a package, so IMHO dropping a zip file on Cura should be more like dropping all contained files. E.g. you could package a stl file with some ini files to have it loaded with the correct settings, etc. Special combinations/formats could be marked by a double extension, like SOME_MODEL.thingiverse.zip to be able to do special things with the zip. A thingiverse package is a little bit problematic, because it can contain just about everything (I think), e.g. the same model could be included in several formats (assuming Cura can read them) and thus duplicated on the print platform (no real problem, because we can delete them manually). |
Indeed this pull request was half a suggested minimal implementation and half illustrating the suggestion. I have no particular attachment to that particular implementation. I mostly wanted to see how quickly it could be added in some form. I definitely agree about the ugliness of the temp files. However, the side benefit of short-term durability of the files in the menus is nice. In addition, when I tried this a bit in practice, I found that most of the zips from Thingiverse were pretty small anyway. Considering they'd clean up on the OS's temp cleanse (I'm not sure about Mac and Windows), I figured the file-based extract was a fair starting point. I (obviously) leave it to you to decide what works best for your project. Regarding UI, as hg42 mentioned, I toyed with the thought that some filtration may be needed. As I tried the full zip dump on half a dozen or so Thingiverse items, I found the interface regarding delete and multiply was pretty natural and that a filtration modal would probably be busy work, even if it were just one click. That's just my limited perspective though, I'm fairly new to the whole 3D printing thing (I don't even have a unit yet). The biggest issue I see from the full dump is that it might get confusing in some cases (like the screwless gear cube) where multiple of the same part are available. I wonder if a more general solution to filtering out the desired bits from the zip would be to associate the filename with the object and provide hover-text, other labels, or color-coding so that the user can easily identify which part is which. Another point of entry I was poking at last night (but didn't get to try to implement yet) was whether the URLs could be dropped directly. That would allow users to hand-pick items from any site without explicit downloading and then dragging the download files. Anyway, good luck with the project! It looks great so far. |
When playing with Cura with Thingverse, it became tedious to download each individual .stl and load them separately. The proposed patch would allow for the "Download All" link (which produces a .zip) to be imported directly via drag-and-drop into Cura. In addition, .zip files on the user's drive could also be imported and all the .stl files automatically added.
This change is pretty alpha. I tested it under Linux but I don't have the means for Windows, etc. In addition, the base code could probably be extended to not decompress the zip itself (to avoid drive clutter) and/or clean up after the import is complete.
The advantage to not doing those things, however, is that the files listed in the recent files list would still be accessible as long as the temp files continued to exist (on Linux, the next reboot).