mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 00:07:52 -06:00
FIX: fix the cached id related issue after 3mf format adjust
Change-Id: Ie3da4a672d166f0cf23efc29faf02de633b3484e (cherry picked from commit 842fe9310c0cdb18e7a491dae2c8ebc7a5753136)
This commit is contained in:
parent
c720e1eb0f
commit
53dc1694a3
2 changed files with 22 additions and 16 deletions
|
@ -2896,7 +2896,7 @@ bool CLI::export_project(Model *model, std::string& path, PlateDataPtrs &partpla
|
|||
store_params.pick_thumbnail_data = pick_thumbnails;
|
||||
store_params.calibration_thumbnail_data = calibration_thumbnails;
|
||||
store_params.id_bboxes = plate_bboxes;
|
||||
store_params.strategy = SaveStrategy::Silence|SaveStrategy::WithGcode|SaveStrategy::SplitModel|SaveStrategy::UseLoadedId;
|
||||
store_params.strategy = SaveStrategy::Silence|SaveStrategy::WithGcode|SaveStrategy::SplitModel|SaveStrategy::UseLoadedId|SaveStrategy::ShareMesh;
|
||||
|
||||
success = Slic3r::store_bbs_3mf(store_params);
|
||||
|
||||
|
|
|
@ -6052,6 +6052,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
// all the object instances of all ModelObjects are stored and indexed in a 1 based linear fashion.
|
||||
// Therefore the list of object_ids here may not be continuous.
|
||||
unsigned int object_id = 1;
|
||||
unsigned int object_index = 0;
|
||||
|
||||
bool cb_cancel = false;
|
||||
std::vector<std::string> object_paths;
|
||||
|
@ -6060,7 +6061,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
if (sub_model && obj != objects_data.begin()->second.object) continue;
|
||||
|
||||
if (proFn) {
|
||||
proFn(EXPORT_STAGE_ADD_MODELS, object_id, model.objects.size(), cb_cancel);
|
||||
proFn(EXPORT_STAGE_ADD_MODELS, object_index++, model.objects.size(), cb_cancel);
|
||||
if (cb_cancel)
|
||||
return false;
|
||||
}
|
||||
|
@ -6092,15 +6093,20 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||
volume_count++;
|
||||
if (m_share_mesh) {
|
||||
auto iter = m_shared_meshes.find(volume->mesh_ptr());
|
||||
if (iter != m_shared_meshes.end() && volume->supported_facets.empty()
|
||||
&& volume->seam_facets.empty()
|
||||
&& volume->mmu_segmentation_facets.empty()) {
|
||||
if (iter != m_shared_meshes.end())
|
||||
{
|
||||
const ModelVolume* shared_volume = iter->second.second;
|
||||
if ((shared_volume->supported_facets.equals(volume->supported_facets))
|
||||
&& (shared_volume->seam_facets.equals(volume->seam_facets))
|
||||
&& (shared_volume->mmu_segmentation_facets.equals(volume->mmu_segmentation_facets)))
|
||||
{
|
||||
auto data = iter->second.first;
|
||||
const_cast<_BBS_3MF_Exporter *>(this)->m_volume_paths.insert({volume, {data->sub_path, data->volumes_objectID.find(iter->second.second)->second}});
|
||||
volumes_objectID.insert({volume, 0});
|
||||
object_data.share_mesh = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
const_cast<_BBS_3MF_Exporter *>(this)->m_shared_meshes.insert({volume->mesh_ptr(), {&object_data, volume}});
|
||||
}
|
||||
if (m_from_backup_save)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue