Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
ffe5e0c
feature add printer info sync entrance.
LiuLikeQian Mar 16, 2026
1303cbe
feature limit only one nozzle and not allow to choose nozzle.
LiuLikeQian Mar 16, 2026
c3ac794
fix remove not work code.
LiuLikeQian Mar 16, 2026
b170b26
feature select the u1 machine and show the sync btn entrance. fix the…
LiuLikeQian Mar 17, 2026
876c723
feature when on U1 switch the nozzle diameter and show a tips.
LiuLikeQian Mar 17, 2026
644527f
feature add Graphic Effect Steel Plate for U1
LiuLikeQian Mar 17, 2026
142e5bb
feature add new plate for U1, and U1 default show 3 plates and use su…
LiuLikeQian Mar 17, 2026
45c6e57
feature only U1 has new plate.
LiuLikeQian Mar 17, 2026
4d185b2
feature merge U1 nozzle to U1 type and handle it the same logic.
LiuLikeQian Mar 18, 2026
e92633b
feature upload or print notify web the nozzle info
LiuLikeQian Mar 18, 2026
2c2aa19
feature remove not work code.
LiuLikeQian Mar 18, 2026
224c403
feature rename the graphic effect plate, add dialog for sync nozzle s…
LiuLikeQian Mar 19, 2026
b324fc8
feature sync nozzle info and set the nozzle combobox data.
LiuLikeQian Mar 19, 2026
887101e
feature add tips for plate use filament.
LiuLikeQian Mar 20, 2026
3654ea0
feature remove the nozzle modify entrance.
LiuLikeQian Mar 20, 2026
a78dbcb
feature update the Smooth PEI Plate layer temp.
LiuLikeQian Mar 20, 2026
e1b5320
feature update the plate name for snapmaker u1.
LiuLikeQian Mar 20, 2026
2ffdf64
feature update ui img, guide page merge the nozzle for machine, updat…
LiuLikeQian Mar 30, 2026
a331726
feature update guide page machine select.
LiuLikeQian Mar 30, 2026
440c7c2
feature update guide ui, profiles source.
LiuLikeQian Mar 30, 2026
1301e1d
feature export 3mf include the graphic plate,process soft and load no…
LiuLikeQian Mar 30, 2026
20145b4
feature add tips for smooth pei plater for filament relations,and gra…
LiuLikeQian Mar 31, 2026
b1f9931
feature add file for filament tips.
LiuLikeQian Mar 31, 2026
803347c
feature revert the profiles change.
LiuLikeQian Apr 1, 2026
b4b9321
Merge branch 'dev_2.3.2_alves' of https://github.com/Snapmaker/OrcaSl…
LiuLikeQian Apr 1, 2026
ae0d9fb
fix revert to old profiles
LiuLikeQian Apr 1, 2026
9e4b0f1
Merge branch 'main' into dev_2.3.2_alves
LiuLikeQian Apr 1, 2026
35b7b9d
feature remove not work code.
LiuLikeQian Apr 1, 2026
dcac898
feature add config for tips on filament.
LiuLikeQian Apr 1, 2026
ebb8b5b
feature add nozzle changed and tips filament relations for slice.
LiuLikeQian Apr 1, 2026
6a06009
feature add nozzle for filament tips.
LiuLikeQian Apr 1, 2026
6241343
feature remove the not work code.
LiuLikeQian Apr 2, 2026
1c24d19
feature render panel add graphic hot bed for Custom plater.
LiuLikeQian Apr 2, 2026
4cc3638
fix the judge logic for sync machine filament info.
LiuLikeQian Apr 2, 2026
e28efd7
feature load relations json from profiles source,upgrade translations.
LiuLikeQian Apr 2, 2026
ad905cb
feature update the translation.
LiuLikeQian Apr 2, 2026
1bde7c6
feature update translation,fix sync nozzle bug.
LiuLikeQian Apr 3, 2026
bb75a7e
feature update the translations.
LiuLikeQian Apr 3, 2026
2177da1
fix machine sync question .
LiuLikeQian Apr 3, 2026
2c04618
feature update the hot bed tmp
LiuLikeQian Apr 3, 2026
f598484
Merge branch 'dev_2.3.2_alves' of https://github.com/Snapmaker/OrcaSl…
LiuLikeQian Apr 3, 2026
74e384a
feature update the hot bed tmp
LiuLikeQian Apr 7, 2026
a85a8d6
fix warning rule not work question.
LiuLikeQian Apr 7, 2026
0d3d069
fix switch machine and the device show incorrect.
LiuLikeQian Apr 7, 2026
6c9c339
feature update the config for tips hot bed and use the filament to sl…
LiuLikeQian Apr 7, 2026
037f522
feature fix upgrade lead to resource update fail question.
LiuLikeQian Apr 7, 2026
988ca3b
feature merge main function.
LiuLikeQian Apr 9, 2026
8d8d1ff
feature revert not work code.
LiuLikeQian Apr 9, 2026
c2872d0
feature update the request type.
LiuLikeQian Apr 9, 2026
ce38014
fix build fail bug.
LiuLikeQian Apr 9, 2026
3d4a737
feature update the web resource.
LiuLikeQian Apr 9, 2026
2fce666
fix linux flatpak build fail bug
Apr 9, 2026
e82638e
feature remove the not work code for thow exception.
LiuLikeQian Apr 10, 2026
362e428
Merge branch 'bugfix_source_upgrade' of https://github.com/Snapmaker/…
LiuLikeQian Apr 10, 2026
ffafa33
fix request web,profiles resource and thread not sync question.
LiuLikeQian Apr 10, 2026
713609d
feature remove not work code.
LiuLikeQian Apr 10, 2026
6e4b739
fix invalid version info for update profiles dialog.
LiuLikeQian Apr 10, 2026
cc351f1
Merge branch 'main' into bugfix_source_upgrade
LiuLikeQian Apr 10, 2026
d75e5a0
feature only show a dialog tips for bed tips.
LiuLikeQian Apr 10, 2026
f441b95
feature update web resource.
LiuLikeQian Apr 10, 2026
bad350b
fix the machine filament not sync bug.
LiuLikeQian Apr 10, 2026
58b2b8e
feature get nozzle info data from web.
LiuLikeQian Apr 10, 2026
2edea53
Merge branch 'main' of https://github.com/Snapmaker/OrcaSlicer
LiuLikeQian Apr 10, 2026
58c3029
Merge branch 'main' of https://github.com/Snapmaker/OrcaSlicer
LiuLikeQian Apr 13, 2026
345fc56
Merge branch 'main' of https://github.com/Snapmaker/OrcaSlicer
LiuLikeQian Apr 16, 2026
63f597d
feature fix encoding format bug.
LiuLikeQian May 6, 2026
391fa5b
Merge branch 'main' of https://github.com/Snapmaker/OrcaSlicer
LiuLikeQian May 7, 2026
094f7d8
Merge branch 'main' of https://github.com/Snapmaker/OrcaSlicer
LiuLikeQian May 25, 2026
fe4f356
Merge branch 'main' of https://github.com/Snapmaker/OrcaSlicer
LiuLikeQian May 27, 2026
416bda2
Merge branch 'main' of https://github.com/Snapmaker/OrcaSlicer
LiuLikeQian Jun 2, 2026
f01d742
Merge branch 'main' of https://github.com/Snapmaker/OrcaSlicer
LiuLikeQian Jun 23, 2026
fe73210
Merge branch 'main' of https://github.com/Snapmaker/OrcaSlicer
LiuLikeQian Jun 26, 2026
42abef8
Merge branch 'main' of https://github.com/Snapmaker/OrcaSlicer
LiuLikeQian Jul 6, 2026
1e2bcc2
Merge branch 'main' into feature_Encoding_format
LiuLikeQian Jul 7, 2026
1ecaaf4
Merge branch 'main' into feature_Encoding_format
LiuLikeQian Jul 21, 2026
3f675f5
fix acp decode and make mistake for resource copy.
LiuLikeQian Jul 22, 2026
6fc7576
fix acp on windows bug.
LiuLikeQian Jul 23, 2026
fdbb5c3
fix acp question lead to path incorrect.
LiuLikeQian Jul 23, 2026
b82c1a3
fix extract file and copy dir exist ansy code bug.
LiuLikeQian Jul 23, 2026
3564a90
feature diff win and the other platform encode.
LiuLikeQian Jul 23, 2026
c494fe6
fix build fail error.
LiuLikeQian Jul 24, 2026
4a3e9d9
fix build failed.
LiuLikeQian Jul 24, 2026
5b81c7f
feature fix linux build error.
LiuLikeQian Jul 24, 2026
d653d9a
feature update the unicode for linux.
LiuLikeQian Jul 24, 2026
e0bdfb5
fix linux build error.
LiuLikeQian Jul 24, 2026
7c60e5d
fix less file resource.
LiuLikeQian Jul 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/Snapmaker_Orca.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ static int decode_png_to_thumbnail(std::string png_file, ThumbnailData& thumbnai
std::string png_buffer(size, '\0');
png_buffer.reserve(size);

boost::filesystem::ifstream ifs(png_file, std::ios::binary);
boost::nowide::ifstream ifs(png_file, std::ios::binary);
ifs.read(png_buffer.data(), png_buffer.size());
ifs.close();

Expand Down Expand Up @@ -6109,11 +6109,20 @@ bool CLI::setup(int argc, char **argv)
}
#endif

