diff --git a/resources/profiles/PrusaResearch.ini b/resources/profiles/PrusaResearch.ini index bc41fab6ba..a741f4656e 100644 --- a/resources/profiles/PrusaResearch.ini +++ b/resources/profiles/PrusaResearch.ini @@ -3767,6 +3767,7 @@ printer_model = MINI printer_technology = FFF printer_variant = 0.4 printer_vendor = +thumbnails = 240x320,220x165,16x16 bed_shape = 0x0,180x0,180x180,0x180 default_filament_profile = "Prusament PLA MINI" default_print_profile = 0.15mm QUALITY MINI @@ -3827,6 +3828,7 @@ printer_model = SL1 printer_variant = default default_sla_material_profile = Prusa Orange Tough 0.05 default_sla_print_profile = 0.05 Normal +thumbnails = 400x400,800x480 bed_shape = 1.48x1.02,119.48x1.02,119.48x67.02,1.48x67.02 display_height = 68.04 display_orientation = portrait diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 8588fa9c21..82815131e2 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -62,6 +62,11 @@ void PrintConfigDef::init_common_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionString("")); + def = this->add("thumbnails", coPoints); + def->label = L("Picture sizes to be stored into a .gcode and .sl1 files"); + def->mode = comExpert; + def->set_default_value(new ConfigOptionPoints()); + def = this->add("layer_height", coFloat); def->label = L("Layer height"); def->category = L("Layers and Perimeters"); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 8cc47b45a0..221eff7c2d 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -87,8 +87,6 @@ using Slic3r::Preset; using Slic3r::PrintHostJob; #if ENABLE_THUMBNAIL_GENERATOR -static const std::vector < std::pair> THUMBNAIL_SIZE_FFF = { { 240, 320 }, { 220, 165 }, { 16, 16 } }; -static const std::vector> THUMBNAIL_SIZE_SLA = { { 800, 480 } }; static const std::pair THUMBNAIL_SIZE_3MF = { 256, 256 }; #endif // ENABLE_THUMBNAIL_GENERATOR @@ -3069,14 +3067,16 @@ bool Plater::priv::restart_background_process(unsigned int state) (this->background_process.state() != BackgroundSlicingProcess::STATE_RUNNING)) { // update thumbnail data + const std::vector &thumbnail_sizes = this->background_process.current_print()->full_print_config().option("thumbnails")->values; if (this->printer_technology == ptFFF) { // for ptFFF we need to generate the thumbnails before the export of gcode starts this->thumbnail_data.clear(); - for (const std::pair& size : THUMBNAIL_SIZE_FFF) + for (const Vec2d &sized : thumbnail_sizes) { this->thumbnail_data.push_back(ThumbnailData()); - generate_thumbnail(this->thumbnail_data.back(), size.first, size.second, true, true, false); + Point size(sized); // round to ints + generate_thumbnail(this->thumbnail_data.back(), size.x(), size.y(), true, true, false); } } else if (this->printer_technology == ptSLA) @@ -3084,10 +3084,11 @@ bool Plater::priv::restart_background_process(unsigned int state) // for ptSLA generate thumbnails without supports and pad (not yet calculated) // to render also supports and pad see on_slicing_update() this->thumbnail_data.clear(); - for (const std::pair& size : THUMBNAIL_SIZE_SLA) + for (const Vec2d &sized : thumbnail_sizes) { this->thumbnail_data.push_back(ThumbnailData()); - generate_thumbnail(this->thumbnail_data.back(), size.first, size.second, true, true, false); + Point size(sized); // round to ints + generate_thumbnail(this->thumbnail_data.back(), size.x(), size.y(), true, true, false); } } } diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index 6ca6b785e5..32a03b6b2f 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -444,7 +444,8 @@ const std::vector& Preset::printer_options() "machine_max_acceleration_x", "machine_max_acceleration_y", "machine_max_acceleration_z", "machine_max_acceleration_e", "machine_max_feedrate_x", "machine_max_feedrate_y", "machine_max_feedrate_z", "machine_max_feedrate_e", "machine_min_extruding_rate", "machine_min_travel_rate", - "machine_max_jerk_x", "machine_max_jerk_y", "machine_max_jerk_z", "machine_max_jerk_e" + "machine_max_jerk_x", "machine_max_jerk_y", "machine_max_jerk_z", "machine_max_jerk_e", + "thumbnails" }; s_opts.insert(s_opts.end(), Preset::nozzle_options().begin(), Preset::nozzle_options().end()); } diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp index 92db623f02..01c42d3dec 100644 --- a/src/slic3r/GUI/PresetBundle.cpp +++ b/src/slic3r/GUI/PresetBundle.cpp @@ -96,6 +96,7 @@ PresetBundle::PresetBundle() : preset.config.optptr("printer_vendor", true); preset.config.optptr("printer_model", true); preset.config.optptr("printer_variant", true); + preset.config.optptr("thumbnails", true); if (i == 0) { preset.config.optptr("default_print_profile", true); preset.config.option("default_filament_profile", true)->values = { "" };