46using Alembic::Abc::FloatArraySamplePtr;
47using Alembic::Abc::IInt32ArrayProperty;
48using Alembic::Abc::Int32ArraySamplePtr;
49using Alembic::Abc::P3fArraySamplePtr;
50using Alembic::Abc::PropertyHeader;
51using Alembic::Abc::V3fArraySamplePtr;
53using Alembic::AbcGeom::IC3fGeomParam;
54using Alembic::AbcGeom::IC4fGeomParam;
55using Alembic::AbcGeom::IFaceSet;
56using Alembic::AbcGeom::IFaceSetSchema;
57using Alembic::AbcGeom::IInt32Property;
58using Alembic::AbcGeom::IN3fGeomParam;
59using Alembic::AbcGeom::IObject;
60using Alembic::AbcGeom::IPolyMesh;
61using Alembic::AbcGeom::IPolyMeshSchema;
62using Alembic::AbcGeom::ISampleSelector;
63using Alembic::AbcGeom::ISubD;
64using Alembic::AbcGeom::ISubDSchema;
65using Alembic::AbcGeom::IV2fGeomParam;
66using Alembic::AbcGeom::kWrapExisting;
67using Alembic::AbcGeom::N3fArraySample;
68using Alembic::AbcGeom::N3fArraySamplePtr;
69using Alembic::AbcGeom::UInt32ArraySamplePtr;
70using Alembic::AbcGeom::V2fArraySamplePtr;
83 std::map<std::string, Material *> mat_map;
85 mat_map[material.id.name + 2] = &material;
92 const std::map<std::string, int> &mat_index_map)
94 std::map<std::string, int>::const_iterator it;
95 if (mat_index_map.size() >
MAXMAT) {
100 std::map<std::string, Material *>::iterator mat_iter;
102 for (it = mat_index_map.begin(); it != mat_index_map.end(); ++it) {
103 const std::string mat_name = it->first;
104 const int mat_index = it->second;
107 mat_iter = matname_to_material.find(mat_name);
108 if (mat_iter == matname_to_material.end()) {
111 matname_to_material[mat_name] = assigned_mat;
114 assigned_mat = mat_iter->second;
155 const P3fArraySamplePtr &positions,
156 const P3fArraySamplePtr &ceil_positions,
160 for (
int i = 0; i < positions->size(); i++) {
161 const Imath::V3f &floor_pos = (*positions)[i];
162 const Imath::V3f &ceil_pos = (*ceil_positions)[i];
164 interp_v3_v3v3(tmp, floor_pos.getValue(), ceil_pos.getValue(),
float(weight));
172 const P3fArraySamplePtr &positions = mesh_data.
positions;
177 "AbcMeshData does not have ceil positions although it has some interpolation settings.");
181 config.
mesh->tag_positions_changed();
191 for (
int i = 0; i < positions->size(); i++) {
192 Imath::V3f pos_in = (*positions)[i];
196 mesh.tag_positions_changed();
201 Imath::V3f nor_in = (*normals)[i];
211 config.
positions = config.
mesh->vert_positions_for_write().data();
234 const Int32ArraySamplePtr &face_indices = mesh_data.
face_indices;
235 const Int32ArraySamplePtr &face_counts = mesh_data.
face_counts;
236 const V2fArraySamplePtr &uvs = config.
uvs;
237 const int64_t uvs_size = uvs ==
nullptr ? 0 :
int64_t(uvs->size());
239 const UInt32ArraySamplePtr &uvs_indices = config.
uvs_indices;
240 const int64_t uvs_indices_size = uvs_indices ==
nullptr ? 0 :
int64_t(uvs_indices->size());
242 const bool do_uvs = (uv_maps && uvs && uvs_indices);
250 for (
int64_t i = 0; i < face_counts->size(); i++) {
251 int face_size = (*face_counts)[i];
253 face_offsets[i] = loop_index;
259 if (face_size > 0 && face_size <= corners_num - loop_index) {
260 rev_loop_index = loop_index + (face_size - 1);
263 rev_loop_index = loop_index;
267 const int64_t last_vertex_index = 0;
268 for (
int64_t f = 0; f < face_size; f++, loop_index++, rev_loop_index--) {
269 int vert = (*face_indices)[loop_index];
273 corner_verts[rev_loop_index] = vert;
276 const int64_t lookup_index = do_uvs_per_loop ? loop_index : last_vertex_index;
280 const int64_t uv_index = (*uvs_indices)[lookup_index];
287 uv_maps[rev_loop_index][0] = (*uvs)[uv_index][0];
288 uv_maps[rev_loop_index][1] = (*uvs)[uv_index][1];
298 const bool all_faces_ok = bad_faces.
is_empty();
323 size_t loop_count = loop_normals_ptr->size();
325 if (loop_count == 0) {
331 if (loop_count !=
mesh->corners_num) {
343 const N3fArraySample &loop_normals = *loop_normals_ptr;
345 for (
int i = 0,
e =
mesh->faces_num; i <
e; i++) {
348 for (
int j = face.
size() - 1; j >= 0; j--, abc_index++) {
349 int blender_index = face[j];
350 copy_zup_from_yup(corner_normals[blender_index], loop_normals[abc_index].getValue());
358 const N3fArraySamplePtr vertex_normals_ptr)
360 size_t normals_count = vertex_normals_ptr->size();
361 if (normals_count == 0) {
368 const N3fArraySample &vertex_normals = *vertex_normals_ptr;
377 const IN3fGeomParam &normals,
378 const ISampleSelector &selector)
380 if (!normals.valid()) {
385 IN3fGeomParam::Sample normsamp = normals.getExpandedValue(selector);
386 Alembic::AbcGeom::GeometryScope scope = normals.getScope();
389 case Alembic::AbcGeom::kFacevaryingScope:
392 case Alembic::AbcGeom::kVertexScope:
393 case Alembic::AbcGeom::kVaryingScope:
396 case Alembic::AbcGeom::kConstantScope:
397 case Alembic::AbcGeom::kUniformScope:
398 case Alembic::AbcGeom::kUnknownScope:
405 const IV2fGeomParam &uv,
406 const ISampleSelector &selector)
412 IV2fGeomParam::Sample uvsamp;
413 uv.getIndexed(uvsamp, selector);
415 UInt32ArraySamplePtr uvs_indices = uvsamp.getIndices();
424 config.
uvs = uvsamp.getVals();
427 std::string name = Alembic::Abc::GetSourceName(uv.getMetaData());
438 config.
mesh->uv_maps_active_set(name);
439 config.
mesh->uv_maps_default_set(name);
442template<
typename SampleType>
445 const P3fArraySamplePtr &positions =
sample.getPositions();
446 const Alembic::Abc::Int32ArraySamplePtr &face_indices =
sample.getFaceIndices();
447 const Alembic::Abc::Int32ArraySamplePtr &face_counts =
sample.getFaceCounts();
449 const P3fArraySamplePtr &ceil_positions = ceil_sample.getPositions();
450 const Alembic::Abc::Int32ArraySamplePtr &ceil_face_indices = ceil_sample.getFaceIndices();
451 const Alembic::Abc::Int32ArraySamplePtr &ceil_face_counts = ceil_sample.getFaceCounts();
454 const bool different_counters = positions->size() != ceil_positions->size() ||
455 face_counts->size() != ceil_face_counts->size() ||
456 face_indices->size() != ceil_face_indices->size();
457 if (different_counters) {
464 if (memcmp(face_counts->get(), ceil_face_counts->get(), face_counts->size() *
sizeof(
int)) != 0)
469 if (memcmp(face_indices->get(), ceil_face_indices->get(), face_indices->size() *
sizeof(
int)) !=
479 const Mesh *existing_mesh,
480 const bool is_reading_a_file_sequence)
482 const P3fArraySamplePtr &positions = abc_mesh_data.
positions;
483 const Int32ArraySamplePtr &face_indices = abc_mesh_data.
face_indices;
484 const Int32ArraySamplePtr &face_counts = abc_mesh_data.
face_counts;
487 const bool different_counters = positions->size() != existing_mesh->
verts_num ||
488 face_counts->size() != existing_mesh->
faces_num ||
489 face_indices->size() != existing_mesh->
corners_num;
490 if (different_counters) {
506 const int *mesh_corner_verts = existing_mesh->corner_verts().data();
507 const int *mesh_face_offsets = existing_mesh->face_offsets().data();
511 for (
int64_t i = 0; i < face_counts->size(); i++) {
512 if (mesh_face_offsets[i] != abc_index) {
516 const int abc_face_size = (*face_counts)[i];
519 if (abc_face_size < 0 || abc_face_size > abc_corners_num - abc_index ||
520 abc_face_size > mesh_corners_num - abc_index)
525 int64_t rev_loop_index = abc_index + (abc_face_size > 0 ? abc_face_size - 1 : 0);
526 for (
int64_t f = 0; f < abc_face_size; f++, abc_index++, rev_loop_index--) {
527 const int mesh_vert = mesh_corner_verts[rev_loop_index];
528 const int abc_vert = (*face_indices)[abc_index];
529 if (mesh_vert != abc_vert) {
539 const ISampleSelector &selector,
542 const char **r_err_str,
543 const bool is_reading_a_file_sequence)
545 const P3fArraySamplePtr &positions = abc_mesh_data.
positions;
546 const Int32ArraySamplePtr &face_indices = abc_mesh_data.
face_indices;
547 const Int32ArraySamplePtr &face_counts = abc_mesh_data.
face_counts;
550 const int64_t poly_count = face_counts->size();
551 const int64_t loop_count = face_indices->size();
552 const int64_t vert_count = positions->size();
556 if (r_err_str !=
nullptr) {
557 *r_err_str =
RPT_(
"Mesh too large; more detail on the console");
560 "Mesh too large for '%s/%s' at time %f, exceeds max int size",
563 selector.getRequestedTime());
564 return existing_mesh;
567 if (poly_count > 0 && loop_count < poly_count * 2) {
568 if (r_err_str !=
nullptr) {
569 *r_err_str =
RPT_(
"Invalid mesh; more detail on the console");
572 "Invalid mesh sample for '%s/%s' at time %f, less than 2 loops per face",
575 selector.getRequestedTime());
576 return existing_mesh;
579 Mesh *new_mesh =
nullptr;
584 if (
topology_changed(abc_mesh_data, existing_mesh, is_reading_a_file_sequence)) {
586 existing_mesh, positions->size(), 0, face_counts->size(), face_indices->size());
594 if (face_counts->size() != existing_mesh->
faces_num ||
595 face_indices->size() != existing_mesh->
corners_num)
601 "Topology has changed, perhaps by triangulating the mesh. Only vertices will be "
607 Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh;
609 config.
time = selector.getRequestedTime();
635 return mesh_to_export;
641 const IPolyMeshSchema &schema,
642 const ISampleSelector &selector,
644 const bool for_topology_check)
646 IPolyMeshSchema::Sample
sample = schema.getValue(selector);
650 result.face_indices_property = schema.getFaceIndicesProperty();
652 result.face_counts_property = schema.getFaceCountsProperty();
655 if (!for_topology_check) {
656 result.iobject_full_name = iobject.getFullName();
657 result.schema_name = schema.getName();
658 result.arb_geom_params = schema.getArbGeomParams();
659 result.uvs_param = schema.getUVsParam();
660 result.normals_param = schema.getNormalsParam();
666 const std::optional<SampleInterpolationSettings> interpolation_settings =
668 selector, schema.getTimeSampling(), schema.getNumSamples());
671 if (use_vertex_interpolation && interpolation_settings.has_value()) {
672 IPolyMeshSchema::Sample ceil_sample;
673 schema.get(ceil_sample, ISampleSelector(interpolation_settings->ceil_index));
676 result.ceil_positions = ceil_sample.getPositions();
677 result.interpolation_settings = interpolation_settings;
689 IPolyMesh ipoly_mesh(
m_iobject, kWrapExisting);
690 m_schema = ipoly_mesh.getSchema();
695 return m_schema.valid();
698template<
class typedGeomParam>
701 if (!typedGeomParam::matches(prop_header)) {
705 typedGeomParam geom_param(arbGeomParams, prop_header.getName());
706 return geom_param.valid() && !geom_param.isConstant();
711 if (!arbGeomParams.valid()) {
715 const int num_props = arbGeomParams.getNumProperties();
716 for (
int i = 0; i < num_props; i++) {
717 const PropertyHeader &prop_header = arbGeomParams.getPropertyHeader(i);
736 const IObject
object = schema.getObject();
739 for (
size_t i = 0; i <
object.getNumChildren(); i++) {
740 const Alembic::AbcCoreAbstract::ObjectHeader &header =
object.getChildHeader(i);
741 if (IFaceSet::matches(header)) {
742 names.
append(header.getName());
746 std::sort(names.
begin(), names.
end());
753 if (settings->
is_sequence || !schema.isConstant()) {
758 const IFaceSet
face_set = schema.getFaceSet(face_set_name);
759 const IFaceSetSchema &face_set_schema =
face_set.getSchema();
760 if (!face_set_schema.isConstant()) {
765 IV2fGeomParam uvsParam = schema.getUVsParam();
766 if (uvsParam.valid() && !uvsParam.isConstant()) {
770 IN3fGeomParam normalsParam = schema.getNormalsParam();
771 if (normalsParam.valid() && !normalsParam.isConstant()) {
775 ICompoundProperty arbGeomParams = schema.getArbGeomParams();
785 if (settings->
is_sequence || !schema.isConstant()) {
789 IV2fGeomParam uvsParam = schema.getUVsParam();
790 if (uvsParam.valid() && !uvsParam.isConstant()) {
794 Alembic::AbcGeom::IInt32ArrayProperty creaseIndices = schema.getCreaseIndicesProperty();
795 if (creaseIndices.valid() && !creaseIndices.isConstant()) {
798 Alembic::AbcGeom::IFloatArrayProperty creaseSharpnesses = schema.getCreaseSharpnessesProperty();
799 if (creaseSharpnesses.valid() && !creaseSharpnesses.isConstant()) {
803 Alembic::AbcGeom::IInt32ArrayProperty cornerIndices = schema.getCornerIndicesProperty();
804 if (cornerIndices.valid() && !cornerIndices.isConstant()) {
807 Alembic::AbcGeom::IFloatArrayProperty cornerSharpnesses = schema.getCornerSharpnessesProperty();
808 if (cornerSharpnesses.valid() && !cornerSharpnesses.isConstant()) {
812 ICompoundProperty arbGeomParams = schema.getArbGeomParams();
839 readFaceSetsSample(bmain,
mesh, sample_sel);
845 ICompoundProperty user_props = m_schema.getUserProperties();
850 const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
852 const char **r_err_str)
const
854 if (!Alembic::AbcGeom::IPolyMesh::matches(alembic_header)) {
856 "Object type mismatch, Alembic object path pointed to PolyMesh when importing, but not "
862 *r_err_str =
RPT_(
"Object type mismatch, Alembic object path points to PolyMesh");
876 catch (Alembic::Util::Exception &ex) {
878 "Error reading mesh sample for '%s/%s' at time %f: %s",
880 m_schema.getName().c_str(),
881 sample_sel.getRequestedTime(),
891 const Alembic::Abc::ISampleSelector &sample_sel,
893 const char **r_err_str)
897 if (
mesh ==
nullptr) {
907 const ISampleSelector &sample_sel,
909 const char **r_err_str)
915 catch (Alembic::Util::Exception &ex) {
916 if (r_err_str !=
nullptr) {
917 *r_err_str =
RPT_(
"Error reading mesh sample; more detail on the console");
920 "Error reading mesh sample for '%s/%s' at time %f: %s",
922 m_schema.getName().c_str(),
923 sample_sel.getRequestedTime(),
925 return existing_mesh;
940 std::map<std::string, int> mat_map;
944 assign_facesets_to_material_indices(sample_sel, material_indices.
span, mat_map);
945 material_indices.
finish();
948 if (new_mesh != existing_mesh) {
952 return existing_mesh;
955void AbcMeshReader::assign_facesets_to_material_indices(
const ISampleSelector &sample_sel,
957 std::map<std::string, int> &r_mat_map)
968 material_indices.
fill(0);
970 for (
const std::string &grp_name : face_sets) {
971 if (!r_mat_map.contains(grp_name)) {
972 r_mat_map[grp_name] = ++current_mat;
975 const int assigned_mat = r_mat_map[grp_name];
977 const IFaceSet faceset = m_schema.getFaceSet(grp_name);
979 if (!faceset.valid()) {
980 std::cerr <<
" Face set " << grp_name <<
" invalid for " <<
m_object_name <<
"\n";
984 const IFaceSetSchema face_schem = faceset.getSchema();
985 const IFaceSetSchema::Sample face_sample = face_schem.getValue(sample_sel);
986 const Int32ArraySamplePtr group_faces = face_sample.getFaces();
987 const size_t num_group_faces = group_faces->size();
989 for (
size_t l = 0;
l < num_group_faces;
l++) {
990 size_t pos = (*group_faces)[
l];
992 if (pos >= material_indices.
size()) {
993 std::cerr <<
"Faceset overflow on " << faceset.getName() <<
'\n';
997 material_indices[pos] = assigned_mat - 1;
1002void AbcMeshReader::readFaceSetsSample(Main *bmain, Mesh *mesh,
const ISampleSelector &sample_sel)
1004 std::map<std::string, int> mat_map;
1005 bke::MutableAttributeAccessor attributes = mesh->attributes_for_write();
1006 bke::SpanAttributeWriter<int> material_indices = attributes.lookup_or_add_for_write_span<
int>(
1008 assign_facesets_to_material_indices(sample_sel, material_indices.span, mat_map);
1009 material_indices.finish();
1016 const ISubDSchema &schema,
1017 const ISampleSelector &selector,
1019 const bool for_topology_check)
1021 ISubDSchema::Sample
sample = schema.getValue(selector);
1025 result.face_indices_property = schema.getFaceIndicesProperty();
1027 result.face_counts_property = schema.getFaceCountsProperty();
1030 if (!for_topology_check) {
1031 result.iobject_full_name = iobject.getFullName();
1032 result.schema_name = schema.getName();
1033 result.arb_geom_params = schema.getArbGeomParams();
1034 result.uvs_param = schema.getUVsParam();
1040 const std::optional<SampleInterpolationSettings> interpolation_settings =
1042 selector, schema.getTimeSampling(), schema.getNumSamples());
1045 if (use_vertex_interpolation && interpolation_settings.has_value()) {
1046 ISubDSchema::Sample ceil_sample;
1047 schema.get(ceil_sample, Alembic::Abc::ISampleSelector(interpolation_settings->ceil_index));
1050 result.ceil_positions = ceil_sample.getPositions();
1051 result.interpolation_settings = interpolation_settings.value();
1060 const Int32ArraySamplePtr &indices,
1061 const FloatArraySamplePtr &sharpnesses,
1064 if (!(indices && sharpnesses && indices->size() == sharpnesses->size() && indices->size() != 0))
1072 creases.
span.fill(0.0f);
1074 const int totvert =
mesh->verts_num;
1075 const int64_t indices_num = indices->size();
1077 for (
int64_t i = 0,
v = indices_num; i <
v; ++i) {
1078 const int idx = (*indices)[i];
1087 creases.
span[idx] = std::clamp(crease, 0.0f, 1.0f);
1094 const Int32ArraySamplePtr &indices,
1095 const FloatArraySamplePtr &sharpnesses,
1098 if (!(indices && sharpnesses)) {
1106 edge_hash.
add(edges[i], i);
1115 for (
int64_t i = 0, s = 0; i + 1 < indices_num && s < sharp_num; i += 2, s++) {
1116 int v1 = (*indices)[i];
1117 int v2 = (*indices)[i + 1];
1126 creases.
span[*
index] = std::clamp(crease, 0.0f, 1.0f);
1138 ISubD isubd_mesh(
m_iobject, kWrapExisting);
1139 m_schema = isubd_mesh.getSchema();
1144 return m_schema.valid();
1148 const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
1150 const char **r_err_str)
const
1152 if (!Alembic::AbcGeom::ISubD::matches(alembic_header)) {
1154 "Object type mismatch, Alembic object path pointed to SubD when importing, but not any "
1160 *r_err_str =
RPT_(
"Object type mismatch, Alembic object path points to SubD");
1177 Mesh *read_mesh = this->read_mesh(
mesh, sample_sel, read_params,
nullptr);
1178 if (read_mesh !=
mesh) {
1190 add_subdiv_modifier();
1192 ICompoundProperty user_props = m_schema.getUserProperties();
1203 catch (Alembic::Util::Exception &ex) {
1205 "Error reading mesh sample for '%s/%s' at time %f: %s",
1207 m_schema.getName().c_str(),
1208 sample_sel.getRequestedTime(),
1217Mesh *AbcSubDReader::read_mesh(
Mesh *existing_mesh,
1218 const ISampleSelector &sample_sel,
1220 const char **r_err_str)
1226 catch (Alembic::Util::Exception &ex) {
1227 if (r_err_str !=
nullptr) {
1228 *r_err_str =
RPT_(
"Error reading mesh sample; more detail on the console");
1231 "Error reading mesh sample for '%s/%s' at time %f: %s",
1233 m_schema.getName().c_str(),
1234 sample_sel.getRequestedTime(),
1236 return existing_mesh;
1247 ISubDSchema::Sample
sample = m_schema.getValue(sample_sel);
1255 return mesh_to_export;
1259 const Alembic::Abc::ISampleSelector &sample_sel,
1261 const char **r_err_str)
1265 if (
mesh ==
nullptr) {
1269 Mesh *new_mesh = read_mesh(
mesh, sample_sel, read_params, r_err_str);
1274void AbcSubDReader::add_subdiv_modifier()
1284 ISampleSelector sample_selector = ISampleSelector(Alembic::Abc::index_t(0));
1285 ISubDSchema::Sample
sample = m_schema.getValue(sample_selector);
1291 sample.getInterpolateBoundary());
1297 const bool propagate_corners =
sample.getFaceVaryingPropagateCorners() > 0;
1300 switch (fvar_interpolate_boundary) {
1305 if (propagate_corners) {
1321 switch (interpolate_boundary) {
1333 ICompoundProperty user_properties = m_schema.getUserProperties();
1335 if (user_properties.valid() && user_properties.getPropertyHeader(
"subdivRenderLevels") &&
1336 user_properties.getPropertyHeader(
"subdivViewportLevels"))
1338 IInt32Property render_levels(user_properties,
"subdivRenderLevels");
1339 IInt32Property viewport_levels(user_properties,
"subdivViewportLevels");
1341 subdiv_data->
renderLevels = short(render_levels.getValue(sample_selector));
1342 subdiv_data->
levels = short(viewport_levels.getValue(sample_selector));
1345 catch (Alembic::Util::Exception &ex) {
1347 "Error reading subdivision parameter for '%s/%s' : %s",
1349 m_schema.getName().c_str(),
CustomData interface, see also DNA_customdata_types.h.
General operations, lookup, etc. for materials.
General operations, lookup, etc. for blender objects.
#define CLOG_WARN(clg_ref,...)
#define MOD_MESHSEQ_READ_ALL
Object is a sort of wrapper for general info.
#define BLI_assert_msg(a, msg)
constexpr int64_t size() const
constexpr IndexRange()=default
const Value * lookup_ptr(const Key &key) const
bool add(const Key &key, const Value &value)
constexpr int64_t size() const
constexpr void fill(const T &value) const
constexpr int64_t size() const
constexpr IndexRange index_range() const
void append(const T &value)
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef name, AttrDomain domain, AttrType data_type)
constexpr const char * data() const
struct Mesh * read_mesh(struct Mesh *existing_mesh, const Alembic::Abc::ISampleSelector &sample_sel, const AbcReadGeometryParams &read_params, 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
bool topology_changed(const Mesh *existing_mesh, const Alembic::Abc::ISampleSelector &sample_sel) override
bool valid() const override
void read_geometry(bke::GeometrySet &geometry_set, const Alembic::Abc::ISampleSelector &sample_sel, const AbcReadGeometryParams &read_params, const char **r_err_str) override
AbcMeshReader(const AbcReaderConstructorArgs &args)
std::string m_object_name
Alembic::Abc::IObject m_iobject
AbcObjectReader(const AbcReaderConstructorArgs &args)
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
AbcSubDReader(const AbcReaderConstructorArgs &args)
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override
bool topology_changed(const Mesh *existing_mesh, const Alembic::Abc::ISampleSelector &sample_sel) override
bool valid() const override
void read_geometry(bke::GeometrySet &geometry_set, const Alembic::Abc::ISampleSelector &sample_sel, const AbcReadGeometryParams &read_params, const char **r_err_str) override
BLI_INLINE float sharpness_to_crease(float sharpness)
IndexMask mesh_find_faces_duplicate_verts(const Mesh &mesh, IndexMaskMemory &memory)
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)
bool mesh_validate(Mesh &mesh, bool verbose=false, bool allow_missing_edges=false)
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)
static Mesh * read_mesh_sample(const AbcMeshData &abc_mesh_data, const ISampleSelector &selector, const AbcReadGeometryParams &read_params, Mesh *existing_mesh, const char **r_err_str, const bool is_reading_a_file_sequence)
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)
BLI_INLINE void read_uvs_params(CDStreamConfig &config, const IV2fGeomParam &uv, const ISampleSelector &selector)
void read_velocity(const V3fArraySamplePtr &velocities, const CDStreamConfig &config, const float velocity_scale)
static bool topology_changed(const AbcMeshData &abc_mesh_data, const Mesh *existing_mesh, const bool is_reading_a_file_sequence)
static Vector< std::string > get_face_set_names(const IPolyMeshSchema &schema)
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)
AbcFaceVaryingInterpolateBoundary
static CDStreamConfig get_config(Mesh *mesh)
static void config_reload_mesh(CDStreamConfig &config)
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 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)
bool has_animations(Alembic::AbcGeom::ICurvesSchema &schema, ImportSettings *settings)
static void read_mverts(CDStreamConfig &config, const AbcMeshData &mesh_data)
static AbcMeshData extract_mesh_data(const IObject &iobject, const IPolyMeshSchema &schema, const ISampleSelector &selector, const AbcReadGeometryParams ¶ms, const bool for_topology_check)
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)
void read_active_and_default_color_attributes(Mesh &mesh, const ICompoundProperty &user_props, const Alembic::AbcGeom::ISampleSelector &sample_sel)
bool size_fits_in_int(const int64_t size)
bool index_in_range(const int64_t index, const int64_t size)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
@ SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES
@ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS
@ SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE
void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, Mesh *mesh_dst, Object *ob, bool process_shape_keys=true)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void BKE_modifiers_persistent_uid_init(const Object &object, ModifierData &md)
VecBase< float, 2 > float2
ModifierData * BKE_modifier_new(int type)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
@ MOD_MESHSEQ_INTERPOLATE_VERTICES
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
@ SUBSURF_BOUNDARY_SMOOTH_PRESERVE_CORNERS
@ SUBSURF_BOUNDARY_SMOOTH_ALL
Mesh * BKE_mesh_new_nomain_from_template(const Mesh *me_src, int verts_num, int edges_num, int faces_num, int corners_num)
void BKE_object_material_assign_single_obdata(Main *bmain, Object *ob, Material *ma, short act)
Material * BKE_material_add(Main *bmain, const char *name)
VecBase< float, 3 > float3
Object * BKE_object_add_only_object(Main *bmain, ObjectType type, const char *name) ATTR_RETURNS_NONNULL
Mesh * BKE_mesh_add(Main *bmain, const char *name)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ListBaseT< Material > materials
ListBaseT< ModifierData > modifiers
eSubsurfUVSmooth uv_smooth
eSubsurfBoundarySmooth boundary_smooth
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Mesh * get_mesh_for_write()
MutableVArraySpan< T > span
P3fArraySamplePtr ceil_positions
V3fArraySamplePtr velocities
Int32ArraySamplePtr face_indices
IInt32ArrayProperty face_indices_property
Int32ArraySamplePtr face_counts
StringRef iobject_full_name
ICompoundProperty arb_geom_params
IInt32ArrayProperty face_counts_property
IN3fGeomParam normals_param
P3fArraySamplePtr positions
std::optional< SampleInterpolationSettings > interpolation_settings
std::string velocity_name
bke::SpanAttributeWriter< float2 > uv_map
const char ** modifier_error_message
UInt32ArraySamplePtr uvs_indices
Alembic::Abc::chrono_t time
bool blender_archive_version_prior_44
bool always_add_cache_reader