37 using Alembic::AbcGeom::kWrapExisting;
38 using Alembic::AbcGeom::N3fArraySamplePtr;
39 using Alembic::AbcGeom::P3fArraySamplePtr;
41 using Alembic::AbcGeom::ICompoundProperty;
42 using Alembic::AbcGeom::IN3fArrayProperty;
43 using Alembic::AbcGeom::IPoints;
44 using Alembic::AbcGeom::IPointsSchema;
45 using Alembic::AbcGeom::ISampleSelector;
52 IPoints ipoints(
m_iobject, kWrapExisting);
53 m_schema = ipoints.getSchema();
59 return m_schema.valid();
63 const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
65 const char **err_str)
const
67 if (!Alembic::AbcGeom::IPoints::matches(alembic_header)) {
69 "Object type mismatch, Alembic object path pointed to Points when importing, but not any "
75 *err_str =
"Object type mismatch, Alembic object path points to Points.";
104 const ISampleSelector &selector,
107 Alembic::AbcGeom::IPointsSchema::Sample
sample = schema.getValue(selector);
109 const P3fArraySamplePtr &positions =
sample.getPositions();
111 ICompoundProperty prop = schema.getArbGeomParams();
112 N3fArraySamplePtr vnormals;
116 selector.getRequestedTime());
117 const IN3fArrayProperty &normals_prop = IN3fArrayProperty(prop,
"N", itime);
120 vnormals = normals_prop.getValue(selector);
128 const ISampleSelector &sample_sel,
130 const char **err_str)
132 IPointsSchema::Sample
sample;
134 sample = m_schema.getValue(sample_sel);
136 catch (Alembic::Util::Exception &ex) {
137 *err_str =
"Error reading points sample; more detail on the console";
138 printf(
"Alembic: error reading points sample for '%s/%s' at time %f: %s\n",
140 m_schema.getName().c_str(),
141 sample_sel.getRequestedTime(),
143 return existing_mesh;
146 const P3fArraySamplePtr &positions =
sample.getPositions();
148 Mesh *new_mesh =
nullptr;
150 if (existing_mesh->
totvert != positions->size()) {
154 Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh;
159 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)
struct Mesh * BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
bool BKE_mesh_validate(struct Mesh *me, const bool do_verbose, const bool cddata_check_mask)
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_add_only_object(struct Main *bmain, int type, const char *name) ATTR_NONNULL(1) 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
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel)
struct Mesh * read_mesh(struct Mesh *existing_mesh, const Alembic::Abc::ISampleSelector &sample_sel, int read_flag, const char **err_str)
AbcPointsReader(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
static void sample(SocketReader *reader, int x, int y, float color[4])
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)