Commit: 80b4987139ed6c77770eec6bc01d09954021d7b5
Author: Pablo Dobarro
Date:   Sun Jun 16 23:11:24 2019 +0200
Branches: sculpt-mode-features
https://developer.blender.org/rB80b4987139ed6c77770eec6bc01d09954021d7b5

Fix crash with mesh filters and EEVEE

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

M       source/blender/editors/sculpt_paint/sculpt.c

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

diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index 4096dcef384..d398f113c81 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -7893,6 +7893,7 @@ int sculpt_mesh_filter_modal(bContext *C, wmOperator *op, 
const wmEvent *event)
   Object *ob = CTX_data_active_object(C);
   SculptSession *ss = ob->sculpt;
   Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
+  View3D *v3d = CTX_wm_view3d(C);
   int mode = RNA_enum_get(op->ptr, "type");
   float filter_strength = RNA_float_get(op->ptr, "strength");
 
@@ -7903,6 +7904,22 @@ int sculpt_mesh_filter_modal(bContext *C, wmOperator 
*op, const wmEvent *event)
     return OPERATOR_RUNNING_MODAL;
   }
 
+  if (!BKE_sculptsession_use_pbvh_draw(ob, v3d)) {
+    if (ss->filter_cache->nodes) {
+      MEM_freeN(ss->filter_cache->nodes);
+    }
+    SculptSearchSphereData searchdata = {
+        .ss = ss,
+        .sd = sd,
+        .radius_squared = FLT_MAX,
+    };
+    BKE_pbvh_search_gather(ss->pbvh,
+                           sculpt_search_sphere_cb,
+                           &searchdata,
+                           &ss->filter_cache->nodes,
+                           &ss->filter_cache->totnode);
+  }
+
   SculptThreadedTaskData data = {
       .sd = sd,
       .ob = ob,

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to