Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2021-11-22 14:04:37 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2021-12-01 14:44:32 +0300
commit02ab4ad991906f817698d3810c3d464cfaedcaff (patch)
tree1ce39dfc6dc73a16d8912b437bd816d6f01f9620 /source/blender/blenkernel/BKE_mesh.h
parentfd224048375bf7a9d970c226b7ac843458d5428e (diff)
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
Diffstat (limited to 'source/blender/blenkernel/BKE_mesh.h')
-rw-r--r--source/blender/blenkernel/BKE_mesh.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index be9b84ccd62..135f8128b9a 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -136,6 +136,10 @@ bool BKE_mesh_clear_facemap_customdata(struct Mesh *me);
float (*BKE_mesh_orco_verts_get(struct Object *ob))[3];
void BKE_mesh_orco_verts_transform(struct Mesh *me, float (*orco)[3], int totvert, int invert);
+
+/* Add a CD_ORCO layer to the Mesh if there is none already. */
+void BKE_mesh_orco_ensure(struct Object *ob, struct Mesh *mesh);
+
int BKE_mesh_mface_index_validate(struct MFace *mface,
struct CustomData *mfdata,
int mfindex,