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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-03-18 19:49:53 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-03-18 19:50:29 +0300
commit8e54ef69c66ff2458a508e5119a52fb17ad81515 (patch)
treeed32cb100c4b2b9e729d9b3587aada179aca17aa /source/blender/editors/physics
parentad3d9256821c197c44c6565ef2797cf361f12ec9 (diff)
Fix T62700: Disconnect hair bug
Need to use evaluated mesh from evaluated modifier data.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r--source/blender/editors/physics/particle_object.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index ac304f1aeec..2287659ef03 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -52,6 +52,7 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_query.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -580,7 +581,10 @@ static void disconnect_hair(
Depsgraph *depsgraph, Scene *scene,
Object *ob, ParticleSystem *psys)
{
- ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
+ Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
+ ParticleSystem *psys_eval = psys_eval_get(depsgraph, ob, psys);
+ ParticleSystemModifierData *psmd_eval =
+ psys_get_modifier(object_eval, psys_eval);
ParticleEditSettings *pset = PE_settings(scene);
ParticleData *pa;
PTCacheEdit *edit;
@@ -605,7 +609,8 @@ static void disconnect_hair(
point++;
}
- psys_mat_hair_to_global(ob, psmd->mesh_final, psys->part->from, pa, hairmat);
+ psys_mat_hair_to_global(
+ ob, psmd_eval->mesh_final, psys->part->from, pa, hairmat);
for (k = 0, key = pa->hair; k < pa->totkey; k++, key++) {
mul_m4_v3(hairmat, key->co);
@@ -678,7 +683,10 @@ static bool remap_hair_emitter(
Object *target_ob, ParticleSystem *target_psys, PTCacheEdit *target_edit,
float from_mat[4][4], float to_mat[4][4], bool from_global, bool to_global)
{
- ParticleSystemModifierData *target_psmd = psys_get_modifier(target_ob, target_psys);
+ Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
+ ParticleSystem *psys_eval = psys_eval_get(depsgraph, ob, psys);
+ ParticleSystemModifierData *target_psmd =
+ psys_get_modifier(object_eval, psys_eval);
ParticleData *pa, *tpa;
PTCacheEditPoint *edit_point;
PTCacheEditKey *ekey;