[Bf-blender-cvs] [7e245e482ca] master: Fix T59143: Frame Selected Doesn't work in hair particle editmode

Philipp Oeser noreply at git.blender.org
Wed Sep 11 18:05:27 CEST 2019


Commit: 7e245e482ca6f1c1d9a84c317feb151758316d34
Author: Philipp Oeser
Date:   Wed Sep 11 14:58:14 2019 +0200
Branches: master
https://developer.blender.org/rB7e245e482ca6f1c1d9a84c317feb151758316d34

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

===================================================================

M	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))) {



More information about the Bf-blender-cvs mailing list