diff options
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-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); } } |