diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-28 17:45:34 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-28 17:45:34 +0300 |
commit | 56cc21907042dfbeb9901cb5791bda9a5244e864 (patch) | |
tree | 04143eade69966718679a53689b22b32fbaab669 /source | |
parent | 9bc43223c109c413601eded1309963f3f4ec2568 (diff) |
Fix T59963: Can't manipulate hair keys with G, R, S or mirror transforms
Need to pass proper evaluated mesh to calculate hair matrix.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 5b07c0c2b49..a5154fd1e8a 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2087,7 +2087,6 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) ParticleEditSettings *pset = PE_settings(t->scene); PTCacheEdit *edit = PE_get_current(t->scene, ob); ParticleSystem *psys = NULL; - ParticleSystemModifierData *psmd = NULL; PTCacheEditPoint *point; PTCacheEditKey *key; float mat[4][4]; @@ -2099,9 +2098,6 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) psys = edit->psys; - if (psys) - psmd = psys_get_modifier(ob, psys); - for (i = 0, point = edit->points; i < edit->totpoint; i++, point++) { point->flag &= ~PEP_TRANSFORM; transformparticle = 0; @@ -2146,8 +2142,10 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) if (!(point->flag & PEP_TRANSFORM)) continue; - if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) - psys_mat_hair_to_global(ob, psmd->mesh_final, psys->part->from, psys->particles + i, mat); + if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) { + ParticleSystemModifierData *psmd_eval = edit->psmd_eval; + psys_mat_hair_to_global(ob, psmd_eval->mesh_final, psys->part->from, psys->particles + i, mat); + } for (k = 0, key = point->keys; k < point->totkey; k++, key++) { if (key->flag & PEK_USE_WCO) { @@ -2206,7 +2204,6 @@ void flushTransParticles(TransInfo *t) Object *ob = OBACT(view_layer); PTCacheEdit *edit = PE_get_current(scene, ob); ParticleSystem *psys = edit->psys; - ParticleSystemModifierData *psmd = NULL; PTCacheEditPoint *point; PTCacheEditKey *key; TransData *td; @@ -2214,9 +2211,6 @@ void flushTransParticles(TransInfo *t) int i, k; const bool is_prop_edit = (t->flag & T_PROP_EDIT) != 0; - if (psys) - psmd = psys_get_modifier(ob, psys); - /* we do transform in world space, so flush world space position * back to particle local space (only for hair particles) */ td = tc->data; @@ -2224,7 +2218,8 @@ void flushTransParticles(TransInfo *t) if (!(point->flag & PEP_TRANSFORM)) continue; if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) { - psys_mat_hair_to_global(ob, psmd->mesh_final, psys->part->from, psys->particles + i, mat); + ParticleSystemModifierData *psmd_eval = edit->psmd_eval; + psys_mat_hair_to_global(ob, psmd_eval->mesh_final, psys->part->from, psys->particles + i, mat); invert_m4_m4(imat, mat); for (k = 0, key = point->keys; k < point->totkey; k++, key++) { @@ -2244,6 +2239,7 @@ void flushTransParticles(TransInfo *t) } PE_update_object(t->depsgraph, scene, OBACT(view_layer), 1); + DEG_id_tag_update(&ob->id, ID_RECALC_SHADING); } } |