handle invalid file type

This commit is contained in:
Ondrej Samohel 2021-12-08 19:04:02 +01:00
parent 6e127d273c
commit 535aa5b29b
No known key found for this signature in database
GPG key ID: 02376E18990A97C6

View file

@ -41,7 +41,12 @@ def get_alembic_paths_by_property(filename, attr, verbose=False):
filename = filename.replace("\\", "/")
filename = str(filename) # path must be string
archive = alembic.Abc.IArchive(filename)
try:
archive = alembic.Abc.IArchive(filename)
except RuntimeError:
# invalid alembic file - probably vrmesh
log.warning("{} is not an alembic file".format(filename))
return {}
root = archive.getTop()
iterator = list(root.children)