Fix #105339: grease pencil selection can toggle object selection #105342

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:105339 into blender-v3.5-release 2023-03-02 09:52:47 +01:00
1 changed files with 9 additions and 0 deletions

View File

@ -2992,6 +2992,15 @@ static int view3d_select_exec(bContext *C, wmOperator *op)
Object *obedit = CTX_data_edit_object(C);
Object *obact = CTX_data_active_object(C);
if (obact && obact->type == OB_GPENCIL && GPENCIL_ANY_MODE((bGPdata *)obact->data)) {
/* Prevent acting on Grease Pencil (when not in object mode), it implements its own selection
* operator in other modes. We might still fall trough to here (because that operator uses
* OPERATOR_PASS_THROUGH to make tweak work) but if we dont stop here code below assumes we are
* in object mode it might falsely toggle object selection. Alternatively, this could be put in
* the poll funtion instead. */
return OPERATOR_PASS_THROUGH | OPERATOR_CANCELLED;
}
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewContext vc;
ED_view3d_viewcontext_init(C, &vc, depsgraph);