Fix T59143: Frame Selected Doesn't work in hair particle editmode

This is caused by rBeb521b22b2b1.

Looks like `PE_minmax` doesnt play nice with the evaluated view_layer.
If we look inside `PE_get_current`, then `BKE_ptcache_ids_from_object`
will actually return a list of `PTCacheID` for the evaluated object.
However, looking further, then `PTCacheEdit` / `psys->pointcache->edit`
is always NULL for the evaluated object.

Without a valid `PTCacheEdit`, `PE_minmax` will basically do nothing.
So now we are passing the non-evaluated view layer in the case of
particles.

Regarding to @sergey, in a longer term we should probably make it so
evaluated pointcache have pointer to edit.

Reviewers: sergey

Maniphest Tasks: T59143

Differential Revision: https://developer.blender.org/D5758
This commit is contained in:
Philipp Oeser 2019-09-11 14:58:14 +02:00
parent 30aa67d5d5
commit 7e245e482c
Notes: blender-bot 2023-07-10 10:12:37 +02:00
Referenced by issue #59143, Frame Selected Doesn't work in Particle edit Mode (hair)
1 changed files with 1 additions and 1 deletions

View File

@ -2997,7 +2997,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
ok = paintface_minmax(ob_eval, min, max);
}
else if (ob_eval && (ob_eval->mode & OB_MODE_PARTICLE_EDIT)) {
ok = PE_minmax(scene, view_layer_eval, min, max);
ok = PE_minmax(scene, CTX_data_view_layer(C), min, max);
}
else if (ob_eval && (ob_eval->mode & (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT |
OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))) {