mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-30 00:13:15 +08:00
FIX:not consider export stl from file menu
Jira: STUDIO-5946 Change-Id: Ie28b7ac0262d209736522a6c87803b1837fc618a
This commit is contained in:
parent
91f5bc4b52
commit
4207c8b3d0
@ -10901,15 +10901,17 @@ void Plater::export_stl(bool extended, bool selection_only, bool multi_stls)
|
|||||||
|
|
||||||
wxBusyCursor wait;
|
wxBusyCursor wait;
|
||||||
const auto& selection = p->get_selection();
|
const auto& selection = p->get_selection();
|
||||||
// BBS support selecting multiple objects
|
|
||||||
if (selection_only && selection.is_wipe_tower())
|
|
||||||
return;
|
|
||||||
const auto obj_idx = selection.get_object_idx();
|
|
||||||
if (obj_idx == -1)
|
|
||||||
return;
|
|
||||||
//confirm export_with_boolean
|
//confirm export_with_boolean
|
||||||
bool exist_negive_volume = false;
|
bool exist_negive_volume = false;
|
||||||
bool export_with_boolean = false;
|
bool export_with_boolean = false;
|
||||||
|
if (selection_only) {
|
||||||
|
const auto obj_idx = selection.get_object_idx();
|
||||||
|
if (obj_idx == -1 ||selection.is_wipe_tower())
|
||||||
|
return;
|
||||||
|
// only support selection single full object and mulitiple full object
|
||||||
|
if (!selection.is_single_full_object() && !selection.is_multiple_full_object())
|
||||||
|
return;
|
||||||
const ModelObject *cur_model_object = p->model.objects[obj_idx];
|
const ModelObject *cur_model_object = p->model.objects[obj_idx];
|
||||||
for (auto v : cur_model_object->volumes) {
|
for (auto v : cur_model_object->volumes) {
|
||||||
if (v->type() == ModelVolumeType::NEGATIVE_VOLUME) {
|
if (v->type() == ModelVolumeType::NEGATIVE_VOLUME) {
|
||||||
@ -10917,6 +10919,17 @@ void Plater::export_stl(bool extended, bool selection_only, bool multi_stls)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (auto cur_model_object : p->model.objects) {
|
||||||
|
for (auto v : cur_model_object->volumes) {
|
||||||
|
if (v->type() == ModelVolumeType::NEGATIVE_VOLUME) {
|
||||||
|
exist_negive_volume = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (exist_negive_volume) {
|
if (exist_negive_volume) {
|
||||||
MessageDialog dlg(this, _L("Negative parts detected. Would you like to perform mesh boolean before exporting?"), _L("Message"),
|
MessageDialog dlg(this, _L("Negative parts detected. Would you like to perform mesh boolean before exporting?"), _L("Message"),
|
||||||
wxICON_QUESTION | wxYES_NO);
|
wxICON_QUESTION | wxYES_NO);
|
||||||
@ -10925,15 +10938,6 @@ void Plater::export_stl(bool extended, bool selection_only, bool multi_stls)
|
|||||||
export_with_boolean = true;
|
export_with_boolean = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!export_with_boolean) {
|
|
||||||
// BBS
|
|
||||||
if (selection_only) {
|
|
||||||
// only support selection single full object and mulitiple full object
|
|
||||||
if (!selection.is_single_full_object() && !selection.is_multiple_full_object())
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Following lambda generates a combined mesh for export with normals pointing outwards.
|
// Following lambda generates a combined mesh for export with normals pointing outwards.
|
||||||
auto mesh_to_export_fff_no_boolean = [](const ModelObject &mo, int instance_id) {
|
auto mesh_to_export_fff_no_boolean = [](const ModelObject &mo, int instance_id) {
|
||||||
TriangleMesh mesh;
|
TriangleMesh mesh;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user