36using Alembic::Abc::FloatArraySamplePtr;
37using Alembic::Abc::Int32ArraySamplePtr;
38using Alembic::Abc::P3fArraySamplePtr;
39using Alembic::Abc::PropertyHeader;
40using Alembic::Abc::V3fArraySamplePtr;
42using Alembic::AbcGeom::IC3fGeomParam;
43using Alembic::AbcGeom::IC4fGeomParam;
44using Alembic::AbcGeom::IFaceSet;
45using Alembic::AbcGeom::IFaceSetSchema;
46using Alembic::AbcGeom::IN3fGeomParam;
47using Alembic::AbcGeom::IObject;
48using Alembic::AbcGeom::IPolyMesh;
49using Alembic::AbcGeom::IPolyMeshSchema;
50using Alembic::AbcGeom::ISampleSelector;
51using Alembic::AbcGeom::ISubD;
52using Alembic::AbcGeom::ISubDSchema;
53using Alembic::AbcGeom::IV2fGeomParam;
54using Alembic::AbcGeom::kWrapExisting;
55using Alembic::AbcGeom::N3fArraySample;
56using Alembic::AbcGeom::N3fArraySamplePtr;
57using Alembic::AbcGeom::UInt32ArraySamplePtr;
58using Alembic::AbcGeom::V2fArraySamplePtr;
69 std::map<std::string, Material *> mat_map;
71 mat_map[material->id.name + 2] =
material;
78 const std::map<std::string, int> &mat_index_map)
80 std::map<std::string, int>::const_iterator it;
81 if (mat_index_map.size() >
MAXMAT) {
86 std::map<std::string, Material *>::iterator mat_iter;
88 for (it = mat_index_map.begin(); it != mat_index_map.end(); ++it) {
89 const std::string mat_name = it->first;
90 const int mat_index = it->second;
93 mat_iter = matname_to_material.find(mat_name);
94 if (mat_iter == matname_to_material.end()) {
97 matname_to_material[mat_name] = assigned_mat;
100 assigned_mat = mat_iter->second;
128 const P3fArraySamplePtr &positions,
129 const P3fArraySamplePtr &ceil_positions,
133 for (
int i = 0; i < positions->size(); i++) {
134 const Imath::V3f &floor_pos = (*positions)[i];
135 const Imath::V3f &ceil_pos = (*ceil_positions)[i];
137 interp_v3_v3v3(tmp, floor_pos.getValue(), ceil_pos.getValue(),
float(weight));
145 const P3fArraySamplePtr &positions = mesh_data.
positions;
150 "AbcMeshData does not have ceil positions although it has some interpolation settings.");
154 config.
mesh->tag_positions_changed();
161void read_mverts(
Mesh &mesh,
const P3fArraySamplePtr positions,
const N3fArraySamplePtr normals)
164 for (
int i = 0; i < positions->size(); i++) {
165 Imath::V3f pos_in = (*positions)[i];
169 mesh.tag_positions_changed();
174 Imath::V3f nor_in = (*normals)[i];
187 const Int32ArraySamplePtr &face_indices = mesh_data.
face_indices;
188 const Int32ArraySamplePtr &face_counts = mesh_data.
face_counts;
189 const V2fArraySamplePtr &uvs = mesh_data.
uvs;
190 const size_t uvs_size = uvs ==
nullptr ? 0 : uvs->size();
192 const UInt32ArraySamplePtr &uvs_indices = mesh_data.
uvs_indices;
194 const bool do_uvs = (mloopuvs && uvs && uvs_indices);
198 uint rev_loop_index = 0;
200 bool seen_invalid_geometry =
false;
202 for (
int i = 0; i < face_counts->size(); i++) {
203 const int face_size = (*face_counts)[i];
205 face_offsets[i] = loop_index;
211 rev_loop_index = loop_index + (face_size - 1);
213 uint last_vertex_index = 0;
214 for (
int f = 0; f < face_size; f++, loop_index++, rev_loop_index--) {
215 const int vert = (*face_indices)[loop_index];
216 corner_verts[rev_loop_index] = vert;
218 if (f > 0 && vert == last_vertex_index) {
221 seen_invalid_geometry =
true;
223 last_vertex_index = vert;
226 uv_index = (*uvs_indices)[do_uvs_per_loop ? loop_index : last_vertex_index];
229 if (uv_index >= uvs_size) {
233 mloopuvs[rev_loop_index][0] = (*uvs)[uv_index][0];
234 mloopuvs[rev_loop_index][1] = (*uvs)[uv_index][1];
240 if (seen_invalid_geometry) {
255 size_t loop_count = loop_normals_ptr->size();
257 if (loop_count == 0) {
263 if (loop_count != mesh->corners_num) {
272 float(*lnors)[3] =
static_cast<float(*)[3]
>(
276 const N3fArraySample &loop_normals = *loop_normals_ptr;
278 for (
int i = 0,
e = mesh->faces_num; i <
e; i++) {
281 for (
int j = face.size() - 1; j >= 0; j--, abc_index++) {
282 int blender_index = face[j];
293 const N3fArraySamplePtr vertex_normals_ptr)
295 size_t normals_count = vertex_normals_ptr->size();
296 if (normals_count == 0) {
301 float(*vert_normals)[3] =
static_cast<float(*)[3]
>(
304 const N3fArraySample &vertex_normals = *vertex_normals_ptr;
305 for (
int index = 0; index < normals_count; index++) {
314 const IN3fGeomParam &normals,
315 const ISampleSelector &selector)
317 if (!normals.valid()) {
322 IN3fGeomParam::Sample normsamp = normals.getExpandedValue(selector);
323 Alembic::AbcGeom::GeometryScope scope = normals.getScope();
326 case Alembic::AbcGeom::kFacevaryingScope:
329 case Alembic::AbcGeom::kVertexScope:
330 case Alembic::AbcGeom::kVaryingScope:
333 case Alembic::AbcGeom::kConstantScope:
334 case Alembic::AbcGeom::kUniformScope:
335 case Alembic::AbcGeom::kUnknownScope:
343 const IV2fGeomParam &uv,
344 const ISampleSelector &selector)
350 IV2fGeomParam::Sample uvsamp;
351 uv.getIndexed(uvsamp, selector);
353 UInt32ArraySamplePtr uvs_indices = uvsamp.getIndices();
362 abc_data.
uvs = uvsamp.getVals();
365 std::string name = Alembic::Abc::GetSourceName(uv.getMetaData());
388 &mesh->corner_data, cd_data_type, name, mesh->corners_num);
389 if (cd_ptr !=
nullptr) {
395 int numloops = mesh->corners_num;
397 &mesh->corner_data, cd_data_type,
CD_SET_DEFAULT, numloops, name);
401template<
typename SampleType>
404 const P3fArraySamplePtr &positions =
sample.getPositions();
405 const Alembic::Abc::Int32ArraySamplePtr &face_indices =
sample.getFaceIndices();
406 const Alembic::Abc::Int32ArraySamplePtr &face_counts =
sample.getFaceCounts();
408 const P3fArraySamplePtr &ceil_positions = ceil_sample.getPositions();
409 const Alembic::Abc::Int32ArraySamplePtr &ceil_face_indices = ceil_sample.getFaceIndices();
410 const Alembic::Abc::Int32ArraySamplePtr &ceil_face_counts = ceil_sample.getFaceCounts();
413 const bool different_counters = positions->size() != ceil_positions->size() ||
414 face_counts->size() != ceil_face_counts->size() ||
415 face_indices->size() != ceil_face_indices->size();
416 if (different_counters) {
423 if (memcmp(face_counts->get(), ceil_face_counts->get(), face_counts->size() *
sizeof(
int))) {
427 if (memcmp(face_indices->get(), ceil_face_indices->get(), face_indices->size() *
sizeof(
int))) {
436 const IPolyMeshSchema &schema,
437 const ISampleSelector &selector,
440 const IPolyMeshSchema::Sample
sample = schema.getValue(selector);
447 const std::optional<SampleInterpolationSettings> interpolation_settings =
449 selector, schema.getTimeSampling(), schema.getNumSamples());
452 if (use_vertex_interpolation && interpolation_settings.has_value()) {
453 Alembic::AbcGeom::IPolyMeshSchema::Sample ceil_sample;
454 schema.get(ceil_sample, Alembic::Abc::ISampleSelector(interpolation_settings->ceil_index));
463 read_uvs_params(config, abc_mesh_data, schema.getUVsParam(), selector);
477 read_custom_data(iobject_full_name, schema.getArbGeomParams(), config, selector);
480 if (!settings->velocity_name.empty() && settings->velocity_scale != 0.0f) {
481 V3fArraySamplePtr velocities =
get_velocity_prop(schema, selector, settings->velocity_name);
492 config.
positions = mesh->vert_positions_for_write().data();
493 config.
corner_verts = mesh->corner_verts_for_write().data();
494 config.
face_offsets = mesh->face_offsets_for_write().data();
495 config.
totvert = mesh->verts_num;
496 config.
totloop = mesh->corners_num;
498 config.
loopdata = &mesh->corner_data;
511 IPolyMesh ipoly_mesh(
m_iobject, kWrapExisting);
512 m_schema = ipoly_mesh.getSchema();
519 return m_schema.valid();
522template<
class typedGeomParam>
525 if (!typedGeomParam::matches(prop_header)) {
529 typedGeomParam geom_param(arbGeomParams, prop_header.getName());
530 return geom_param.valid() && !geom_param.isConstant();
535 if (!arbGeomParams.valid()) {
539 const int num_props = arbGeomParams.getNumProperties();
540 for (
int i = 0; i < num_props; i++) {
541 const PropertyHeader &prop_header = arbGeomParams.getPropertyHeader(i);
558 if (settings->is_sequence || !schema.isConstant()) {
562 IV2fGeomParam uvsParam = schema.getUVsParam();
563 if (uvsParam.valid() && !uvsParam.isConstant()) {
567 IN3fGeomParam normalsParam = schema.getNormalsParam();
568 if (normalsParam.valid() && !normalsParam.isConstant()) {
572 ICompoundProperty arbGeomParams = schema.getArbGeomParams();
596 readFaceSetsSample(bmain, mesh, sample_sel);
604 const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
606 const char **r_err_str)
const
608 if (!Alembic::AbcGeom::IPolyMesh::matches(alembic_header)) {
610 "Object type mismatch, Alembic object path pointed to PolyMesh when importing, but not "
616 *r_err_str =
RPT_(
"Object type mismatch, Alembic object path points to PolyMesh");
625 IPolyMeshSchema::Sample
sample;
627 sample = m_schema.getValue(sample_sel);
629 catch (Alembic::Util::Exception &ex) {
630 printf(
"Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n",
632 m_schema.getName().c_str(),
633 sample_sel.getRequestedTime(),
639 const P3fArraySamplePtr &positions =
sample.getPositions();
640 const Alembic::Abc::Int32ArraySamplePtr &face_indices =
sample.getFaceIndices();
641 const Alembic::Abc::Int32ArraySamplePtr &face_counts =
sample.getFaceCounts();
644 const bool different_counters = positions->size() != existing_mesh->
verts_num ||
645 face_counts->size() != existing_mesh->
faces_num ||
646 face_indices->size() != existing_mesh->
corners_num;
647 if (different_counters) {
654 m_schema.getFaceCountsProperty().getNumSamples() == 1))
663 const int *mesh_corner_verts = existing_mesh->corner_verts().data();
664 const int *mesh_face_offsets = existing_mesh->face_offsets().data();
666 for (
int i = 0; i < face_counts->size(); i++) {
667 if (mesh_face_offsets[i] != abc_index) {
671 const int abc_face_size = (*face_counts)[i];
673 uint rev_loop_index = abc_index + (abc_face_size - 1);
674 for (
int f = 0; f < abc_face_size; f++, abc_index++, rev_loop_index--) {
675 const int mesh_vert = mesh_corner_verts[rev_loop_index];
676 const int abc_vert = (*face_indices)[abc_index];
687 const Alembic::Abc::ISampleSelector &sample_sel,
689 const char *velocity_name,
690 const float velocity_scale,
691 const char **r_err_str)
695 if (mesh ==
nullptr) {
700 mesh, sample_sel, read_flag, velocity_name, velocity_scale, r_err_str);
706 const ISampleSelector &sample_sel,
708 const char *velocity_name,
709 const float velocity_scale,
710 const char **r_err_str)
712 IPolyMeshSchema::Sample
sample;
714 sample = m_schema.getValue(sample_sel);
716 catch (Alembic::Util::Exception &ex) {
717 if (r_err_str !=
nullptr) {
718 *r_err_str =
RPT_(
"Error reading mesh sample; more detail on the console");
720 printf(
"Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n",
722 m_schema.getName().c_str(),
723 sample_sel.getRequestedTime(),
725 return existing_mesh;
728 const P3fArraySamplePtr &positions =
sample.getPositions();
729 const Alembic::Abc::Int32ArraySamplePtr &face_indices =
sample.getFaceIndices();
730 const Alembic::Abc::Int32ArraySamplePtr &face_counts =
sample.getFaceCounts();
733 const int poly_count = face_counts->size();
734 const int loop_count = face_indices->size();
736 if (poly_count > 0 && loop_count < poly_count * 2) {
737 if (r_err_str !=
nullptr) {
738 *r_err_str =
RPT_(
"Invalid mesh; more detail on the console");
740 printf(
"Alembic: invalid mesh sample for '%s/%s' at time %f, less than 2 loops per face\n",
742 m_schema.getName().c_str(),
743 sample_sel.getRequestedTime());
744 return existing_mesh;
747 Mesh *new_mesh =
nullptr;
752 settings.velocity_name = velocity_name;
753 settings.velocity_scale = velocity_scale;
757 existing_mesh, positions->size(), 0, face_counts->size(), face_indices->size());
765 if (face_counts->size() != existing_mesh->
faces_num ||
766 face_indices->size() != existing_mesh->
corners_num)
772 "Topology has changed, perhaps by triangulating the mesh. Only vertices will be "
778 Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh;
780 config.
time = sample_sel.getRequestedTime();
791 std::map<std::string, int> mat_map;
795 assign_facesets_to_material_indices(sample_sel, material_indices.
span, mat_map);
796 material_indices.
finish();
802 return existing_mesh;
805void AbcMeshReader::assign_facesets_to_material_indices(
const ISampleSelector &sample_sel,
807 std::map<std::string, int> &r_mat_map)
809 std::vector<std::string> face_sets;
810 m_schema.getFaceSetNames(face_sets);
812 if (face_sets.empty()) {
818 for (
const std::string &grp_name : face_sets) {
819 if (r_mat_map.find(grp_name) == r_mat_map.end()) {
820 r_mat_map[grp_name] = ++current_mat;
823 const int assigned_mat = r_mat_map[grp_name];
825 const IFaceSet faceset = m_schema.getFaceSet(grp_name);
827 if (!faceset.valid()) {
828 std::cerr <<
" Face set " << grp_name <<
" invalid for " <<
m_object_name <<
"\n";
832 const IFaceSetSchema face_schem = faceset.getSchema();
833 const IFaceSetSchema::Sample face_sample = face_schem.getValue(sample_sel);
834 const Int32ArraySamplePtr group_faces = face_sample.getFaces();
835 const size_t num_group_faces = group_faces->size();
837 for (
size_t l = 0;
l < num_group_faces;
l++) {
838 size_t pos = (*group_faces)[
l];
840 if (
pos >= material_indices.
size()) {
841 std::cerr <<
"Faceset overflow on " << faceset.getName() <<
'\n';
845 material_indices[
pos] = assigned_mat - 1;
850void AbcMeshReader::readFaceSetsSample(
Main *bmain,
Mesh *mesh,
const ISampleSelector &sample_sel)
852 std::map<std::string, int> mat_map;
853 bke::MutableAttributeAccessor attributes = mesh->attributes_for_write();
854 bke::SpanAttributeWriter<int> material_indices = attributes.lookup_or_add_for_write_span<
int>(
856 assign_facesets_to_material_indices(sample_sel, material_indices.span, mat_map);
857 material_indices.finish();
865 const ISubDSchema &schema,
866 const ISampleSelector &selector,
869 const ISubDSchema::Sample
sample = schema.getValue(selector);
876 const std::optional<SampleInterpolationSettings> interpolation_settings =
878 selector, schema.getTimeSampling(), schema.getNumSamples());
881 if (use_vertex_interpolation && interpolation_settings.has_value()) {
882 Alembic::AbcGeom::ISubDSchema::Sample ceil_sample;
883 schema.get(ceil_sample, Alembic::Abc::ISampleSelector(interpolation_settings->ceil_index));
892 read_uvs_params(config, abc_mesh_data, schema.getUVsParam(), selector);
908 read_custom_data(iobject_full_name, schema.getArbGeomParams(), config, selector);
911 if (!settings->velocity_name.empty() && settings->velocity_scale != 0.0f) {
912 V3fArraySamplePtr velocities =
get_velocity_prop(schema, selector, settings->velocity_name);
920 const Int32ArraySamplePtr &indices,
921 const FloatArraySamplePtr &sharpnesses)
923 if (!(indices && sharpnesses && indices->size() == sharpnesses->size() && indices->size() != 0))
930 const int totvert = mesh->verts_num;
932 for (
int i = 0,
v = indices->size(); i <
v; ++i) {
933 const int idx = (*indices)[i];
935 if (idx >= totvert) {
939 vertex_crease_data[idx] = (*sharpnesses)[i];
944 const Int32ArraySamplePtr &indices,
945 const FloatArraySamplePtr &sharpnesses)
947 if (!(indices && sharpnesses)) {
953 edge_hash.
reserve(edges.size());
958 for (
const int i : edges.index_range()) {
959 edge_hash.
add(edges[i], i);
962 for (
int i = 0, s = 0,
e = indices->size(); i <
e; i += 2, s++) {
963 int v1 = (*indices)[i];
964 int v2 = (*indices)[i + 1];
981 ISubD isubd_mesh(
m_iobject, kWrapExisting);
982 m_schema = isubd_mesh.getSchema();
989 return m_schema.valid();
993 const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
995 const char **r_err_str)
const
997 if (!Alembic::AbcGeom::ISubD::matches(alembic_header)) {
999 "Object type mismatch, Alembic object path pointed to SubD when importing, but not any "
1005 *r_err_str =
RPT_(
"Object type mismatch, Alembic object path points to SubD");
1020 if (read_mesh != mesh) {
1024 ISubDSchema::Sample
sample;
1026 sample = m_schema.getValue(sample_sel);
1028 catch (Alembic::Util::Exception &ex) {
1029 printf(
"Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n",
1031 m_schema.getName().c_str(),
1032 sample_sel.getRequestedTime(),
1050Mesh *AbcSubDReader::read_mesh(
Mesh *existing_mesh,
1051 const ISampleSelector &sample_sel,
1052 const int read_flag,
1053 const char *velocity_name,
1054 const float velocity_scale,
1055 const char **r_err_str)
1057 ISubDSchema::Sample
sample;
1059 sample = m_schema.getValue(sample_sel);
1061 catch (Alembic::Util::Exception &ex) {
1062 if (r_err_str !=
nullptr) {
1063 *r_err_str =
RPT_(
"Error reading mesh sample; more detail on the console");
1065 printf(
"Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n",
1067 m_schema.getName().c_str(),
1068 sample_sel.getRequestedTime(),
1070 return existing_mesh;
1073 const P3fArraySamplePtr &positions =
sample.getPositions();
1074 const Alembic::Abc::Int32ArraySamplePtr &face_indices =
sample.getFaceIndices();
1075 const Alembic::Abc::Int32ArraySamplePtr &face_counts =
sample.getFaceCounts();
1077 Mesh *new_mesh =
nullptr;
1080 settings.read_flag |= read_flag;
1081 settings.velocity_name = velocity_name;
1082 settings.velocity_scale = velocity_scale;
1084 if (existing_mesh->
verts_num != positions->size()) {
1086 existing_mesh, positions->size(), 0, face_counts->size(), face_indices->size());
1094 if (face_counts->size() != existing_mesh->
faces_num ||
1095 face_indices->size() != existing_mesh->
corners_num)
1101 "Topology has changed, perhaps by triangulating the mesh. Only vertices will be "
1108 Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh;
1109 CDStreamConfig config =
get_config(mesh_to_export);
1110 config.time = sample_sel.getRequestedTime();
1111 config.modifier_error_message = r_err_str;
1114 return mesh_to_export;
1118 const Alembic::Abc::ISampleSelector &sample_sel,
1119 const int read_flag,
1120 const char *velocity_name,
1121 const float velocity_scale,
1122 const char **r_err_str)
1126 if (mesh ==
nullptr) {
1130 Mesh *new_mesh = read_mesh(
1131 mesh, sample_sel, read_flag, velocity_name, velocity_scale, r_err_str);
CustomData interface, see also DNA_customdata_types.h.
void * CustomData_get_layer_named_for_write(CustomData *data, eCustomDataType type, blender::StringRef name, int totelem)
void * CustomData_add_layer_named(CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem, blender::StringRef name)
General operations, lookup, etc. for materials.
void BKE_object_material_assign_single_obdata(struct Main *bmain, struct Object *ob, struct Material *ma, short act)
struct Material * BKE_material_add(struct Main *bmain, const char *name)
void BKE_mesh_set_custom_normals(Mesh *mesh, float(*r_custom_loop_normals)[3])
Mesh * BKE_mesh_new_nomain_from_template(const Mesh *me_src, int verts_num, int edges_num, int faces_num, int corners_num)
bool BKE_mesh_validate(Mesh *mesh, bool do_verbose, bool cddata_check_mask)
void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, Mesh *mesh_dst, Object *ob)
Mesh * BKE_mesh_add(Main *bmain, const char *name)
void BKE_mesh_set_custom_normals_from_verts(Mesh *mesh, float(*r_custom_vert_normals)[3])
General operations, lookup, etc. for blender objects.
Object * BKE_object_add_only_object(Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
@ MOD_MESHSEQ_INTERPOLATE_VERTICES
#define MOD_MESHSEQ_READ_ALL
Object is a sort of wrapper for general info.
static NewVert * mesh_vert(VMesh *vm, int i, int j, int k)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
const Value * lookup_ptr(const Key &key) const
bool add(const Key &key, const Value &value)
constexpr int64_t size() const
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 **r_err_str)
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 **r_err_str) const override
void read_geometry(bke::GeometrySet &geometry_set, const Alembic::Abc::ISampleSelector &sample_sel, int read_flag, const char *velocity_name, float velocity_scale, const char **r_err_str) override
bool topology_changed(const Mesh *existing_mesh, const Alembic::Abc::ISampleSelector &sample_sel) override
bool valid() const override
AbcMeshReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
std::string m_object_name
Alembic::Abc::IObject m_iobject
bool m_is_reading_a_file_sequence
ImportSettings * m_settings
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header, const Object *const ob, const char **r_err_str) const override
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override
bool valid() const override
void read_geometry(bke::GeometrySet &geometry_set, const Alembic::Abc::ISampleSelector &sample_sel, int read_flag, const char *velocity_name, const float velocity_scale, const char **r_err_str) override
AbcSubDReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
draw_view in_light_buf[] float
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
#define unit_float_to_uchar_clamp(val)
void mesh_calc_edges(Mesh &mesh, bool keep_existing_edges, bool select_new_edges)
void mesh_vert_normals_assign(Mesh &mesh, Span< float3 > vert_normals)
static void assign_materials(Main *bmain, Object *ob, const std::map< std::string, int > &mat_index_map)
static std::map< std::string, Material * > build_material_map(const Main *bmain)
AbcUvScope get_uv_scope(const Alembic::AbcGeom::GeometryScope scope, const CDStreamConfig &config, const Alembic::AbcGeom::UInt32ArraySamplePtr &indices)
static void process_normals(CDStreamConfig &config, const IN3fGeomParam &normals, const ISampleSelector &selector)
void read_velocity(const V3fArraySamplePtr &velocities, const CDStreamConfig &config, const float velocity_scale)
void get_min_max_time(const Alembic::AbcGeom::IObject &object, const Schema &schema, chrono_t &min, chrono_t &max)
static void read_mesh_sample(const std::string &iobject_full_name, ImportSettings *settings, const IPolyMeshSchema &schema, const ISampleSelector &selector, CDStreamConfig &config)
BLI_INLINE void read_uvs_params(CDStreamConfig &config, AbcMeshData &abc_data, const IV2fGeomParam &uv, const ISampleSelector &selector)
static void read_mverts_interp(float3 *vert_positions, const P3fArraySamplePtr &positions, const P3fArraySamplePtr &ceil_positions, const double weight)
static void process_loop_normals(CDStreamConfig &config, const N3fArraySamplePtr loop_normals_ptr)
bool is_valid_animated(const ICompoundProperty arbGeomParams, const PropertyHeader &prop_header)
static CDStreamConfig get_config(Mesh *mesh)
static void read_vertex_creases(Mesh *mesh, const Int32ArraySamplePtr &indices, const FloatArraySamplePtr &sharpnesses)
static bool samples_have_same_topology(const SampleType &sample, const SampleType &ceil_sample)
BLI_INLINE void copy_zup_from_yup(float zup[3], const float yup[3])
static void process_vertex_normals(CDStreamConfig &config, const N3fArraySamplePtr vertex_normals_ptr)
void read_custom_data(const std::string &iobject_full_name, const ICompoundProperty &prop, const CDStreamConfig &config, const Alembic::Abc::ISampleSelector &iss)
static void read_mpolys(CDStreamConfig &config, const AbcMeshData &mesh_data)
static void read_edge_creases(Mesh *mesh, const Int32ArraySamplePtr &indices, const FloatArraySamplePtr &sharpnesses)
static void read_subd_sample(const std::string &iobject_full_name, ImportSettings *settings, const ISubDSchema &schema, const ISampleSelector &selector, CDStreamConfig &config)
static bool has_animated_geom_params(const ICompoundProperty arbGeomParams)
V3fArraySamplePtr get_velocity_prop(const Alembic::Abc::ICompoundProperty &schema, const Alembic::AbcGeom::ISampleSelector &selector, const std::string &name)
static void process_no_normals(CDStreamConfig &)
void read_generated_coordinates(const ICompoundProperty &prop, const CDStreamConfig &config, const Alembic::Abc::ISampleSelector &iss)
static void read_mverts(CDStreamConfig &config, const AbcMeshData &mesh_data)
bool has_animations(Alembic::AbcGeom::IPolyMeshSchema &schema, ImportSettings *settings)
std::optional< SampleInterpolationSettings > get_sample_interpolation_settings(const Alembic::AbcGeom::ISampleSelector &selector, const Alembic::AbcCoreAbstract::TimeSamplingPtr &time_sampling, size_t samples_number)
static void * add_customdata_cb(Mesh *mesh, const char *name, int data_type)
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Mesh * get_mesh_for_write()
MutableVArraySpan< T > span
P3fArraySamplePtr ceil_positions
Int32ArraySamplePtr face_indices
UInt32ArraySamplePtr uvs_indices
Int32ArraySamplePtr face_counts
P3fArraySamplePtr positions
std::optional< SampleInterpolationSettings > interpolation_settings
void *(* add_customdata_cb)(Mesh *mesh, const char *name, int data_type)
const char ** modifier_error_message
Alembic::Abc::chrono_t time
bool always_add_cache_reader