#ifdef WIN32
// path::string() returns ACP on Windows; use nowide::narrow(wstring()) for UTF-8.
set_resources_dir(boost::nowide::narrow(path_resources.wstring()));
set_var_dir(boost::nowide::narrow((path_resources / "images").wstring()));
set_local_dir(boost::nowide::narrow((path_resources / "i18n").wstring()));
set_sys_shapes_dir(boost::nowide::narrow((path_resources / "shapes").wstring()));
set_custom_gcodes_dir(boost::nowide::narrow((path_resources / "custom_gcodes").wstring()));
#else
set_resources_dir(path_resources.string());
set_var_dir((path_resources / "images").string());
set_local_dir((path_resources / "i18n").string());
set_sys_shapes_dir((path_resources / "shapes").string());
set_custom_gcodes_dir((path_resources / "custom_gcodes").string());
#endif

// Parse all command line options into a DynamicConfig.
// If any option is unsupported, print usage and abort immediately.
Expand Down
1 change: 1 addition & 0 deletions src/dev-utils/BaseException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/log/trivial.hpp>
#include <boost/nowide/fstream.hpp>
#include <boost/format.hpp>
#include <mutex>

Expand Down
21 changes: 17 additions & 4 deletions src/libslic3r/AppConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/nowide/convert.hpp>
#include <boost/nowide/fstream.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <boost/property_tree/ptree_fwd.hpp>
Expand Down Expand Up @@ -1430,13 +1431,25 @@ void AppConfig::reset_selections()
std::string AppConfig::config_path()
{
#ifdef USE_JSON_CONFIG
#ifdef WIN32
std::string path = (m_mode == EAppMode::Editor) ?
boost::nowide::narrow((Slic3r::data_dir_path() / (SLIC3R_APP_KEY ".conf")).make_preferred().wstring()) :
boost::nowide::narrow((Slic3r::data_dir_path() / (GCODEVIEWER_APP_KEY ".conf")).make_preferred().wstring());
#else
std::string path = (m_mode == EAppMode::Editor) ?
(Slic3r::data_dir_path() / (SLIC3R_APP_KEY ".conf")).make_preferred().string() :
(Slic3r::data_dir_path() / (GCODEVIEWER_APP_KEY ".conf")).make_preferred().string();
#endif
#else
#ifdef WIN32
std::string path = (m_mode == EAppMode::Editor) ?
(boost::filesystem::path(Slic3r::data_dir()) / (SLIC3R_APP_KEY ".conf")).make_preferred().string() :
(boost::filesystem::path(Slic3r::data_dir()) / (GCODEVIEWER_APP_KEY ".conf")).make_preferred().string();
boost::nowide::narrow((Slic3r::data_dir_path() / (SLIC3R_APP_KEY ".ini")).make_preferred().wstring()) :
boost::nowide::narrow((Slic3r::data_dir_path() / (GCODEVIEWER_APP_KEY ".ini")).make_preferred().wstring());
#else
std::string path = (m_mode == EAppMode::Editor) ?
(boost::filesystem::path(Slic3r::data_dir()) / (SLIC3R_APP_KEY ".ini")).make_preferred().string() :
(boost::filesystem::path(Slic3r::data_dir()) / (GCODEVIEWER_APP_KEY ".ini")).make_preferred().string();
(Slic3r::data_dir_path() / (SLIC3R_APP_KEY ".ini")).make_preferred().string() :
(Slic3r::data_dir_path() / (GCODEVIEWER_APP_KEY ".ini")).make_preferred().string();
#endif
#endif

return path;
Expand Down
10 changes: 7 additions & 3 deletions src/libslic3r/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <boost/lexical_cast.hpp>
#include <boost/log/trivial.hpp>
#include <boost/nowide/cstdlib.hpp>
#include <boost/nowide/convert.hpp>
#include <boost/nowide/iostream.hpp>
#include <boost/nowide/fstream.hpp>
#include <boost/property_tree/ini_parser.hpp>
Expand Down Expand Up @@ -801,9 +802,12 @@ int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContex
CNumericLocalesSetter locales_setter;

try {
boost::nowide::ifstream ifs(file);
ifs >> j;
ifs.close();
#ifdef WIN32
// `file` is UTF-8 (wx / data_dir); boost::filesystem::path(std::string) uses ACP on Windows.
j = json::parse(read_text_file_for_json_parse(boost::filesystem::path(boost::nowide::widen(file))));
#else
j = json::parse(read_text_file_for_json_parse(boost::filesystem::path(file)));
#endif

const ConfigDef* config_def = this->def();
if (config_def == nullptr) {
Expand Down
7 changes: 4 additions & 3 deletions src/libslic3r/FilamentColorLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "Utils.hpp"

#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/log/trivial.hpp>
#include <boost/nowide/fstream.hpp>
#include <nlohmann/json.hpp>
Expand Down Expand Up @@ -86,15 +87,15 @@ std::vector<std::string> NormalizeColorList(const std::vector<std::string>& colo
boost::filesystem::path FilamentsColoursPath()
{
// Prefer the system copy, fall back to bundled resources for a fresh install.
boost::filesystem::path path = boost::filesystem::path(Slic3r::data_dir());
boost::filesystem::path path = Slic3r::data_dir_path();
path /= "system";
path /= "Snapmaker";
path /= "filament";
path /= "filaments_colours.json";
if (boost::filesystem::exists(path))
return path.make_preferred();

path = boost::filesystem::path(Slic3r::resources_dir());
path = Slic3r::resources_dir_path();
path /= "profiles";
path /= "Snapmaker";
path /= "filament";
Expand Down Expand Up @@ -162,7 +163,7 @@ std::string NormalizeJsonColor(const std::string& color, bool& hasInvalidColor)

bool LoadJsonFile(const boost::filesystem::path& path, nlohmann::json& out)
{
boost::nowide::ifstream ifs(path.string());
boost::nowide::ifstream ifs(path);
if (!ifs.is_open())
{
BOOST_LOG_TRIVIAL(warning) << "Failed to open official filament color file: " << path.string();
Expand Down
45 changes: 35 additions & 10 deletions src/libslic3r/FilamentHotBedNozzleRules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
#include <boost/log/trivial.hpp>
#include <boost/nowide/convert.hpp>
#include <boost/nowide/fstream.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <algorithm>
Expand All @@ -21,17 +23,30 @@ namespace pt = boost::property_tree;
namespace {

// Prefer user data dir (installed system profile) so rules can be patched without reinstalling the app.
// Windows: data_dir/resources_dir are UTF-8; return UTF-8 path for boost::nowide streams, build fs::path via widen for lookups.
static std::string filament_hot_bed_nozzles_json_path()
{
namespace fs = boost::filesystem;
const fs::path user_path = (fs::path(Slic3r::data_dir()) / PRESET_SYSTEM_DIR / PresetBundle::SM_BUNDLE / "filament" /
"filament_hot_bed_nozzles.json")
.make_preferred();
if (fs::exists(user_path))
return user_path.string();
return (fs::path(Slic3r::resources_dir()) / "profiles" / PresetBundle::SM_BUNDLE / "filament" / "filament_hot_bed_nozzles.json")
.make_preferred()
.string();
#ifdef _WIN32
const fs::path user = (fs::path(boost::nowide::widen(Slic3r::data_dir())) / PRESET_SYSTEM_DIR / PresetBundle::SM_BUNDLE / "filament" /
"filament_hot_bed_nozzles.json")
.make_preferred();

if (fs::exists(user))
return boost::nowide::narrow(user.wstring());
const fs::path res = (fs::path(boost::nowide::widen(Slic3r::resources_dir())) / "profiles" / PresetBundle::SM_BUNDLE / "filament" /
"filament_hot_bed_nozzles.json")
.make_preferred();

return boost::nowide::narrow(res.wstring());
#else
const fs::path user = (fs::path(Slic3r::data_dir()) / PRESET_SYSTEM_DIR / PresetBundle::SM_BUNDLE / "filament" / "filament_hot_bed_nozzles.json").make_preferred();

if (fs::exists(user))
return user.string();

return (fs::path(Slic3r::resources_dir()) / "profiles" / PresetBundle::SM_BUNDLE / "filament" / "filament_hot_bed_nozzles.json").make_preferred().string();
#endif
}

std::string to_upper_ascii(std::string s)
Expand Down Expand Up @@ -354,14 +369,24 @@ void FilamentHotBedNozzleRules::load()
m_loaded = false;

const std::string file_path = filament_hot_bed_nozzles_json_path();
if (!boost::filesystem::exists(file_path)) {
#ifdef _WIN32
if (!boost::filesystem::exists(boost::filesystem::path(boost::nowide::widen(file_path))))
#else
if (!boost::filesystem::exists(boost::filesystem::path(file_path)))
#endif
{
BOOST_LOG_TRIVIAL(warning) << "filament_hot_bed_nozzles.json not found: " << file_path;
return;
}

try {
pt::ptree root;
pt::read_json(file_path, root);
boost::nowide::ifstream ifs(file_path, std::ios::binary);
if (!ifs) {
BOOST_LOG_TRIVIAL(warning) << "filament_hot_bed_nozzles.json could not be opened: " << file_path;
return;
}
pt::read_json(ifs, root);

for (const auto& kv : root) {
const std::string rule_key = boost::trim_copy(kv.first);
Expand Down
8 changes: 0 additions & 8 deletions src/libslic3r/FilamentHotBedNozzleRules.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ struct NozzleFilamentRuleMismatch {
std::string filament_preset_name; // resolved preset display name (may be empty)
};

// JSON: %AppData%/.../system/Snapmaker/filament/filament_hot_bed_nozzles.json (preferred), else bundled resources path.
// Keys: bed ids (btPEI, btGESP), nozzle ids ("0.2mm" …) with support/warning.
// 喷嘴规则(键名以 "mm" 结尾),任选其一:
// 1) 单对象 { "type":"all"|材质, "forbidden":[...] }
// 2) 数组 [ { "type", "forbidden" }, ... ]
// 3) 按材质分键对象:键为 all / undefine / hardened_steel / stainless_steel / brass(可只写其中任意几种),
// 值为 forbidden 数组、{ "forbidden": [...] }、warning 数组、{ "warning": [...] },或同时含 forbidden / warning 的对象;
// "all" 表示任意喷嘴材质共用该条规则。warning 为提示级(不拦截切片),与热床 warning 语义类似。
class FilamentHotBedNozzleRules
{
public:
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/Format/bbs_3mf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6152,7 +6152,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
MD5_CTX ctx;
MD5_Init(&ctx);
auto src_gcode_file = plate_data->gcode_file;
boost::filesystem::ifstream ifs(src_gcode_file, std::ios::binary);
boost::nowide::ifstream ifs(src_gcode_file, std::ios::binary);
std::string buf(64 * 1024, 0);
const std::size_t & size = boost::filesystem::file_size(src_gcode_file);
std::size_t left_size = size;
Expand Down Expand Up @@ -7996,7 +7996,7 @@ bool _BBS_3MF_Exporter::_add_gcode_file_to_archive(mz_zip_archive& archive, cons
BOOST_LOG_TRIVIAL(error) << "Gcode is missing, filename = " << src_gcode_file;
result = false;
}
boost::filesystem::ifstream ifs(src_gcode_file, std::ios::binary);
boost::nowide::ifstream ifs(src_gcode_file, std::ios::binary);
std::string buf(64 * 1024, 0);
while (ifs) {
ifs.read(buf.data(), buf.size());
Expand Down
55 changes: 42 additions & 13 deletions src/libslic3r/Preset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ ConfigFileType guess_config_file_type(const ptree &tree)
VendorProfile VendorProfile::from_ini(const boost::filesystem::path &path, bool load_all)
{
ptree tree;
boost::filesystem::ifstream ifs(path);
boost::nowide::ifstream ifs(path);
boost::property_tree::read_ini(ifs, tree);
return VendorProfile::from_ini(tree, path, load_all);
}
Expand Down Expand Up @@ -3911,9 +3911,15 @@ namespace PresetUtils {
std::string out;
const VendorProfile::PrinterModel* pm = PresetUtils::system_printer_model(preset);
if (pm != nullptr && !pm->bed_model.empty()) {
out = Slic3r::data_dir() + "/vendor/" + preset.vendor->id + "/" + pm->bed_model;
if (!boost::filesystem::exists(boost::filesystem::path(out)))
out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->bed_model;
const auto vendor_p = boost::filesystem::path(boost::nowide::widen(preset.vendor->id));
auto user_path = (Slic3r::data_dir_path() / "vendor" / vendor_p / pm->bed_model).make_preferred();
if (!boost::filesystem::exists(user_path))
user_path = (Slic3r::resources_dir_path() / "profiles" / vendor_p / pm->bed_model).make_preferred();
#ifdef WIN32
out = boost::nowide::narrow(user_path.wstring());
#else
out = user_path.string();
#endif
}
return out;
}
Expand All @@ -3923,9 +3929,15 @@ namespace PresetUtils {
std::string out;
const VendorProfile::PrinterModel* pm = PresetUtils::system_printer_model(preset);
if (pm != nullptr && !pm->bed_texture.empty()) {
out = Slic3r::data_dir() + "/vendor/" + preset.vendor->id + "/" + pm->bed_texture;
if (!boost::filesystem::exists(boost::filesystem::path(out)))
out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->bed_texture;
const auto vendor_p = boost::filesystem::path(boost::nowide::widen(preset.vendor->id));
auto user_path = (Slic3r::data_dir_path() / "vendor" / vendor_p / pm->bed_texture).make_preferred();
if (!boost::filesystem::exists(user_path))
user_path = (Slic3r::resources_dir_path() / "profiles" / vendor_p / pm->bed_texture).make_preferred();
#ifdef WIN32
out = boost::nowide::narrow(user_path.wstring());
#else
out = user_path.string();
#endif
}
return out;
}
Expand All @@ -3935,13 +3947,30 @@ namespace PresetUtils {
std::string out;
const VendorProfile::PrinterModel* pm = PresetUtils::system_printer_model(preset);
if (pm != nullptr && !pm->hotend_model.empty()) {
out = Slic3r::data_dir() + "/vendor/" + preset.vendor->id + "/" + pm->hotend_model;
if (!boost::filesystem::exists(boost::filesystem::path(out)))
out = Slic3r::resources_dir() + "/profiles/" + preset.vendor->id + "/" + pm->hotend_model;
const auto vendor_p = boost::filesystem::path(boost::nowide::widen(preset.vendor->id));
auto user_path = (Slic3r::data_dir_path() / "vendor" / vendor_p / pm->hotend_model).make_preferred();
if (!boost::filesystem::exists(user_path))
user_path = (Slic3r::resources_dir_path() / "profiles" / vendor_p / pm->hotend_model).make_preferred();
#ifdef WIN32
out = boost::nowide::narrow(user_path.wstring());
#else
out = user_path.string();
#endif
}

if (out.empty()
#ifdef WIN32
|| !boost::filesystem::exists(boost::filesystem::path(boost::nowide::widen(out)))
#else
|| !boost::filesystem::exists(boost::filesystem::path(out))
#endif
) {
#ifdef WIN32
out = boost::nowide::narrow((Slic3r::resources_dir_path() / "profiles" / "hotend.stl").make_preferred().wstring());
#else
out = (Slic3r::resources_dir_path() / "profiles" / "hotend.stl").make_preferred().string();
#endif
}

if (out.empty() ||!boost::filesystem::exists(boost::filesystem::path(out)))
out = Slic3r::resources_dir() + "/profiles/hotend.stl";
return out;
}
} // namespace PresetUtils
Expand Down
Loading
Loading