From 7e245e482ca6f1c1d9a84c317feb151758316d34 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Wed, 11 Sep 2019 14:58:14 +0200 Subject: 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 --- source/blender/editors/space_view3d/view3d_edit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_view3d/view3d_edit.c') diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index e76ef2b0458..4bc74ab8fba 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -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))) { -- cgit v1.2.3