GPencil: Disable Select operator for Sculpt mode if Mask is OFF

The selection is only valid when the mask is enabled, so the operators must be disabled.

This modification is part of D5452
This commit is contained in:
Antonio Vazquez 2019-08-10 16:34:24 +02:00 committed by Antonioya
parent 9e68b560a6
commit 049c50e095
1 changed files with 7 additions and 0 deletions

View File

@ -71,6 +71,13 @@ static bool gpencil_select_poll(bContext *C)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
if (GPENCIL_SCULPT_MODE(gpd)) {
ToolSettings *ts = CTX_data_tool_settings(C);
if ((ts->gp_sculpt.flag & GP_SCULPT_SETT_FLAG_SELECT_MASK) == 0) {
return false;
}
}
/* we just need some visible strokes, and to be in editmode or other modes only to catch event */
if (GPENCIL_ANY_MODE(gpd)) {
/* TODO: include a check for visible strokes? */