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
This commit is contained in:
Sean Kim 2024-02-28 14:41:47 +01:00 committed by Raul Fernandez Hernandez
parent 9060b0dfb7
commit aa75f841bf

@ -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;