FIX:add error deal:mtl file lost some material

jira: github 5687
Change-Id: I2394d27b027cfe34ac3cb260735aceaee65ff6d9
(cherry picked from commit 58f9c7d0b2800c4b8b67991f5d3e43d57a6cd1eb)
This commit is contained in:
zhou.xu
2025-01-06 10:19:20 +08:00
committed by Noisyfox
parent e36e7089eb
commit 3e9a8b8b3a
7 changed files with 88 additions and 30 deletions

View File

@@ -918,6 +918,21 @@ static int construct_assemble_list(std::vector<assemble_plate_info_t> &assemble_
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(": failed to read a valid mesh from obj file %1%, plate index %2%, object index %3%, error %4%") % assemble_object.path % (index + 1) % (obj_index + 1) % message;
return CLI_DATA_FILE_ERROR;
}
if (obj_info.lost_material_name != "") {
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(": failed to read a valid mesh from obj file %1%, plate index %2%, object index %3%, mtl lost material: %4% ,please check mtl file") %
assemble_object.path % (index + 1) % (obj_index + 1) % obj_info.lost_material_name;
return CLI_DATA_FILE_ERROR;
}
if (obj_info.face_colors.size() > 0) {
auto temp0 = obj_info.face_colors.size();
auto temp1 = mesh.facets_count();
bool some_face_no_color = temp0 < temp1;
if (some_face_no_color) {
BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< boost::format(": failed to read a valid mesh from obj file %1%, plate index %2%, object index %3%, error:some_face_no_color,please check mtl file and obj file.") %
assemble_object.path % (index + 1) % (obj_index + 1);
return CLI_DATA_FILE_ERROR;
}
}
object_name.erase(object_name.end() - 4, object_name.end());
object_1_name = object_name + "_1";
//process colors