Blender V5.0
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
8
9#pragma once
10
11#include "BLI_utility_mixins.hh"
12
13#include "IO_wavefront_obj.hh"
14#include "obj_import_mtl.hh"
15#include "obj_import_objects.hh"
16
17struct Main;
18struct Mesh;
19struct Material;
20struct Object;
21struct OBJImportParams;
22
23namespace blender::io::obj {
24
29 private:
30 Geometry &mesh_geometry_;
31 const GlobalVertices &global_vertices_;
32
33 public:
34 MeshFromGeometry(Geometry &mesh_geometry, const GlobalVertices &global_vertices)
35 : mesh_geometry_(mesh_geometry), global_vertices_(global_vertices)
36 {
37 }
38
39 Mesh *create_mesh(const OBJImportParams &import_params);
40
42 Map<std::string, std::unique_ptr<MTLMaterial>> &materials,
43 Map<std::string, Material *> &created_materials,
44 const OBJImportParams &import_params);
45
46 private:
52 void fixup_invalid_faces();
53 void create_vertices(Mesh *mesh);
57 void create_faces(Mesh *mesh, bool use_vertex_groups);
61 void create_edges(Mesh *mesh);
65 void create_uv_verts(Mesh *mesh);
69 void create_materials(Main *bmain,
70 Map<std::string, std::unique_ptr<MTLMaterial>> &materials,
71 Map<std::string, Material *> &created_materials,
72 Object *obj,
73 bool relative_paths,
74 eOBJMtlNameCollisionMode mtl_name_collision_mode);
75 void create_normals(Mesh *mesh);
76 void create_colors(Mesh *mesh);
77 void create_vertex_groups(Object *obj);
78
79 bool has_normals() const;
80};
81
82} // namespace blender::io::obj
eOBJMtlNameCollisionMode
NonCopyable(const NonCopyable &other)=delete
NonMovable(NonMovable &&other)=delete
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)