From aa75f841bf46373f96442d17ff2a42804a41aeff Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Wed, 28 Feb 2024 14:41:47 +0100 Subject: [PATCH] Fix: Disable set_persistent_base for invisible objects This PR disables the `SCULPT_OT_set_persistent_base` operator for invisible objects. Addresses part of #112371 --- source/blender/editors/sculpt_paint/sculpt_ops.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/blender/editors/sculpt_paint/sculpt_ops.cc b/source/blender/editors/sculpt_paint/sculpt_ops.cc index 7f75bb14eec..1967c09562b 100644 --- a/source/blender/editors/sculpt_paint/sculpt_ops.cc +++ b/source/blender/editors/sculpt_paint/sculpt_ops.cc @@ -79,6 +79,12 @@ static int sculpt_set_persistent_base_exec(bContext *C, wmOperator * /*op*/) Object *ob = CTX_data_active_object(C); SculptSession *ss = ob->sculpt; + const View3D *v3d = CTX_wm_view3d(C); + const Base *base = CTX_data_active_base(C); + if (!BKE_base_is_visible(v3d, base)) { + return OPERATOR_CANCELLED; + } + /* Do not allow in DynTopo just yet. */ if (!ss || (ss && ss->bm)) { return OPERATOR_FINISHED;