diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-04-04 18:05:47 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-04-06 17:47:00 +0300 |
commit | bc55c19807d5b4fb5cceb98fd1790c227f21f3b4 (patch) | |
tree | 8401fa39672b73b5e5860c913da478b34eb8a811 /source/blender/alembic/intern/abc_object.cc | |
parent | 42cd2719ec996fc3fd4fb8606c74d574c575b160 (diff) |
Alembic import: fixed crash on more complex model
There was a problem with parent-child relations not getting set up
correctly when an Alembic object was both the transform for a mesh object
and the parent of other mesh objects.
Diffstat (limited to 'source/blender/alembic/intern/abc_object.cc')
-rw-r--r-- | source/blender/alembic/intern/abc_object.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/alembic/intern/abc_object.cc b/source/blender/alembic/intern/abc_object.cc index 9afca0f0988..bc66f241071 100644 --- a/source/blender/alembic/intern/abc_object.cc +++ b/source/blender/alembic/intern/abc_object.cc @@ -286,6 +286,17 @@ void AbcObjectReader::read_matrix(float r_mat[4][4], const float time, } else { has_alembic_parent = ixform_parent && schema.getInheritsXforms(); + + if (has_alembic_parent && m_object->parent == NULL) { + /* TODO Sybren: This happened in some files. I think I solved it, + * but I'll leave this check in here anyway until we've tested it + * more thoroughly. Better than crashing on a null parent anyway. */ + std::cerr << "Alembic object " << m_iobject.getFullName() + << " with transform " << ixform.getFullName() + << " has an Alembic parent but no parent Blender object." + << std::endl; + has_alembic_parent = false; + } } const Imath::M44d matrix = get_matrix(schema, time); |