Blender  V3.3
abc_reader_mesh.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #pragma once
3 
8 #include "abc_customdata.h"
9 #include "abc_reader_object.h"
10 
11 struct Mesh;
12 
13 namespace blender::io::alembic {
14 
16  Alembic::AbcGeom::IPolyMeshSchema m_schema;
17 
18  public:
19  AbcMeshReader(const Alembic::Abc::IObject &object, ImportSettings &settings);
20 
21  bool valid() const override;
22  bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
23  const Object *const ob,
24  const char **err_str) const override;
25  void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
26 
27  struct Mesh *read_mesh(struct Mesh *existing_mesh,
28  const Alembic::Abc::ISampleSelector &sample_sel,
29  int read_flag,
30  const char *velocity_name,
31  float velocity_scale,
32  const char **err_str) override;
33  bool topology_changed(const Mesh *existing_mesh,
34  const Alembic::Abc::ISampleSelector &sample_sel) override;
35 
36  private:
37  void readFaceSetsSample(Main *bmain,
38  Mesh *mesh,
39  const Alembic::AbcGeom::ISampleSelector &sample_sel);
40 
41  void assign_facesets_to_mpoly(const Alembic::Abc::ISampleSelector &sample_sel,
42  MPoly *mpoly,
43  int totpoly,
44  std::map<std::string, int> &r_mat_map);
45 };
46 
48  Alembic::AbcGeom::ISubDSchema m_schema;
49 
50  public:
51  AbcSubDReader(const Alembic::Abc::IObject &object, ImportSettings &settings);
52 
53  bool valid() const override;
54  bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
55  const Object *const ob,
56  const char **err_str) const override;
57  void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
58  struct Mesh *read_mesh(struct Mesh *existing_mesh,
59  const Alembic::Abc::ISampleSelector &sample_sel,
60  int read_flag,
61  const char *velocity_name,
62  float velocity_scale,
63  const char **err_str) override;
64 };
65 
67  const Alembic::AbcGeom::P3fArraySamplePtr positions,
68  const Alembic::AbcGeom::N3fArraySamplePtr normals);
69 
70 CDStreamConfig get_config(struct Mesh *mesh, bool use_vertex_interpolation);
71 
72 } // namespace blender::io::alembic
#define final(a, b, c)
Definition: BLI_hash.h:21
struct Mesh * read_mesh(struct Mesh *existing_mesh, const Alembic::Abc::ISampleSelector &sample_sel, int read_flag, const char *velocity_name, float velocity_scale, const char **err_str) override
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header, const Object *const ob, const char **err_str) const override
bool topology_changed(const Mesh *existing_mesh, const Alembic::Abc::ISampleSelector &sample_sel) override
AbcMeshReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
struct Mesh * read_mesh(struct Mesh *existing_mesh, const Alembic::Abc::ISampleSelector &sample_sel, int read_flag, const char *velocity_name, float velocity_scale, const char **err_str) override
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override
AbcSubDReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header, const Object *const ob, const char **err_str) const override
CDStreamConfig get_config(Mesh *mesh, const bool use_vertex_interpolation)
static void read_mverts(CDStreamConfig &config, const AbcMeshData &mesh_data)
MutableSpan< float3 > positions
MutableSpan< float3 > normals
Definition: BKE_main.h:121
int totpoly
struct MPoly * mpoly