diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp index 2a76f218f..ed2d5d9c3 100644 --- a/src/libslic3r/Format/3mf.cpp +++ b/src/libslic3r/Format/3mf.cpp @@ -595,7 +595,7 @@ namespace Slic3r { mz_zip_archive_file_stat stat; - m_name = boost::filesystem::path(filename).filename().stem().string(); + m_name = boost::filesystem::path(filename).stem().string(); // we first loop the entries to read from the archive the .model file only, in order to extract the version from it for (mz_uint i = 0; i < num_entries; ++i) { @@ -1408,6 +1408,13 @@ namespace Slic3r { m_model->delete_object(model_object); } + if (m_version == 0) { + // if the 3mf was not produced by PrusaSlicer and there is only one object, + // set the object name to match the filename + if (m_model->objects.size() == 1) + m_model->objects.front()->name = m_name; + } + // applies instances' matrices for (Instance& instance : m_instances) { if (instance.instance != nullptr && instance.instance->get_object() != nullptr)