Fix #105339: grease pencil selection can toggle object selection
Grease Pencil (when not in object mode) implements its own selection
opertor. This operator (`gpencil.select`) returns
`OPERATOR_PASS_THROUGH`, then falls though to `view3d.select` which can
toggle object selection (when using shift-click picking).
Removing `OPERATOR_PASS_THROUGH` would fix the object toggling, but this
was added in 62c73db734 with good reason (the tweak tool would not
work then).
Now prevent `view3d.select` from acting on Grease Pencil (when not in
object mode).
NOTE: longer term we could have grease pencil use view3d.select to avoid having to add these awkward exceptions
Pull Request #105342
This commit is contained in:
committed by
Philipp Oeser
parent
944a6e78f5
commit
2eeec49640
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user