Fix part of T62720: crash loading alembic mesh that has no vertices.
This commit is contained in:
parent
af3f4f29e4
commit
12fe0b79ce
|
@ -1019,7 +1019,7 @@ CDStreamConfig get_config(Mesh *mesh)
|
|||
{
|
||||
CDStreamConfig config;
|
||||
|
||||
BLI_assert(mesh->mvert);
|
||||
BLI_assert(mesh->mvert || mesh->totvert == 0);
|
||||
|
||||
config.user_data = mesh;
|
||||
config.mvert = mesh->mvert;
|
||||
|
@ -1059,7 +1059,9 @@ void AbcMeshReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelec
|
|||
m_object->data = mesh;
|
||||
|
||||
Mesh *read_mesh = this->read_mesh(mesh, sample_sel, MOD_MESHSEQ_READ_ALL, NULL);
|
||||
BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, &CD_MASK_MESH, true);
|
||||
if (read_mesh != mesh) {
|
||||
BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, &CD_MASK_MESH, true);
|
||||
}
|
||||
|
||||
if (m_settings->validate_meshes) {
|
||||
BKE_mesh_validate(mesh, false, false);
|
||||
|
@ -1342,7 +1344,9 @@ void AbcSubDReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelec
|
|||
m_object->data = mesh;
|
||||
|
||||
Mesh *read_mesh = this->read_mesh(mesh, sample_sel, MOD_MESHSEQ_READ_ALL, NULL);
|
||||
BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, &CD_MASK_MESH, true);
|
||||
if (read_mesh != mesh) {
|
||||
BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, &CD_MASK_MESH, true);
|
||||
}
|
||||
|
||||
ISubDSchema::Sample sample;
|
||||
try {
|
||||
|
|
|
@ -174,7 +174,9 @@ void AbcPointsReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSel
|
|||
Mesh *mesh = BKE_mesh_add(bmain, m_data_name.c_str());
|
||||
Mesh *read_mesh = this->read_mesh(mesh, sample_sel, 0, NULL);
|
||||
|
||||
BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, &CD_MASK_MESH, true);
|
||||
if (read_mesh != mesh) {
|
||||
BKE_mesh_nomain_to_mesh(read_mesh, mesh, m_object, &CD_MASK_MESH, true);
|
||||
}
|
||||
|
||||
if (m_settings->validate_meshes) {
|
||||
BKE_mesh_validate(mesh, false, false);
|
||||
|
|
Loading…
Reference in New Issue