Alembic: Fix T52579: crash when replacing slightly different alembic files

Apparently with Maya in a certain configuration, it's possible to have an
Alembic object without schema in the Alembic file. This is now handled
properly, instead of crashing on a null pointer.
This commit is contained in:
Sybren A. Stüvel 2017-08-29 16:58:13 +02:00
parent 735e287271
commit 696f4dc85f
Notes: blender-bot 2023-02-14 06:38:13 +01:00
Referenced by issue #52579, Alembic Pipeline: Replacing slightly different alembic files.
2 changed files with 7 additions and 3 deletions

View File

@ -370,10 +370,10 @@ AbcObjectReader *create_reader(const Alembic::AbcGeom::IObject &object, ImportSe
reader = new AbcCurveReader(object, settings);
}
else {
std::cerr << "Alembic: unknown how to handle objects of schema "
std::cerr << "Alembic: unknown how to handle objects of schema '"
<< md.get("schemaObjTitle")
<< ", skipping object "
<< object.getFullName() << std::endl;
<< "', skipping object '"
<< object.getFullName() << "'" << std::endl;
}
return reader;

View File

@ -990,6 +990,10 @@ CacheReader *CacheReader_open_alembic_object(AbcArchiveHandle *handle, CacheRead
ImportSettings settings;
AbcObjectReader *abc_reader = create_reader(iobject, settings);
if (abc_reader == NULL) {
/* This object is not supported */
return NULL;
}
abc_reader->object(object);
abc_reader->incref();