mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
FIX: clien crash when double extruder filament preset switch to single
extruder filament preset Jira: STUDIO-12689 Change-Id: Ifab01dcbc0f42684655e3feae923bfeb82965d01 (cherry picked from commit 0b57ff3b537cf7c2fdc503ffd3e5b5567e84c5d4)
This commit is contained in:
@@ -3573,7 +3573,9 @@ void TabFilament::update_filament_overrides_page(const DynamicPrintConfig* print
|
|||||||
// "filament_seam_gap"
|
// "filament_seam_gap"
|
||||||
};
|
};
|
||||||
|
|
||||||
const int extruder_idx = m_variant_combo->GetSelection(); // #ys_FIXME
|
const int selection = 0; //m_variant_combo->GetSelection(); // TODO: Orca hack
|
||||||
|
auto opt = dynamic_cast<ConfigOptionVectorBase *>(m_config->option("filament_retraction_length"));
|
||||||
|
const int extruder_idx = selection < 0 || selection >= static_cast<int>(opt->size()) ? 0 : selection;
|
||||||
|
|
||||||
const bool have_retract_length = dynamic_cast<ConfigOptionVectorBase *>(m_config->option("filament_retraction_length"))->is_nil(extruder_idx) ||
|
const bool have_retract_length = dynamic_cast<ConfigOptionVectorBase *>(m_config->option("filament_retraction_length"))->is_nil(extruder_idx) ||
|
||||||
m_config->opt_float("filament_retraction_length", extruder_idx) > 0;
|
m_config->opt_float("filament_retraction_length", extruder_idx) > 0;
|
||||||
|
|||||||
@@ -1211,8 +1211,10 @@ static wxString get_string_value(std::string opt_key, const DynamicPrintConfig&
|
|||||||
}
|
}
|
||||||
opt_idx = orig_opt_idx >= 0 ? orig_opt_idx : 0;
|
opt_idx = orig_opt_idx >= 0 ? orig_opt_idx : 0;
|
||||||
opt_key = get_pure_opt_key(opt_key);
|
opt_key = get_pure_opt_key(opt_key);
|
||||||
|
auto option = config.option(opt_key);
|
||||||
|
|
||||||
if (config.option(opt_key)->is_nil())
|
if (option->is_scalar() && config.option(opt_key)->is_nil() ||
|
||||||
|
option->is_vector() && dynamic_cast<const ConfigOptionVectorBase *>(config.option(opt_key))->is_nil(opt_idx))
|
||||||
return _L("N/A");
|
return _L("N/A");
|
||||||
|
|
||||||
wxString out;
|
wxString out;
|
||||||
|
|||||||
Reference in New Issue
Block a user