NEW:add "obj preview thumnailData" function

jira: none

Change-Id: I688c2f05bf85fca376418115acddb5066ef980eb
(cherry picked from commit 16f2b2bcb5fd157f25aa7012dabd99a8d31aec07)
(cherry picked from commit 7cc21b5e9745a84d75ea13b66f5653520bb1cba3)
This commit is contained in:
zhou.xu
2024-11-05 14:52:12 +08:00
committed by Noisyfox
parent d4d86a5966
commit 926c22b797
13 changed files with 492 additions and 162 deletions

View File

@@ -7,7 +7,6 @@ namespace Slic3r {
class TriangleMesh;
class Model;
class ModelObject;
typedef std::function<void(std::vector<RGBA> &input_colors, bool is_single_color, std::vector<unsigned char> &filament_ids, unsigned char &first_extruder_id)> ObjImportColorFn;
// Load an OBJ file into a provided model.
struct ObjInfo {
std::vector<RGBA> vertex_colors;
@@ -20,6 +19,17 @@ struct ObjInfo {
bool has_uv_png{false};
};
struct ObjDialogInOut
{ // input:colors array
std::vector<RGBA> input_colors;
bool is_single_color{false};
// colors array output:
std::vector<unsigned char> filament_ids;
unsigned char first_extruder_id;
bool deal_vertex_color;
Model * model{nullptr};
};
typedef std::function<void(ObjDialogInOut &in_out)> ObjImportColorFn;
extern bool load_obj(const char *path, TriangleMesh *mesh, ObjInfo &vertex_colors, std::string &message);
extern bool load_obj(const char *path, Model *model, ObjInfo &vertex_colors, std::string &message, const char *object_name = nullptr);