Commit: 64541b242aa9378b87f9e699f2838b1f86506bb0 Author: Hans Goudey Date: Tue Dec 6 10:00:12 2022 -0600 Branches: master https://developer.blender.org/rB64541b242aa9378b87f9e699f2838b1f86506bb0
Fix T102940: "Mask by Color" sculpt tool crash We need to ensure the mask layer exists before running the operator. I made the order of function calls here the same as in newer code later on in this file for consistency. Differential Revision: https://developer.blender.org/D16696 =================================================================== M source/blender/editors/sculpt_paint/sculpt_ops.c =================================================================== diff --git a/source/blender/editors/sculpt_paint/sculpt_ops.c b/source/blender/editors/sculpt_paint/sculpt_ops.c index 4abd4ad83af..34dd6efaab5 100644 --- a/source/blender/editors/sculpt_paint/sculpt_ops.c +++ b/source/blender/editors/sculpt_paint/sculpt_ops.c @@ -910,13 +910,15 @@ static int sculpt_mask_by_color_invoke(bContext *C, wmOperator *op, const wmEven v3d->shading.color_type = V3D_SHADING_VERTEX_COLOR; } - BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false); - /* Color data is not available in multi-resolution or dynamic topology. */ if (!SCULPT_handles_colors_report(ss, op->reports)) { return OPERATOR_CANCELLED; } + MultiresModifierData *mmd = BKE_sculpt_multires_active(CTX_data_scene(C), ob); + BKE_sculpt_mask_layers_ensure(depsgraph, CTX_data_main(C), ob, mmd); + + BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false); SCULPT_vertex_random_access_ensure(ss); /* Tools that are not brushes do not have the brush gizmo to update the vertex as the mouse move, _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
