FIX:Thumbnail render should use light in "obj import" dialog

jira: none
Change-Id: I1457876a12f42abd93d26cebb60d2d7d8075df74
(cherry picked from commit 7768570492a59afdac0add126bceb6cf0d86b210)
This commit is contained in:
zhou.xu 2025-03-18 19:16:25 +08:00 committed by Noisyfox
parent 0c5c3410d6
commit cc12de18e0
3 changed files with 9 additions and 3 deletions

View file

@ -3098,7 +3098,9 @@ bool Model::obj_import_face_color_deal(const std::vector<unsigned char> &face_fi
for (size_t i = 0; i < volume->mesh().its.indices.size(); i++) {
auto face = volume->mesh().its.indices[i];
auto filament_id = face_filament_ids[i];
if (filament_id <= 1) { continue; }
if (filament_id < 1) {
continue;
}
std::string result;
get_real_filament_id(filament_id, result);
volume->mmu_segmentation_facets.set_triangle_from_string(i, result);

View file

@ -512,7 +512,11 @@ void ObjColorPanel::update_filament_ids()
m_filament_ids.reserve(m_input_colors_size);
for (size_t i = 0; i < m_input_colors_size; i++) {
auto label = m_cluster_labels_from_algo[i];
m_filament_ids.emplace_back(m_cluster_map_filaments[label]);
if (m_cluster_map_filaments[label] > 0) {
m_filament_ids.emplace_back(m_cluster_map_filaments[label]);
} else {
m_filament_ids.emplace_back(1);//min filament_id is 1
}
}
m_first_extruder_id = m_cluster_map_filaments[0];
}

View file

@ -12120,7 +12120,7 @@ void Plater::update_obj_preview_thumbnail(ModelObject *mo, int obj_idx, int vol_
ModelObjectPtrs model_objects;
model_objects.emplace_back(mo);
get_view3D_canvas3D()->render_thumbnail(plate->obj_preview_thumbnail_data, colors, plate->plate_thumbnail_width, plate->plate_thumbnail_height, thumbnail_params,
model_objects, cur_volumes, Camera::EType::Ortho, (Camera::ViewAngleType) camera_view_angle_type, false, true);
model_objects, cur_volumes, Camera::EType::Ortho, (Camera::ViewAngleType) camera_view_angle_type, false, false);
}
//invalid all plate's thumbnails