mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 10:51:22 +00:00
fix: the 3D scene is drawn in the wrong view for the first half second of startup (#15830)
This commit is contained in:
@@ -865,6 +865,9 @@ void GUI_App::post_init()
|
|||||||
plater_->canvas3D()->enable_render(false);
|
plater_->canvas3D()->enable_render(false);
|
||||||
mainframe->select_tab(TAB_ID_PREPARE);
|
mainframe->select_tab(TAB_ID_PREPARE);
|
||||||
plater_->select_view_3D("3D");
|
plater_->select_view_3D("3D");
|
||||||
|
// The first render happens before the queued new_project() sets the same view.
|
||||||
|
plater_->get_camera().select_view("topfront");
|
||||||
|
plater_->get_camera().requires_zoom_to_bed = true;
|
||||||
//BBS init the opengl resource here
|
//BBS init the opengl resource here
|
||||||
if (!plater_->canvas3D()->get_wxglcanvas()->IsShownOnScreen() ||
|
if (!plater_->canvas3D()->get_wxglcanvas()->IsShownOnScreen() ||
|
||||||
!plater_->canvas3D()->make_current_for_postinit()) {
|
!plater_->canvas3D()->make_current_for_postinit()) {
|
||||||
|
|||||||
@@ -7033,7 +7033,7 @@ struct Plater::priv
|
|||||||
void remove(size_t obj_idx);
|
void remove(size_t obj_idx);
|
||||||
bool delete_object_from_model(size_t obj_idx, bool refresh_immediately = true); //BBS
|
bool delete_object_from_model(size_t obj_idx, bool refresh_immediately = true); //BBS
|
||||||
void delete_all_objects_from_model();
|
void delete_all_objects_from_model();
|
||||||
void reset(bool apply_presets_change = false);
|
void reset(bool apply_presets_change = false, bool reload_presets = true);
|
||||||
void center_selection();
|
void center_selection();
|
||||||
void drop_selection();
|
void drop_selection();
|
||||||
void mirror(Axis axis);
|
void mirror(Axis axis);
|
||||||
@@ -7891,7 +7891,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
|||||||
|
|
||||||
if (this->q->get_project_filename().IsEmpty() && this->q->is_empty_project()) {
|
if (this->q->get_project_filename().IsEmpty() && this->q->is_empty_project()) {
|
||||||
int skip_confirm = e.GetInt();
|
int skip_confirm = e.GetInt();
|
||||||
this->q->new_project(skip_confirm, true);
|
// Skips the preset reload; trigger_restore_project()'s callers load the presets first.
|
||||||
|
this->q->new_project(skip_confirm, true, wxString(), false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//wxPostEvent(this->q, wxCommandEvent{EVT_RESTORE_PROJECT});
|
//wxPostEvent(this->q, wxCommandEvent{EVT_RESTORE_PROJECT});
|
||||||
@@ -10356,7 +10357,7 @@ void Plater::priv::delete_all_objects_from_model()
|
|||||||
model.plates_custom_gcodes.clear();
|
model.plates_custom_gcodes.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plater::priv::reset(bool apply_presets_change)
|
void Plater::priv::reset(bool apply_presets_change, bool reload_presets)
|
||||||
{
|
{
|
||||||
// TakeSnapshot below and load_current_presets() further down each re-evaluate the
|
// TakeSnapshot below and load_current_presets() further down each re-evaluate the
|
||||||
// aggregate dirty flag against a baseline that hasn't been reset yet, so they can toggle
|
// aggregate dirty flag against a baseline that hasn't been reset yet, so they can toggle
|
||||||
@@ -10431,7 +10432,7 @@ void Plater::priv::reset(bool apply_presets_change)
|
|||||||
wxGetApp().preset_bundle->reset_project_embedded_presets();
|
wxGetApp().preset_bundle->reset_project_embedded_presets();
|
||||||
if (apply_presets_change)
|
if (apply_presets_change)
|
||||||
wxGetApp().apply_keeped_preset_modifications();
|
wxGetApp().apply_keeped_preset_modifications();
|
||||||
else
|
else if (reload_presets)
|
||||||
wxGetApp().load_current_presets(false, false);
|
wxGetApp().load_current_presets(false, false);
|
||||||
|
|
||||||
//BBS
|
//BBS
|
||||||
@@ -15351,7 +15352,7 @@ Print& Plater::fff_print() { return p->fff_print; }
|
|||||||
const SLAPrint& Plater::sla_print() const { return p->sla_print; }
|
const SLAPrint& Plater::sla_print() const { return p->sla_print; }
|
||||||
SLAPrint& Plater::sla_print() { return p->sla_print; }
|
SLAPrint& Plater::sla_print() { return p->sla_print; }
|
||||||
|
|
||||||
int Plater::new_project(bool skip_confirm, bool silent, const wxString& project_name)
|
int Plater::new_project(bool skip_confirm, bool silent, const wxString& project_name, bool reload_presets)
|
||||||
{
|
{
|
||||||
model().calib_pa_pattern.reset(nullptr);
|
model().calib_pa_pattern.reset(nullptr);
|
||||||
model().plates_custom_gcodes.clear();
|
model().plates_custom_gcodes.clear();
|
||||||
@@ -15399,7 +15400,7 @@ int Plater::new_project(bool skip_confirm, bool silent, const wxString& project_
|
|||||||
// completes, so hold notifications until then to avoid firing on transient flips.
|
// completes, so hold notifications until then to avoid firing on transient flips.
|
||||||
ProjectDirtyStateManager::NotificationSuppressor dirty_notify_suppressor(p->dirty_state);
|
ProjectDirtyStateManager::NotificationSuppressor dirty_notify_suppressor(p->dirty_state);
|
||||||
|
|
||||||
reset(transfer_preset_changes);
|
reset(transfer_preset_changes, reload_presets);
|
||||||
reset_project_dirty_after_save();
|
reset_project_dirty_after_save();
|
||||||
reset_project_dirty_initial_presets();
|
reset_project_dirty_initial_presets();
|
||||||
wxGetApp().update_saved_preset_from_current_preset();
|
wxGetApp().update_saved_preset_from_current_preset();
|
||||||
@@ -17984,7 +17985,7 @@ void Plater::deselect_all() { p->deselect_all(); }
|
|||||||
void Plater::exit_gizmo() { p->exit_gizmo(); }
|
void Plater::exit_gizmo() { p->exit_gizmo(); }
|
||||||
|
|
||||||
void Plater::remove(size_t obj_idx) { p->remove(obj_idx); }
|
void Plater::remove(size_t obj_idx) { p->remove(obj_idx); }
|
||||||
void Plater::reset(bool apply_presets_change) { p->reset(apply_presets_change); }
|
void Plater::reset(bool apply_presets_change, bool reload_presets) { p->reset(apply_presets_change, reload_presets); }
|
||||||
void Plater::reset_with_confirm()
|
void Plater::reset_with_confirm()
|
||||||
{
|
{
|
||||||
if (p->model.objects.empty() || MessageDialog(static_cast<wxWindow *>(this), _L("All objects will be removed, continue?"),
|
if (p->model.objects.empty() || MessageDialog(static_cast<wxWindow *>(this), _L("All objects will be removed, continue?"),
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ public:
|
|||||||
// Helper: returns config indices where filament_is_mixed == false
|
// Helper: returns config indices where filament_is_mixed == false
|
||||||
std::vector<size_t> physical_filament_config_indices() const;
|
std::vector<size_t> physical_filament_config_indices() const;
|
||||||
|
|
||||||
int new_project(bool skip_confirm = false, bool silent = false, const wxString& project_name = wxString());
|
int new_project(bool skip_confirm = false, bool silent = false, const wxString& project_name = wxString(), bool reload_presets = true);
|
||||||
// BBS: save & backup
|
// BBS: save & backup
|
||||||
void load_project(wxString const & filename = "", wxString const & originfile = "-");
|
void load_project(wxString const & filename = "", wxString const & originfile = "-");
|
||||||
int save_project(bool saveAs = false);
|
int save_project(bool saveAs = false);
|
||||||
@@ -499,7 +499,7 @@ public:
|
|||||||
void deselect_all();
|
void deselect_all();
|
||||||
void exit_gizmo();
|
void exit_gizmo();
|
||||||
void remove(size_t obj_idx);
|
void remove(size_t obj_idx);
|
||||||
void reset(bool apply_presets_change = false);
|
void reset(bool apply_presets_change = false, bool reload_presets = true);
|
||||||
void reset_with_confirm();
|
void reset_with_confirm();
|
||||||
//BBS: return int for various result
|
//BBS: return int for various result
|
||||||
int close_with_confirm(std::function<bool(bool yes_or_no)> second_check = nullptr); // BBS close project
|
int close_with_confirm(std::function<bool(bool yes_or_no)> second_check = nullptr); // BBS close project
|
||||||
|
|||||||
Reference in New Issue
Block a user