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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-05-25 22:44:33 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-05-26 00:20:20 +0300
commitc9f7a3b32a39aec2c7826f2ffa9939fd705e7237 (patch)
tree009def8c360ace12f15143bddad06f7ebef4ea16 /source/blender/editors/physics
parent768706c6a58fe6b93f3534ca65d1912cbf066e68 (diff)
Fix T55207, fix T55208: hair not positioned correctly after subsurf.
The problem was that the particle system modifier was reading ob->derivedDeform during modifier stack evaluation. Due to the mesh -> DM conversion this was no longer set leading to wrong results. In fact we don't really need the deformed mesh, just the original mesh topology for face/poly index remapping. So the solution is to use that instead.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r--source/blender/editors/physics/particle_edit.c8
-rw-r--r--source/blender/editors/physics/particle_object.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 5210ff76491..b8a5c138a57 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -2963,7 +2963,7 @@ static void PE_mirror_x(
}
else {
newpa->num_dmcache = psys_particle_dm_face_lookup(
- psmd->mesh_final, psmd->mesh_deformed, newpa->num, newpa->fuv, NULL);
+ psmd->mesh_final, psmd->mesh_original, newpa->num, newpa->fuv, NULL);
}
/* update edit key pointers */
@@ -3557,7 +3557,7 @@ static int brush_add(const bContext *C, PEData *data, short number)
mesh = psmd->mesh_final;
}
else {
- mesh = psmd->mesh_deformed;
+ mesh = psmd->mesh_original;
}
BLI_assert(mesh);
@@ -3591,11 +3591,11 @@ static int brush_add(const bContext *C, PEData *data, short number)
add_pars[n].num = add_pars[n].num_dmcache;
add_pars[n].num_dmcache = DMCACHE_ISCHILD;
}
- else if (mesh == psmd->mesh_deformed) {
+ else if (mesh == psmd->mesh_original) {
/* Final DM is not same topology as orig mesh, we have to map num_dmcache to real final dm. */
add_pars[n].num = add_pars[n].num_dmcache;
add_pars[n].num_dmcache = psys_particle_dm_face_lookup(
- psmd->mesh_final, psmd->mesh_deformed,
+ psmd->mesh_final, psmd->mesh_original,
add_pars[n].num, add_pars[n].fuv, NULL);
}
else {
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index cb7c90a6c3d..55f518a2a8c 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -680,7 +680,7 @@ static bool remap_hair_emitter(
mesh = target_psmd->mesh_final;
}
else {
- mesh = target_psmd->mesh_deformed;
+ mesh = target_psmd->mesh_original;
}
target_mesh = target_psmd->mesh_final;
if (mesh == NULL) {