Fix #105339: grease pencil selection can toggle object selection #105342
|
@ -2992,6 +2992,15 @@ static int view3d_select_exec(bContext *C, wmOperator *op)
|
||||||
Object *obedit = CTX_data_edit_object(C);
|
Object *obedit = CTX_data_edit_object(C);
|
||||||
Object *obact = CTX_data_active_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);
|
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||||
ViewContext vc;
|
ViewContext vc;
|
||||||
ED_view3d_viewcontext_init(C, &vc, depsgraph);
|
ED_view3d_viewcontext_init(C, &vc, depsgraph);
|
||||||
|
|
Loading…
Reference in New Issue