Do not show the wipe tower in 3D scene when only one extruder is used

This commit is contained in:
Lukas Matena 2023-05-26 13:51:12 +02:00
parent 4d272b09b1
commit ca3c6ecd9e
2 changed files with 16 additions and 13 deletions

View File

@ -2258,6 +2258,7 @@ void GCodeViewer::load_shells(const Print& print)
const WipeTowerData& wipe_tower_data = print.wipe_tower_data(extruders_count); const WipeTowerData& wipe_tower_data = print.wipe_tower_data(extruders_count);
const float depth = wipe_tower_data.depth; const float depth = wipe_tower_data.depth;
const float brim_width = wipe_tower_data.brim_width; const float brim_width = wipe_tower_data.brim_width;
if (depth != 0.)
m_shells.volumes.load_wipe_tower_preview(config.wipe_tower_x, config.wipe_tower_y, config.wipe_tower_width, depth, max_z, config.wipe_tower_cone_angle, config.wipe_tower_rotation_angle, m_shells.volumes.load_wipe_tower_preview(config.wipe_tower_x, config.wipe_tower_y, config.wipe_tower_width, depth, max_z, config.wipe_tower_cone_angle, config.wipe_tower_rotation_angle,
!print.is_step_done(psWipeTower), brim_width); !print.is_step_done(psWipeTower), brim_width);
} }

View File

@ -2559,19 +2559,21 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
// Height of a print (Show at least a slab). // Height of a print (Show at least a slab).
const double height = height_real < 0.f ? std::max(m_model->max_z(), 10.0) : height_real; const double height = height_real < 0.f ? std::max(m_model->max_z(), 10.0) : height_real;
#if ENABLE_OPENGL_ES if (depth != 0.) {
#if ENABLE_OPENGL_ES
int volume_idx_wipe_tower_new = m_volumes.load_wipe_tower_preview( int volume_idx_wipe_tower_new = m_volumes.load_wipe_tower_preview(
x, y, w, depth, (float)height, ca, a, !print->is_step_done(psWipeTower), x, y, w, depth, (float)height, ca, a, !print->is_step_done(psWipeTower),
bw, &m_wipe_tower_mesh); bw, &m_wipe_tower_mesh);
#else #else
int volume_idx_wipe_tower_new = m_volumes.load_wipe_tower_preview( int volume_idx_wipe_tower_new = m_volumes.load_wipe_tower_preview(
x, y, w, depth, (float)height, ca, a, !print->is_step_done(psWipeTower), x, y, w, depth, (float)height, ca, a, !print->is_step_done(psWipeTower),
bw); bw);
#endif // ENABLE_OPENGL_ES #endif // ENABLE_OPENGL_ES
if (volume_idx_wipe_tower_old != -1) if (volume_idx_wipe_tower_old != -1)
map_glvolume_old_to_new[volume_idx_wipe_tower_old] = volume_idx_wipe_tower_new; map_glvolume_old_to_new[volume_idx_wipe_tower_old] = volume_idx_wipe_tower_new;
} }
} }
}
update_volumes_colors_by_extruder(); update_volumes_colors_by_extruder();
// Update selection indices based on the old/new GLVolumeCollection. // Update selection indices based on the old/new GLVolumeCollection.