FIX: fix the assemble view display issue when enter firstly

Change-Id: Idf432df9d3bb8eef1d57b08b6d345bc1867fe955
This commit is contained in:
lane.wei authored and Lane.Wei committed 2022-12-15 04:38:15 -05:00
1 parent 41b1ad6f2f
commit f2aaddebb8
5 files changed
+13 -6

No files matched your search

+8 -2
View File
@@ -1050,7 +1050,8 @@ int GLVolumeCollection::load_object_volume(
int volume_idx,
int instance_idx,
const std::string &color_by,
bool opengl_initialized)
bool opengl_initialized,
bool in_assemble_view)
{
const ModelVolume *model_volume = model_object->volumes[volume_idx];
const int extruder_id = model_volume->extruder_id();
@@ -1078,7 +1079,12 @@ int GLVolumeCollection::load_object_volume(
}
v.is_modifier = !model_volume->is_model_part();
v.shader_outside_printer_detection_enabled = model_volume->is_model_part();
v.set_instance_transformation(instance->get_transformation());
if (in_assemble_view) {
v.set_instance_transformation(instance->get_assemble_transformation());
v.set_offset_to_assembly(instance->get_offset_to_assembly());
}
else
v.set_instance_transformation(instance->get_transformation());
v.set_volume_transformation(model_volume->get_transformation());
return int(this->volumes.size() - 1);
+2 -1
View File
@@ -632,7 +632,8 @@ public:
int volume_idx,
int instance_idx,
const std::string &color_by,
bool opengl_initialized);
bool opengl_initialized,
bool in_assemble_view = false);
// Load SLA auxiliary GLVolumes (for support trees or pad).
void load_object_auxiliary(
+1 -1
View File
@@ -2396,7 +2396,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
// Note the index of the loaded volume, so that we can reload the main model GLVolume with the hollowed mesh
// later in this function.
it->volume_idx = m_volumes.volumes.size();
m_volumes.load_object_volume(&model_object, obj_idx, volume_idx, instance_idx, m_color_by, m_initialized);
m_volumes.load_object_volume(&model_object, obj_idx, volume_idx, instance_idx, m_color_by, m_initialized, m_canvas_type == ECanvasType::CanvasAssembleView);
m_volumes.volumes.back()->geometry_id = key.geometry_id;
update_object_list = true;
} else {