37using Alembic::Abc::FloatArraySamplePtr;
38using Alembic::Abc::Int32ArraySamplePtr;
39using Alembic::Abc::P3fArraySamplePtr;
40using Alembic::Abc::PropertyHeader;
41using Alembic::Abc::V3fArraySamplePtr;
43using Alembic::AbcGeom::IC3fGeomParam;
44using Alembic::AbcGeom::IC4fGeomParam;
45using Alembic::AbcGeom::IFaceSet;
46using Alembic::AbcGeom::IFaceSetSchema;
47using Alembic::AbcGeom::IN3fGeomParam;
48using Alembic::AbcGeom::IObject;
49using Alembic::AbcGeom::IPolyMesh;
50using Alembic::AbcGeom::IPolyMeshSchema;
51using Alembic::AbcGeom::ISampleSelector;
52using Alembic::AbcGeom::ISubD;
53using Alembic::AbcGeom::ISubDSchema;
54using Alembic::AbcGeom::IV2fGeomParam;
55using Alembic::AbcGeom::kWrapExisting;
56using Alembic::AbcGeom::N3fArraySample;
57using Alembic::AbcGeom::N3fArraySamplePtr;
58using Alembic::AbcGeom::UInt32ArraySamplePtr;
59using Alembic::AbcGeom::V2fArraySamplePtr;
70 std::map<std::string, Material *> mat_map;
72 mat_map[material->id.name + 2] = material;
79 const std::map<std::string, int> &mat_index_map)
81 std::map<std::string, int>::const_iterator it;
82 if (mat_index_map.size() >
MAXMAT) {
87 std::map<std::string, Material *>::iterator mat_iter;
89 for (it = mat_index_map.begin(); it != mat_index_map.end(); ++it) {
90 const std::string mat_name = it->first;
91 const int mat_index = it->second;
94 mat_iter = matname_to_material.find(mat_name);
95 if (mat_iter == matname_to_material.end()) {
98 matname_to_material[mat_name] = assigned_mat;
101 assigned_mat = mat_iter->second;
129 const P3fArraySamplePtr &positions,
130 const P3fArraySamplePtr &ceil_positions,
134 for (
int i = 0;
i < positions->size();
i++) {
135 const Imath::V3f &floor_pos = (*positions)[
i];
136 const Imath::V3f &ceil_pos = (*ceil_positions)[
i];
138 interp_v3_v3v3(tmp, floor_pos.getValue(), ceil_pos.getValue(),
float(weight));
146 const P3fArraySamplePtr &positions = mesh_data.
positions;
151 "AbcMeshData does not have ceil positions although it has some interpolation settings.");
155 config.
mesh->tag_positions_changed();
165 for (
int i = 0;
i < positions->size();
i++) {
166 Imath::V3f pos_in = (*positions)[
i];
170 mesh.tag_positions_changed();
175 Imath::V3f nor_in = (*normals)[
i];
188 const Int32ArraySamplePtr &face_indices = mesh_data.
face_indices;
189 const Int32ArraySamplePtr &face_counts = mesh_data.
face_counts;
190 const V2fArraySamplePtr &uvs = mesh_data.
uvs;
191 const size_t uvs_size = uvs ==
nullptr ? 0 : uvs->size();
193 const UInt32ArraySamplePtr &uvs_indices = mesh_data.
uvs_indices;
195 const bool do_uvs = (uv_maps && uvs && uvs_indices);
199 uint rev_loop_index = 0;
201 bool seen_invalid_geometry =
false;
203 for (
int i = 0;
i < face_counts->size();
i++) {
204 const int face_size = (*face_counts)[
i];
206 face_offsets[
i] = loop_index;
212 rev_loop_index = loop_index + (face_size - 1);
214 uint last_vertex_index = 0;
215 for (
int f = 0; f < face_size; f++, loop_index++, rev_loop_index--) {
216 const int vert = (*face_indices)[loop_index];
217 corner_verts[rev_loop_index] = vert;
219 if (f > 0 && vert == last_vertex_index) {
222 seen_invalid_geometry =
true;
224 last_vertex_index = vert;
227 uv_index = (*uvs_indices)[do_uvs_per_loop ? loop_index : last_vertex_index];
230 if (uv_index >= uvs_size) {
234 uv_maps[rev_loop_index][0] = (*uvs)[uv_index][0];
235 uv_maps[rev_loop_index][1] = (*uvs)[uv_index][1];
241 if (seen_invalid_geometry) {
256 size_t loop_count = loop_normals_ptr->size();
258 if (loop_count == 0) {
276 const N3fArraySample &loop_normals = *loop_normals_ptr;
281 for (
int j = face.
size() - 1; j >= 0; j--, abc_index++) {
282 int blender_index = face[j];
283 copy_zup_from_yup(corner_normals[blender_index], loop_normals[abc_index].getValue());
291 const N3fArraySamplePtr vertex_normals_ptr)
293 size_t normals_count = vertex_normals_ptr->size();
294 if (normals_count == 0) {
301 const N3fArraySample &vertex_normals = *vertex_normals_ptr;
302 for (
int index = 0; index < normals_count; index++) {
311 const ISampleSelector &selector)
318 IN3fGeomParam::Sample normsamp =
normals.getExpandedValue(selector);
319 Alembic::AbcGeom::GeometryScope scope =
normals.getScope();
322 case Alembic::AbcGeom::kFacevaryingScope:
325 case Alembic::AbcGeom::kVertexScope:
326 case Alembic::AbcGeom::kVaryingScope:
329 case Alembic::AbcGeom::kConstantScope:
330 case Alembic::AbcGeom::kUniformScope:
331 case Alembic::AbcGeom::kUnknownScope:
339 const IV2fGeomParam &uv,
340 const ISampleSelector &selector)
346 IV2fGeomParam::Sample uvsamp;
347 uv.getIndexed(uvsamp, selector);
349 UInt32ArraySamplePtr uvs_indices = uvsamp.getIndices();
358 abc_data.
uvs = uvsamp.getVals();
361 std::string
name = Alembic::Abc::GetSourceName(uv.getMetaData());
385 if (cd_ptr !=
nullptr) {
397template<
typename SampleType>
400 const P3fArraySamplePtr &positions =
sample.getPositions();
401 const Alembic::Abc::Int32ArraySamplePtr &face_indices =
sample.getFaceIndices();
402 const Alembic::Abc::Int32ArraySamplePtr &face_counts =
sample.getFaceCounts();
404 const P3fArraySamplePtr &ceil_positions = ceil_sample.getPositions();
405 const Alembic::Abc::Int32ArraySamplePtr &ceil_face_indices = ceil_sample.getFaceIndices();
406 const Alembic::Abc::Int32ArraySamplePtr &ceil_face_counts = ceil_sample.getFaceCounts();
409 const bool different_counters = positions->size() != ceil_positions->size() ||
410 face_counts->size() != ceil_face_counts->size() ||
411 face_indices->size() != ceil_face_indices->size();
412 if (different_counters) {
419 if (memcmp(face_counts->get(), ceil_face_counts->get(), face_counts->size() *
sizeof(
int))) {
423 if (memcmp(face_indices->get(), ceil_face_indices->get(), face_indices->size() *
sizeof(
int))) {
432 const IPolyMeshSchema &schema,
433 const ISampleSelector &selector,
436 const IPolyMeshSchema::Sample
sample = schema.getValue(selector);
443 const std::optional<SampleInterpolationSettings> interpolation_settings =
445 selector, schema.getTimeSampling(), schema.getNumSamples());
448 if (use_vertex_interpolation && interpolation_settings.has_value()) {
449 Alembic::AbcGeom::IPolyMeshSchema::Sample ceil_sample;
450 schema.get(ceil_sample, Alembic::Abc::ISampleSelector(interpolation_settings->ceil_index));
459 read_uvs_params(config, abc_mesh_data, schema.getUVsParam(), selector);
473 read_custom_data(iobject_full_name, schema.getArbGeomParams(), config, selector);
488 config.
positions = mesh->vert_positions_for_write().data();
489 config.
corner_verts = mesh->corner_verts_for_write().data();
490 config.
face_offsets = mesh->face_offsets_for_write().data();
507 IPolyMesh ipoly_mesh(
m_iobject, kWrapExisting);
508 m_schema = ipoly_mesh.getSchema();
515 return m_schema.valid();
518template<
class typedGeomParam>
521 if (!typedGeomParam::matches(prop_header)) {
525 typedGeomParam geom_param(arbGeomParams, prop_header.getName());
526 return geom_param.valid() && !geom_param.isConstant();
531 if (!arbGeomParams.valid()) {
535 const int num_props = arbGeomParams.getNumProperties();
536 for (
int i = 0;
i < num_props;
i++) {
537 const PropertyHeader &prop_header = arbGeomParams.getPropertyHeader(
i);
554 if (settings->
is_sequence || !schema.isConstant()) {
558 IV2fGeomParam uvsParam = schema.getUVsParam();
559 if (uvsParam.valid() && !uvsParam.isConstant()) {
563 IN3fGeomParam normalsParam = schema.getNormalsParam();
564 if (normalsParam.valid() && !normalsParam.isConstant()) {
568 ICompoundProperty arbGeomParams = schema.getArbGeomParams();
578 if (settings->
is_sequence || !schema.isConstant()) {
582 IV2fGeomParam uvsParam = schema.getUVsParam();
583 if (uvsParam.valid() && !uvsParam.isConstant()) {
587 Alembic::AbcGeom::IInt32ArrayProperty creaseIndices = schema.getCreaseIndicesProperty();
588 if (creaseIndices.valid() && !creaseIndices.isConstant()) {
591 Alembic::AbcGeom::IFloatArrayProperty creaseSharpnesses = schema.getCreaseSharpnessesProperty();
592 if (creaseSharpnesses.valid() && !creaseSharpnesses.isConstant()) {
596 Alembic::AbcGeom::IInt32ArrayProperty cornerIndices = schema.getCornerIndicesProperty();
597 if (cornerIndices.valid() && !cornerIndices.isConstant()) {
600 Alembic::AbcGeom::IFloatArrayProperty cornerSharpnesses = schema.getCornerSharpnessesProperty();
601 if (cornerSharpnesses.valid() && !cornerSharpnesses.isConstant()) {
605 ICompoundProperty arbGeomParams = schema.getArbGeomParams();
629 readFaceSetsSample(bmain, mesh, sample_sel);
637 const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
639 const char **r_err_str)
const
641 if (!Alembic::AbcGeom::IPolyMesh::matches(alembic_header)) {
643 "Object type mismatch, Alembic object path pointed to PolyMesh when importing, but not "
649 *r_err_str =
RPT_(
"Object type mismatch, Alembic object path points to PolyMesh");
658 IPolyMeshSchema::Sample
sample;
660 sample = m_schema.getValue(sample_sel);
662 catch (Alembic::Util::Exception &ex) {
663 printf(
"Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n",
665 m_schema.getName().c_str(),
666 sample_sel.getRequestedTime(),
672 const P3fArraySamplePtr &positions =
sample.getPositions();
673 const Alembic::Abc::Int32ArraySamplePtr &face_indices =
sample.getFaceIndices();
674 const Alembic::Abc::Int32ArraySamplePtr &face_counts =
sample.getFaceCounts();
677 const bool different_counters = positions->size() != existing_mesh->
verts_num ||
678 face_counts->size() != existing_mesh->
faces_num ||
679 face_indices->size() != existing_mesh->
corners_num;
680 if (different_counters) {
687 m_schema.getFaceCountsProperty().getNumSamples() == 1))
696 const int *mesh_corner_verts = existing_mesh->corner_verts().data();
697 const int *mesh_face_offsets = existing_mesh->face_offsets().data();
699 for (
int i = 0;
i < face_counts->size();
i++) {
700 if (mesh_face_offsets[
i] != abc_index) {
704 const int abc_face_size = (*face_counts)[
i];
706 uint rev_loop_index = abc_index + (abc_face_size - 1);
707 for (
int f = 0; f < abc_face_size; f++, abc_index++, rev_loop_index--) {
708 const int mesh_vert = mesh_corner_verts[rev_loop_index];
709 const int abc_vert = (*face_indices)[abc_index];
720 const Alembic::Abc::ISampleSelector &sample_sel,
722 const char *velocity_name,
723 const float velocity_scale,
724 const char **r_err_str)
728 if (mesh ==
nullptr) {
733 mesh, sample_sel, read_flag, velocity_name, velocity_scale, r_err_str);
739 const ISampleSelector &sample_sel,
741 const char *velocity_name,
742 const float velocity_scale,
743 const char **r_err_str)
745 IPolyMeshSchema::Sample
sample;
747 sample = m_schema.getValue(sample_sel);
749 catch (Alembic::Util::Exception &ex) {
750 if (r_err_str !=
nullptr) {
751 *r_err_str =
RPT_(
"Error reading mesh sample; more detail on the console");
753 printf(
"Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n",
755 m_schema.getName().c_str(),
756 sample_sel.getRequestedTime(),
758 return existing_mesh;
761 const P3fArraySamplePtr &positions =
sample.getPositions();
762 const Alembic::Abc::Int32ArraySamplePtr &face_indices =
sample.getFaceIndices();
763 const Alembic::Abc::Int32ArraySamplePtr &face_counts =
sample.getFaceCounts();
766 const int poly_count = face_counts->size();
767 const int loop_count = face_indices->size();
769 if (poly_count > 0 && loop_count < poly_count * 2) {
770 if (r_err_str !=
nullptr) {
771 *r_err_str =
RPT_(
"Invalid mesh; more detail on the console");
773 printf(
"Alembic: invalid mesh sample for '%s/%s' at time %f, less than 2 loops per face\n",
775 m_schema.getName().c_str(),
776 sample_sel.getRequestedTime());
777 return existing_mesh;
780 Mesh *new_mesh =
nullptr;
790 existing_mesh, positions->size(), 0, face_counts->size(), face_indices->size());
798 if (face_counts->size() != existing_mesh->
faces_num ||
799 face_indices->size() != existing_mesh->
corners_num)
805 "Topology has changed, perhaps by triangulating the mesh. Only vertices will be "
811 Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh;
813 config.
time = sample_sel.getRequestedTime();
824 std::map<std::string, int> mat_map;
828 assign_facesets_to_material_indices(sample_sel, material_indices.
span, mat_map);
829 material_indices.
finish();
835 return existing_mesh;
838void AbcMeshReader::assign_facesets_to_material_indices(
const ISampleSelector &sample_sel,
840 std::map<std::string, int> &r_mat_map)
842 std::vector<std::string> face_sets;
843 m_schema.getFaceSetNames(face_sets);
845 if (face_sets.empty()) {
851 for (
const std::string &grp_name : face_sets) {
852 if (r_mat_map.find(grp_name) == r_mat_map.end()) {
853 r_mat_map[grp_name] = ++current_mat;
856 const int assigned_mat = r_mat_map[grp_name];
858 const IFaceSet faceset = m_schema.getFaceSet(grp_name);
860 if (!faceset.valid()) {
861 std::cerr <<
" Face set " << grp_name <<
" invalid for " <<
m_object_name <<
"\n";
865 const IFaceSetSchema face_schem = faceset.getSchema();
866 const IFaceSetSchema::Sample face_sample = face_schem.getValue(sample_sel);
867 const Int32ArraySamplePtr group_faces = face_sample.getFaces();
868 const size_t num_group_faces = group_faces->size();
870 for (
size_t l = 0;
l < num_group_faces;
l++) {
871 size_t pos = (*group_faces)[
l];
873 if (
pos >= material_indices.
size()) {
874 std::cerr <<
"Faceset overflow on " << faceset.getName() <<
'\n';
878 material_indices[
pos] = assigned_mat - 1;
883void AbcMeshReader::readFaceSetsSample(Main *bmain,
Mesh *mesh,
const ISampleSelector &sample_sel)
885 std::map<std::string, int> mat_map;
886 bke::MutableAttributeAccessor attributes = mesh->attributes_for_write();
887 bke::SpanAttributeWriter<int> material_indices = attributes.lookup_or_add_for_write_span<
int>(
889 assign_facesets_to_material_indices(sample_sel, material_indices.span, mat_map);
890 material_indices.finish();
898 const ISubDSchema &schema,
899 const ISampleSelector &selector,
902 const ISubDSchema::Sample
sample = schema.getValue(selector);
909 const std::optional<SampleInterpolationSettings> interpolation_settings =
911 selector, schema.getTimeSampling(), schema.getNumSamples());
914 if (use_vertex_interpolation && interpolation_settings.has_value()) {
915 Alembic::AbcGeom::ISubDSchema::Sample ceil_sample;
916 schema.get(ceil_sample, Alembic::Abc::ISampleSelector(interpolation_settings->ceil_index));
925 read_uvs_params(config, abc_mesh_data, schema.getUVsParam(), selector);
941 read_custom_data(iobject_full_name, schema.getArbGeomParams(), config, selector);
953 const Int32ArraySamplePtr &
indices,
954 const FloatArraySamplePtr &sharpnesses,
965 creases.
span.fill(0.0f);
970 const int idx = (*indices)[
i];
972 if (idx >= totvert) {
979 creases.
span[idx] = std::clamp(crease, 0.0f, 1.0f);
986 const Int32ArraySamplePtr &
indices,
987 const FloatArraySamplePtr &sharpnesses,
990 if (!(
indices && sharpnesses)) {
994 const Span<int2> edges = mesh->edges_for_write();
998 edge_hash.
add(edges[
i],
i);
1005 for (
int i = 0, s = 0,
e =
indices->size();
i <
e;
i += 2, s++) {
1006 int v1 = (*indices)[
i];
1007 int v2 = (*indices)[
i + 1];
1016 creases.
span[*index] = std::clamp(crease, 0.0f, 1.0f);
1029 ISubD isubd_mesh(
m_iobject, kWrapExisting);
1030 m_schema = isubd_mesh.getSchema();
1037 return m_schema.valid();
1041 const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
1043 const char **r_err_str)
const
1045 if (!Alembic::AbcGeom::ISubD::matches(alembic_header)) {
1047 "Object type mismatch, Alembic object path pointed to SubD when importing, but not any "
1053 *r_err_str =
RPT_(
"Object type mismatch, Alembic object path points to SubD");
1068 if (read_mesh != mesh) {
1081Mesh *AbcSubDReader::read_mesh(
Mesh *existing_mesh,
1082 const ISampleSelector &sample_sel,
1083 const int read_flag,
1084 const char *velocity_name,
1085 const float velocity_scale,
1086 const char **r_err_str)
1088 ISubDSchema::Sample
sample;
1090 sample = m_schema.getValue(sample_sel);
1092 catch (Alembic::Util::Exception &ex) {
1093 if (r_err_str !=
nullptr) {
1094 *r_err_str =
RPT_(
"Error reading mesh sample; more detail on the console");
1096 printf(
"Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n",
1098 m_schema.getName().c_str(),
1099 sample_sel.getRequestedTime(),
1101 return existing_mesh;
1104 const P3fArraySamplePtr &positions =
sample.getPositions();
1105 const Alembic::Abc::Int32ArraySamplePtr &face_indices =
sample.getFaceIndices();
1106 const Alembic::Abc::Int32ArraySamplePtr &face_counts =
sample.getFaceCounts();
1108 Mesh *new_mesh =
nullptr;
1110 ImportSettings settings;
1111 settings.read_flag |= read_flag;
1112 settings.velocity_name = velocity_name;
1113 settings.velocity_scale = velocity_scale;
1115 if (existing_mesh->
verts_num != positions->size()) {
1117 existing_mesh, positions->size(), 0, face_counts->size(), face_indices->size());
1125 if (face_counts->size() != existing_mesh->
faces_num ||
1126 face_indices->size() != existing_mesh->
corners_num)
1132 "Topology has changed, perhaps by triangulating the mesh. Only vertices will be "
1139 Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh;
1140 CDStreamConfig config =
get_config(mesh_to_export);
1141 config.time = sample_sel.getRequestedTime();
1142 config.modifier_error_message = r_err_str;
1151 return mesh_to_export;
1155 const Alembic::Abc::ISampleSelector &sample_sel,
1156 const int read_flag,
1157 const char *velocity_name,
1158 const float velocity_scale,
1159 const char **r_err_str)
1163 if (mesh ==
nullptr) {
1167 Mesh *new_mesh = read_mesh(
1168 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(Main *bmain, Object *ob, Material *ma, short act)
Material * BKE_material_add(Main *bmain, const char *name)
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)
Mesh * BKE_mesh_add(Main *bmain, const char *name)
void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, Mesh *mesh_dst, Object *ob, bool process_shape_keys=true)
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
constexpr int64_t size() const
const Value * lookup_ptr(const Key &key) const
bool add(const Key &key, const Value &value)
constexpr int64_t size() const
constexpr int64_t size() const
constexpr IndexRange index_range() const
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef attribute_id, AttrDomain domain, AttrType data_type)
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
AbcObjectReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
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)
static float normals[][3]
BLI_INLINE float sharpness_to_crease(float sharpness)
void mesh_calc_edges(Mesh &mesh, bool keep_existing_edges, bool select_new_edges)
void mesh_set_custom_normals_from_verts(Mesh &mesh, MutableSpan< float3 > vert_normals)
void mesh_vert_normals_assign(Mesh &mesh, Span< float3 > vert_normals)
void mesh_set_custom_normals(Mesh &mesh, MutableSpan< float3 > corner_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)
static void read_vertex_creases(Mesh *mesh, const Int32ArraySamplePtr &indices, const FloatArraySamplePtr &sharpnesses, const ImportSettings *settings)
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 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_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 read_edge_creases(Mesh *mesh, const Int32ArraySamplePtr &indices, const FloatArraySamplePtr &sharpnesses, const ImportSettings *settings)
static void * add_customdata_cb(Mesh *mesh, const char *name, int data_type)
VecBase< float, 2 > float2
VecBase< float, 3 > float3
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 blender_archive_version_prior_44
std::string velocity_name