Blender Git Commit Log

Git Commits -> Revision 02ab4ad

Revision 02ab4ad by Kévin Dietrich (master)
December 1, 2021, 11:44 (GMT)
Fix T92561: unstable particle distribution with Alembic files

When enabling or disabling a Mesh Sequence Cache modifier of an Object
with a hair particle system, the hair would switch positions. This is
caused because original coordinates in Blender are expected to be
normalized, and toggling the modifier would cause the usage of different
orco layers: one that is normalized, and the other which isn't.

This bug exposes a few related issues:
- if the Alembic file did not have orco data,
`MOD_deform_mesh_eval_get`, used by the particle system modifier, would
add an orco layer without normalization
- `MOD_deform_mesh_eval_get` would also ignore the presence of an orco
layer (e.g. one that could have been read from Alembic)
- if the Alembic file did have orco data, the data would be read
unnormalized

To fix those various issues, original coordinates are normalized when
read from Alembic and unnormalized when written to Alembic; and a new
utility function `BKE_mesh_orco_ensure` is added to add a normalized
orco layer if none exists on the mesh already, this function derives
from the code used in the particle system.

Reviewed By: brecht

Maniphest Tasks: T92561

Differential Revision: https://developer.blender.org/D13306

Commit Details:

Full Hash: 02ab4ad991906f817698d3810c3d464cfaedcaff
Parent Commit: fd22404
Lines Changed: +34, -12

5 Modified Paths:

/source/blender/blenkernel/BKE_mesh.h (+4, -0) (Diff)
/source/blender/blenkernel/intern/mesh.cc (+12, -0) (Diff)
/source/blender/blenkernel/intern/particle_distribute.c (+1, -6) (Diff)
/source/blender/io/alembic/intern/abc_customdata.cc (+16, -4) (Diff)
/source/blender/modifiers/intern/MOD_util.c (+1, -2) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021