Also search vendor directory for printer profile resources.

Search the vendor directory using the same conventions used to search
the profiles directory when looking for thumbnails, bed_models, and
bed_textures. Allows a complete, "Config Wizard"-friendly custom vendor
profile to be placed in the (user's configuration) vendor directory.
This commit is contained in:
Aegean Odyssey 2020-04-25 02:51:02 +00:00
parent 4f622e4541
commit e9423ab86d
2 changed files with 26 additions and 14 deletions

View file

@ -338,8 +338,11 @@ static std::string system_print_bed_model(const Preset &preset)
{
std::string out;
const VendorProfile::PrinterModel *pm = PresetUtils::system_printer_model(preset);
if (pm != nullptr && ! pm->bed_model.empty())
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;
}
return out;
}
@ -347,8 +350,11 @@ static std::string system_print_bed_texture(const Preset &preset)
{
std::string out;
const VendorProfile::PrinterModel *pm = PresetUtils::system_printer_model(preset);
if (pm != nullptr && ! pm->bed_texture.empty())
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;
}
return out;
}