Merge remote-tracking branch 'remotes/origin/3mf_io'
This commit is contained in:
commit
c3d7be5994
5 changed files with 30 additions and 11 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/nowide/iostream.hpp>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
@ -91,7 +92,15 @@ Model Model::read_from_archive(const std::string &input_file, PresetBundle* bund
|
|||
throw std::runtime_error("The supplied file couldn't be read because it's empty");
|
||||
|
||||
for (ModelObject *o : model.objects)
|
||||
o->input_file = input_file;
|
||||
{
|
||||
if (boost::algorithm::iends_with(input_file, ".zip.amf"))
|
||||
{
|
||||
// we remove the .zip part of the extension to avoid it be added to filenames when exporting
|
||||
o->input_file = boost::ireplace_last_copy(input_file, ".zip.", ".");
|
||||
}
|
||||
else
|
||||
o->input_file = input_file;
|
||||
}
|
||||
|
||||
if (add_default_instances)
|
||||
model.add_default_instances();
|
||||
|
|
|
@ -290,13 +290,13 @@ void BedShapePanel::update_shape()
|
|||
void BedShapePanel::load_stl()
|
||||
{
|
||||
t_file_wild_card vec_FILE_WILDCARDS = get_file_wild_card();
|
||||
std::vector<std::string> file_types = { "known", "stl", "obj", "amf", "prusa"};
|
||||
wxString MODEL_WILDCARD;
|
||||
std::vector<std::string> file_types = { "known", "stl", "obj", "amf", "3mf", "prusa" };
|
||||
wxString MODEL_WILDCARD;
|
||||
for (auto file_type: file_types)
|
||||
MODEL_WILDCARD += vec_FILE_WILDCARDS.at(file_type) + "|";
|
||||
|
||||
auto dialog = new wxFileDialog(this, _L("Choose a file to import bed shape from (STL/OBJ/AMF/PRUSA):"), "", "",
|
||||
MODEL_WILDCARD, wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
||||
auto dialog = new wxFileDialog(this, _L("Choose a file to import bed shape from (STL/OBJ/AMF/3MF/PRUSA):"), "", "",
|
||||
MODEL_WILDCARD, wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
||||
if (dialog->ShowModal() != wxID_OK) {
|
||||
dialog->Destroy();
|
||||
return;
|
||||
|
|
|
@ -39,8 +39,9 @@ inline t_file_wild_card& get_file_wild_card() {
|
|||
FILE_WILDCARDS["known"] = "Known files (*.stl, *.obj, *.amf, *.xml, *.prusa)|*.stl;*.STL;*.obj;*.OBJ;*.amf;*.AMF;*.xml;*.XML;*.prusa;*.PRUSA";
|
||||
FILE_WILDCARDS["stl"] = "STL files (*.stl)|*.stl;*.STL";
|
||||
FILE_WILDCARDS["obj"] = "OBJ files (*.obj)|*.obj;*.OBJ";
|
||||
FILE_WILDCARDS["amf"] = "AMF files (*.amf)|*.amf;*.AMF;*.xml;*.XML";
|
||||
FILE_WILDCARDS["prusa"] = "Prusa Control files (*.prusa)|*.prusa;*.PRUSA";
|
||||
FILE_WILDCARDS["amf"] = "AMF files (*.amf)|*.zip.amf;*.amf;*.AMF;*.xml;*.XML";
|
||||
FILE_WILDCARDS["3mf"] = "3MF files (*.3mf)|*.3mf;*.3MF;";
|
||||
FILE_WILDCARDS["prusa"] = "Prusa Control files (*.prusa)|*.prusa;*.PRUSA";
|
||||
FILE_WILDCARDS["ini"] = "INI files *.ini|*.ini;*.INI";
|
||||
FILE_WILDCARDS["gcode"] = "G-code files (*.gcode, *.gco, *.g, *.ngc)|*.gcode;*.GCODE;*.gco;*.GCO;*.g;*.G;*.ngc;*.NGC";
|
||||
FILE_WILDCARDS["svg"] = "SVG files *.svg|*.svg;*.SVG";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue