Page MenuHome

Fix T92561: unstable particle distribution with Alembic files
ClosedPublic

Authored by Kévin Dietrich (kevindietrich) on Nov 22 2021, 12:09 PM.

Details

Summary

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.

Diff Detail

Repository
rB Blender
Branch
fix_t92561 (branched from master)
Build Status
Buildable 18850
Build 18850: arc lint + arc unit

Event Timeline

Kévin Dietrich (kevindietrich) requested review of this revision.Nov 22 2021, 12:09 PM
Kévin Dietrich (kevindietrich) created this revision.

A bit OT (and without having checked in any way): could the normalization of orco also be the problem in T91777: Mesh is not being deformated correctly via Mesh Deform Modifier (quads, tris behave better)?

Looks good to me.

@Philipp Oeser (lichtwerk), I think that's unrelated.

This revision is now accepted and ready to land.Nov 22 2021, 4:53 PM