mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-05 13:04:03 -06:00
Merge branch 'main' into dev/bbs-measure
This commit is contained in:
commit
8ce992b640
148 changed files with 3634 additions and 977 deletions
|
@ -675,12 +675,13 @@ std::vector<int> GLVolumeCollection::load_object(
|
|||
int obj_idx,
|
||||
const std::vector<int> &instance_idxs,
|
||||
const std::string &color_by,
|
||||
bool opengl_initialized)
|
||||
bool opengl_initialized,
|
||||
bool need_raycaster)
|
||||
{
|
||||
std::vector<int> volumes_idx;
|
||||
for (int volume_idx = 0; volume_idx < int(model_object->volumes.size()); ++volume_idx)
|
||||
for (int instance_idx : instance_idxs)
|
||||
volumes_idx.emplace_back(this->GLVolumeCollection::load_object_volume(model_object, obj_idx, volume_idx, instance_idx, color_by, opengl_initialized));
|
||||
volumes_idx.emplace_back(this->GLVolumeCollection::load_object_volume(model_object, obj_idx, volume_idx, instance_idx, color_by, opengl_initialized, false, false, need_raycaster));
|
||||
return volumes_idx;
|
||||
}
|
||||
|
||||
|
@ -693,7 +694,8 @@ int GLVolumeCollection::load_object_volume(
|
|||
const std::string &color_by,
|
||||
bool opengl_initialized,
|
||||
bool in_assemble_view,
|
||||
bool use_loaded_id)
|
||||
bool use_loaded_id,
|
||||
bool need_raycaster)
|
||||
{
|
||||
const ModelVolume *model_volume = model_object->volumes[volume_idx];
|
||||
const int extruder_id = model_volume->extruder_id();
|
||||
|
@ -711,7 +713,7 @@ int GLVolumeCollection::load_object_volume(
|
|||
v.model.init_from(mesh, true);
|
||||
#else
|
||||
v.model.init_from(*mesh);
|
||||
v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh);
|
||||
if (need_raycaster) { v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh); }
|
||||
#endif // ENABLE_SMOOTH_NORMALS
|
||||
v.composite_id = GLVolume::CompositeID(obj_idx, volume_idx, instance_idx);
|
||||
|
||||
|
|
|
@ -439,7 +439,8 @@ public:
|
|||
int obj_idx,
|
||||
const std::vector<int> &instance_idxs,
|
||||
const std::string &color_by,
|
||||
bool opengl_initialized);
|
||||
bool opengl_initialized,
|
||||
bool need_raycaster = true);
|
||||
|
||||
int load_object_volume(
|
||||
const ModelObject *model_object,
|
||||
|
@ -449,7 +450,8 @@ public:
|
|||
const std::string &color_by,
|
||||
bool opengl_initialized,
|
||||
bool in_assemble_view = false,
|
||||
bool use_loaded_id = false);
|
||||
bool use_loaded_id = false,
|
||||
bool need_raycaster = true);
|
||||
// Load SLA auxiliary GLVolumes (for support trees or pad).
|
||||
void load_object_auxiliary(
|
||||
const SLAPrintObject *print_object,
|
||||
|
|
|
@ -50,14 +50,14 @@ static const std::vector<std::string> filament_vendors =
|
|||
"Fil X", "GEEETECH", "Giantarm", "Gizmo Dorks", "GreenGate3D",
|
||||
"HATCHBOX", "Hello3D", "IC3D", "IEMAI", "IIID Max",
|
||||
"INLAND", "iProspect", "iSANMATE", "Justmaker", "Keene Village Plastics",
|
||||
"Kexcelled", "MakerBot", "MatterHackers", "MIKA3D", "NinjaTek",
|
||||
"Nobufil", "Novamaker", "OVERTURE", "OVVNYXE", "Polymaker",
|
||||
"Priline", "Printed Solid", "Protopasta", "Prusament", "Push Plastic",
|
||||
"R3D", "Re-pet3D", "Recreus", "Regen", "RatRig",
|
||||
"Sain SMART", "SliceWorx", "Snapmaker", "SnoLabs", "Spectrum",
|
||||
"SUNLU", "TTYT3D", "Tianse", "UltiMaker", "Valment",
|
||||
"Verbatim", "VO3D", "Voxelab", "VOXELPLA", "YOOPAI",
|
||||
"Yousu", "Ziro", "Zyltech"};
|
||||
"Kexcelled", "LDO", "MakerBot", "MatterHackers", "MIKA3D",
|
||||
"NinjaTek", "Nobufil", "Novamaker", "OVERTURE", "OVVNYXE",
|
||||
"Polymaker", "Priline", "Printed Solid", "Protopasta", "Prusament",
|
||||
"Push Plastic", "R3D", "Re-pet3D", "Recreus", "Regen",
|
||||
"RatRig", "Sain SMART", "SliceWorx", "Snapmaker", "SnoLabs",
|
||||
"Spectrum", "SUNLU", "TTYT3D", "Tianse", "UltiMaker",
|
||||
"Valment", "Verbatim", "VO3D", "Voxelab", "VOXELPLA",
|
||||
"YOOPAI", "Yousu", "Ziro", "Zyltech"};
|
||||
|
||||
static const std::vector<std::string> filament_types = {"PLA", "rPLA", "PLA+", "PLA Tough", "PETG", "ABS", "ASA", "FLEX", "HIPS", "PA", "PACF",
|
||||
"NYLON", "PVA", "PVB", "PC", "PCABS", "PCTG", "PCCF", "PHA", "PP", "PEI", "PET",
|
||||
|
|
|
@ -159,7 +159,7 @@ void Downloader::start_download(const std::string& full_url)
|
|||
size_t id = get_next_id();
|
||||
std::string escaped_url = FileGet::escape_url(full_url.substr(results.length()));
|
||||
if (is_bambustudio_open(full_url) || (is_orca_open(full_url) && is_makerworld_link(full_url)))
|
||||
plater->request_model_download(escaped_url);
|
||||
plater->request_model_download(wxString::FromUTF8(escaped_url));
|
||||
else {
|
||||
std::string text(escaped_url);
|
||||
m_downloads.emplace_back(std::make_unique<Download>(id, std::move(escaped_url), this, m_dest_folder));
|
||||
|
@ -254,4 +254,4 @@ void Downloader::set_download_state(int id, DownloadState state)
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3123,7 +3123,7 @@ void GCodeViewer::load_shells(const Print& print, bool initialized, bool force_p
|
|||
instance_ids.resize(instance_index);
|
||||
|
||||
size_t current_volumes_count = m_shells.volumes.volumes.size();
|
||||
m_shells.volumes.load_object(model_obj, object_idx, instance_ids, "object", initialized);
|
||||
m_shells.volumes.load_object(model_obj, object_idx, instance_ids, "object", initialized, false);
|
||||
|
||||
// adjust shells' z if raft is present
|
||||
const SlicingParameters& slicing_parameters = obj->slicing_parameters();
|
||||
|
|
|
@ -590,7 +590,7 @@ void GLCanvas3D::LayersEditing::adjust_layer_height_profile()
|
|||
{
|
||||
this->update_slicing_parameters();
|
||||
PrintObject::update_layer_height_profile(*m_model_object, *m_slicing_parameters, m_layer_height_profile);
|
||||
Slic3r::adjust_layer_height_profile(*m_slicing_parameters, m_layer_height_profile, this->last_z, this->strength, this->band_width, this->last_action);
|
||||
Slic3r::adjust_layer_height_profile(*m_model_object, *m_slicing_parameters, m_layer_height_profile, this->last_z, this->strength, this->band_width, this->last_action);
|
||||
m_layers_texture.valid = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -792,8 +792,8 @@ void GLToolbar::do_action(GLToolbarItem::EActionType type, int item_id, GLCanvas
|
|||
}
|
||||
|
||||
if (m_type == Normal && item->get_state() != GLToolbarItem::Disabled) {
|
||||
// the item may get disabled during the action, if not, set it back to normal state
|
||||
item->set_state(GLToolbarItem::Normal);
|
||||
// the item may get disabled during the action, if not, set it back to hover state
|
||||
item->set_state(GLToolbarItem::Hover);
|
||||
parent.render();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4280,7 +4280,6 @@ void GUI_App::check_new_version_sf(bool show_tips, int by_user)
|
|||
best_pre = tag_version;
|
||||
best_pre_url = root.get<std::string>("html_url");
|
||||
best_pre_content = root.get<std::string>("body");
|
||||
best_pre.set_prerelease("Preview");
|
||||
}
|
||||
} else {
|
||||
if (best_release < tag_version) {
|
||||
|
@ -4302,7 +4301,6 @@ void GUI_App::check_new_version_sf(bool show_tips, int by_user)
|
|||
best_pre = tag_version;
|
||||
best_pre_url = json_version.second.get<std::string>("html_url");
|
||||
best_pre_content = json_version.second.get<std::string>("body");
|
||||
best_pre.set_prerelease("Preview");
|
||||
}
|
||||
} else {
|
||||
if (best_release < tag_version) {
|
||||
|
@ -5647,7 +5645,8 @@ bool GUI_App::check_and_keep_current_preset_changes(const wxString& caption, con
|
|||
bool is_called_from_configwizard = postponed_apply_of_keeped_changes != nullptr;
|
||||
|
||||
UnsavedChangesDialog dlg(caption, header, "", action_buttons);
|
||||
if (dlg.ShowModal() == wxID_CANCEL)
|
||||
bool no_need_change = dlg.getUpdateItemCount() == 0 ? true : false;
|
||||
if (!no_need_change && dlg.ShowModal() == wxID_CANCEL)
|
||||
return false;
|
||||
|
||||
auto reset_modifications = [this, is_called_from_configwizard]() {
|
||||
|
@ -5662,7 +5661,7 @@ bool GUI_App::check_and_keep_current_preset_changes(const wxString& caption, con
|
|||
load_current_presets(false);
|
||||
};
|
||||
|
||||
if (dlg.discard())
|
||||
if (dlg.discard() || no_need_change)
|
||||
reset_modifications();
|
||||
else // save selected changes
|
||||
{
|
||||
|
|
|
@ -652,7 +652,8 @@ void Slic3r::GUI::ImageGrid::renderContent1(wxDC &dc, wxPoint const &pt, int ind
|
|||
if (hit) {
|
||||
texts.Add(_L("Delete"));
|
||||
texts.Add(secondAction);
|
||||
texts.Add(thirdAction);
|
||||
if (!thirdAction.IsEmpty())
|
||||
texts.Add(thirdAction);
|
||||
renderButtons(dc, texts, rect, m_hit_type == HIT_ACTION ? m_hit_item & 3 : -1, states);
|
||||
} else if (!nonHoverText.IsEmpty()) {
|
||||
texts.Add(nonHoverText);
|
||||
|
|
|
@ -29,7 +29,7 @@ static const std::vector<int> _3DCONNEXION_VENDORS =
|
|||
0x256F // 3DCONNECTION = 9583 // 3Dconnexion
|
||||
};
|
||||
|
||||
// See: https://github.com/FreeSpacenav/spacenavd/blob/a9eccf34e7cac969ee399f625aef827f4f4aaec6/src/dev.c#L202
|
||||
// See: https://github.com/FreeSpacenav/spacenavd/blob/39856625a6de1e8c4b57c5938e1bf29d13cf1a9f/src/dev.c#L63
|
||||
static const std::vector<int> _3DCONNEXION_DEVICES =
|
||||
{
|
||||
0xc603, /* 50691 spacemouse plus XT */
|
||||
|
@ -43,6 +43,7 @@ static const std::vector<int> _3DCONNEXION_DEVICES =
|
|||
0xc628, /* 50728 space navigator for notebooks*/
|
||||
0xc629, /* 50729 space pilot pro*/
|
||||
0xc62b, /* 50731 space mouse pro*/
|
||||
0xc640, /* 50752 nulooq */
|
||||
0xc62e, /* 50734 spacemouse wireless (USB cable) *TESTED* */
|
||||
0xc62f, /* 50735 spacemouse wireless receiver */
|
||||
0xc631, /* 50737 spacemouse pro wireless *TESTED* */
|
||||
|
@ -50,7 +51,7 @@ static const std::vector<int> _3DCONNEXION_DEVICES =
|
|||
0xc633, /* 50739 spacemouse enterprise */
|
||||
0xc635, /* 50741 spacemouse compact *TESTED* */
|
||||
0xc636, /* 50742 spacemouse module */
|
||||
0xc640, /* 50752 nulooq */
|
||||
0xc63a, /* 60060 spacemouse wireless (Bluetooth) */
|
||||
0xc652, /* 50770 3Dconnexion universal receiver *TESTED* */
|
||||
};
|
||||
|
||||
|
|
|
@ -502,21 +502,20 @@ std::vector<std::string> UpdateVersionDialog::splitWithStl(std::string str,std::
|
|||
void UpdateVersionDialog::update_version_info(wxString release_note, wxString version)
|
||||
{
|
||||
//bbs check whether the web display is used
|
||||
bool use_web_link = false;
|
||||
url_line = "";
|
||||
auto split_array = splitWithStl(release_note.ToStdString(), "###");
|
||||
|
||||
if (split_array.size() >= 3) {
|
||||
for (auto i = 0; i < split_array.size(); i++) {
|
||||
std::string url = split_array[i];
|
||||
if (std::strstr(url.c_str(), "http://") != NULL || std::strstr(url.c_str(), "https://") != NULL) {
|
||||
use_web_link = true;
|
||||
url_line = url;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool use_web_link = false;
|
||||
url_line = "";
|
||||
// Orca: not used in Orca Slicer
|
||||
// auto split_array = splitWithStl(release_note.ToStdString(), "###");
|
||||
// if (split_array.size() >= 3) {
|
||||
// for (auto i = 0; i < split_array.size(); i++) {
|
||||
// std::string url = split_array[i];
|
||||
// if (std::strstr(url.c_str(), "http://") != NULL || std::strstr(url.c_str(), "https://") != NULL) {
|
||||
// use_web_link = true;
|
||||
// url_line = url;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (use_web_link) {
|
||||
m_brand->Hide();
|
||||
|
|
|
@ -1649,7 +1649,14 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
|||
//Orca: sync filament num if it's a multi tool printer
|
||||
if (opt_key == "extruders_count" && !m_config->opt_bool("single_extruder_multi_material")){
|
||||
auto num_extruder = boost::any_cast<size_t>(value);
|
||||
wxGetApp().preset_bundle->set_num_filaments(num_extruder);
|
||||
int old_filament_size = wxGetApp().preset_bundle->filament_presets.size();
|
||||
std::vector<std::string> new_colors;
|
||||
for (int i = old_filament_size; i < num_extruder; ++i) {
|
||||
wxColour new_col = Plater::get_next_color_for_filament();
|
||||
std::string new_color = new_col.GetAsString(wxC2S_HTML_SYNTAX).ToStdString();
|
||||
new_colors.push_back(new_color);
|
||||
}
|
||||
wxGetApp().preset_bundle->set_num_filaments(num_extruder, new_colors);
|
||||
wxGetApp().plater()->on_filaments_change(num_extruder);
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
|
||||
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
|
||||
|
@ -4322,6 +4329,7 @@ if (is_marlin_flavor)
|
|||
optgroup->append_single_option_line("deretraction_speed", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retraction_minimum_travel", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retract_when_changing_layer", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retract_on_top_layer", "", extruder_idx);
|
||||
optgroup->append_single_option_line("wipe", "", extruder_idx);
|
||||
optgroup->append_single_option_line("wipe_distance", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retract_before_wipe", "", extruder_idx);
|
||||
|
@ -4538,7 +4546,7 @@ void TabPrinter::toggle_options()
|
|||
// user can customize other retraction options if retraction is enabled
|
||||
//BBS
|
||||
bool retraction = have_retract_length || use_firmware_retraction;
|
||||
std::vector<std::string> vec = { "z_hop", "retract_when_changing_layer" };
|
||||
std::vector<std::string> vec = {"z_hop", "retract_when_changing_layer", "retract_on_top_layer"};
|
||||
for (auto el : vec)
|
||||
toggle_option(el, retraction, i);
|
||||
|
||||
|
|
|
@ -312,6 +312,8 @@ public:
|
|||
{
|
||||
}
|
||||
};
|
||||
public:
|
||||
int getUpdateItemCount() { return m_presetitems.size(); }
|
||||
|
||||
private:
|
||||
std::vector<PresetItem> m_presetitems;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue