diff options
Diffstat (limited to 'source/blender/io/alembic/intern/abc_reader_mesh.cc')
-rw-r--r-- | source/blender/io/alembic/intern/abc_reader_mesh.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc index ead908e87c2..e69c0edfec8 100644 --- a/source/blender/io/alembic/intern/abc_reader_mesh.cc +++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc @@ -155,8 +155,8 @@ static void read_mverts(CDStreamConfig &config, const AbcMeshData &mesh_data) MVert *mverts = config.mvert; const P3fArraySamplePtr &positions = mesh_data.positions; - if (config.weight != 0.0f && mesh_data.ceil_positions != NULL && - mesh_data.ceil_positions->size() == positions->size()) { + if (config.use_vertex_interpolation && config.weight != 0.0f && + mesh_data.ceil_positions != NULL && mesh_data.ceil_positions->size() == positions->size()) { read_mverts_interp(mverts, positions, mesh_data.ceil_positions, config.weight); return; } @@ -457,7 +457,7 @@ static void read_mesh_sample(const std::string &iobject_full_name, } } -CDStreamConfig get_config(Mesh *mesh) +CDStreamConfig get_config(Mesh *mesh, const bool use_vertex_interpolation) { CDStreamConfig config; @@ -471,6 +471,7 @@ CDStreamConfig get_config(Mesh *mesh) config.totpoly = mesh->totpoly; config.loopdata = &mesh->ldata; config.add_customdata_cb = add_customdata_cb; + config.use_vertex_interpolation = use_vertex_interpolation; return config; } @@ -646,7 +647,9 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh, } } - CDStreamConfig config = get_config(new_mesh ? new_mesh : existing_mesh); + Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh; + const bool use_vertex_interpolation = read_flag & MOD_MESHSEQ_INTERPOLATE_VERTICES; + CDStreamConfig config = get_config(mesh_to_export, use_vertex_interpolation); config.time = sample_sel.getRequestedTime(); config.modifier_error_message = err_str; @@ -936,11 +939,13 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh, } /* Only read point data when streaming meshes, unless we need to create new ones. */ - CDStreamConfig config = get_config(new_mesh ? new_mesh : existing_mesh); + Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh; + const bool use_vertex_interpolation = read_flag & MOD_MESHSEQ_INTERPOLATE_VERTICES; + CDStreamConfig config = get_config(mesh_to_export, use_vertex_interpolation); config.time = sample_sel.getRequestedTime(); read_subd_sample(m_iobject.getFullName(), &settings, m_schema, sample_sel, config); - return config.mesh; + return mesh_to_export; } } // namespace blender::io::alembic |