Blender V4.3
obj_import_mesh.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include "BLI_utility_mixins.hh"
12
13#include "obj_import_mtl.hh"
14#include "obj_import_objects.hh"
15
16struct Main;
17struct Mesh;
18struct Material;
19struct Object;
20
21namespace blender::io::obj {
22
27 private:
28 Geometry &mesh_geometry_;
29 const GlobalVertices &global_vertices_;
30
31 public:
32 MeshFromGeometry(Geometry &mesh_geometry, const GlobalVertices &global_vertices)
33 : mesh_geometry_(mesh_geometry), global_vertices_(global_vertices)
34 {
35 }
36
37 Mesh *create_mesh(const OBJImportParams &import_params);
38
40 Map<std::string, std::unique_ptr<MTLMaterial>> &materials,
41 Map<std::string, Material *> &created_materials,
42 const OBJImportParams &import_params);
43
44 private:
50 void fixup_invalid_faces();
51 void create_vertices(Mesh *mesh);
55 void create_faces(Mesh *mesh, bool use_vertex_groups);
59 void create_edges(Mesh *mesh);
63 void create_uv_verts(Mesh *mesh);
67 void create_materials(Main *bmain,
68 Map<std::string, std::unique_ptr<MTLMaterial>> &materials,
69 Map<std::string, Material *> &created_materials,
70 Object *obj,
71 bool relative_paths);
72 void create_normals(Mesh *mesh);
73 void create_colors(Mesh *mesh);
74 void create_vertex_groups(Object *obj);
75
76 bool has_normals() const;
77};
78
79} // namespace blender::io::obj
MeshFromGeometry(Geometry &mesh_geometry, const GlobalVertices &global_vertices)
Mesh * create_mesh(const OBJImportParams &import_params)
Object * create_mesh_object(Main *bmain, Map< std::string, std::unique_ptr< MTLMaterial > > &materials, Map< std::string, Material * > &created_materials, const OBJImportParams &import_params)