21 using Alembic::AbcGeom::kWrapExisting;
22 using Alembic::AbcGeom::N3fArraySamplePtr;
23 using Alembic::AbcGeom::P3fArraySamplePtr;
25 using Alembic::AbcGeom::ICompoundProperty;
26 using Alembic::AbcGeom::IN3fArrayProperty;
27 using Alembic::AbcGeom::IPoints;
28 using Alembic::AbcGeom::IPointsSchema;
29 using Alembic::AbcGeom::ISampleSelector;
36 IPoints ipoints(
m_iobject, kWrapExisting);
37 m_schema = ipoints.getSchema();
43 return m_schema.valid();
47 const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
49 const char **err_str)
const
51 if (!Alembic::AbcGeom::IPoints::matches(alembic_header)) {
53 "Object type mismatch, Alembic object path pointed to Points when importing, but not any "
59 *err_str =
"Object type mismatch, Alembic object path points to Points.";
88 const ISampleSelector &selector,
91 Alembic::AbcGeom::IPointsSchema::Sample
sample = schema.getValue(selector);
95 ICompoundProperty prop = schema.getArbGeomParams();
96 N3fArraySamplePtr vnormals;
100 selector.getRequestedTime());
101 const IN3fArrayProperty &normals_prop = IN3fArrayProperty(prop,
"N", itime);
104 vnormals = normals_prop.getValue(selector);
112 const ISampleSelector &sample_sel,
116 const char **err_str)
118 IPointsSchema::Sample
sample;
120 sample = m_schema.getValue(sample_sel);
122 catch (Alembic::Util::Exception &ex) {
123 *err_str =
"Error reading points sample; more detail on the console";
124 printf(
"Alembic: error reading points sample for '%s/%s' at time %f: %s\n",
126 m_schema.getName().c_str(),
127 sample_sel.getRequestedTime(),
129 return existing_mesh;
134 Mesh *new_mesh =
nullptr;
140 Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh;
145 return mesh_to_export;
CustomData interface, see also DNA_customdata_types.h.
const CustomData_MeshMasks CD_MASK_MESH
void BKE_mesh_nomain_to_mesh(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct Object *ob, const struct CustomData_MeshMasks *mask, bool take_ownership)
struct Mesh * BKE_mesh_add(struct Main *bmain, const char *name)
bool BKE_mesh_validate(struct Mesh *me, bool do_verbose, bool cddata_check_mask)
struct Mesh * BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_add_only_object(struct Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
@ MOD_MESHSEQ_INTERPOLATE_VERTICES
Object is a sort of wrapper for general info.
std::string m_object_name
Alembic::Abc::IObject m_iobject
ImportSettings * m_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
AbcPointsReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
bool valid() const 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
void get_min_max_time(const Alembic::AbcGeom::IObject &object, const Schema &schema, chrono_t &min, chrono_t &max)
CDStreamConfig get_config(Mesh *mesh, const bool use_vertex_interpolation)
static void read_mverts(CDStreamConfig &config, const AbcMeshData &mesh_data)
bool has_property(const Alembic::Abc::ICompoundProperty &prop, const std::string &name)
void read_points_sample(const IPointsSchema &schema, const ISampleSelector &selector, CDStreamConfig &config)
bool has_animations(Alembic::AbcGeom::IPolyMeshSchema &schema, ImportSettings *settings)
MutableSpan< float3 > positions
bool always_add_cache_reader