diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-08-16 15:52:08 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-08-16 15:52:08 +0300 |
commit | ee8aad79c1590cd0e98ba67961909ebfa8f6a803 (patch) | |
tree | 3d7ec905e3a4e1ce525d7f961699983afe56cce0 /source/blender/alembic/intern/abc_object.cc | |
parent | c70f975d5c3b961e0c77eba3a35c8a892f39214d (diff) |
Fix T56408: Hair children recalc on every frame on Alembic mesh
This fixes the glitching hairs described in T56408, T63534, and possibly
also T63534.
The fix consists of returning the original mesh (i.e. as visible in edit
mode) when constructing the ORCO mesh. This allows a static set of
coordinates to be used when computing the child hair positions.
The original mesh is only returned when it has the same topology (at
least same number of vertices, loops, and polys. It's up the author of
the Alembic file to ensure stable geometry when it's desired to be
compatible with Blender's hair system.
Reviewers: mont29, brecht
Differential Revision: https://developer.blender.org/D5492
Diffstat (limited to 'source/blender/alembic/intern/abc_object.cc')
-rw-r--r-- | source/blender/alembic/intern/abc_object.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/alembic/intern/abc_object.cc b/source/blender/alembic/intern/abc_object.cc index f863fe4fee7..ebebbc0da1e 100644 --- a/source/blender/alembic/intern/abc_object.cc +++ b/source/blender/alembic/intern/abc_object.cc @@ -246,6 +246,14 @@ struct Mesh *AbcObjectReader::read_mesh(struct Mesh *existing_mesh, return existing_mesh; } +bool AbcObjectReader::topology_changed(Mesh * /*existing_mesh*/, + const Alembic::Abc::ISampleSelector & /*sample_sel*/) +{ + /* The default implementation of read_mesh() just returns the original mesh, so never changes the + * topology. */ + return false; +} + void AbcObjectReader::setupObjectTransform(const float time) { bool is_constant = false; |