Blender V5.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
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
17namespace blender {
18
19struct Main;
20struct Mesh;
21struct Material;
22struct Object;
23struct OBJImportParams;
24
25namespace io::obj {
26
31 private:
32 Geometry &mesh_geometry_;
33 const GlobalVertices &global_vertices_;
34
35 public:
36 MeshFromGeometry(Geometry &mesh_geometry, const GlobalVertices &global_vertices)
37 : mesh_geometry_(mesh_geometry), global_vertices_(global_vertices)
38 {
39 }
40
41 Mesh *create_mesh(const OBJImportParams &import_params);
42
44 Map<std::string, std::unique_ptr<MTLMaterial>> &materials,
45 Map<std::string, Material *> &created_materials,
46 const OBJImportParams &import_params);
47
48 private:
54 void fixup_invalid_faces();
55 void create_vertices(Mesh *mesh);
59 void create_faces(Mesh *mesh, bool use_vertex_groups);
63 void create_edges(Mesh *mesh);
67 void create_uv_verts(Mesh *mesh);
71 void create_materials(Main *bmain,
72 Map<std::string, std::unique_ptr<MTLMaterial>> &materials,
73 Map<std::string, Material *> &created_materials,
74 Object *obj,
75 bool relative_paths,
76 eOBJMtlNameCollisionMode mtl_name_collision_mode);
77 void create_normals(Mesh *mesh);
78 void create_colors(Mesh *mesh);
79 void create_vertex_groups(Mesh *mesh);
80
81 bool has_normals() const;
82};
83
84} // namespace io::obj
85} // namespace blender
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)
BMesh Iterators.