Blender Git Loki

Git Commits -> Revision 7246ab3

Revision 7246ab3 by Kévin Dietrich (lineart-shadow)
December 8, 2021, 06:51 (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: 7246ab352ae3aebf9c6ed9c9d6edc301564f2794
Parent Commit: 5fcdc27
Committed By: YimingWu
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)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021