GPv3: Remove OB_MODE_PAINT_GREASE_PENCIL flag #121027

Merged
Falk David merged 2 commits from filedescriptor/blender:gpv3-use-legacy-paint-mode-flag into main 2024-04-25 14:23:58 +02:00
13 changed files with 102 additions and 159 deletions

View File

@ -725,7 +725,7 @@ class VIEW3D_HT_header(Header):
else:
if (object_mode not in {
'SCULPT', 'SCULPT_CURVES', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT',
'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL', 'VERTEX_GPENCIL', 'PAINT_GREASE_PENCIL',
'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL', 'VERTEX_GPENCIL',
}) or has_pose_mode:
show_snap = True
else:
@ -870,11 +870,11 @@ class VIEW3D_HT_header(Header):
depress=(tool_settings.gpencil_selectmode_edit == 'STROKE'),
).mode = 'STROKE'
if object_mode == 'PAINT_GREASE_PENCIL':
if object_mode == 'PAINT_GPENCIL':
row = layout.row(align=True)
row.prop(tool_settings, "use_gpencil_draw_additive", text="", icon='FREEZE')
if object_mode in {'PAINT_GREASE_PENCIL', 'EDIT', 'WEIGHT_PAINT'}:
if object_mode in {'PAINT_GPENCIL', 'EDIT', 'WEIGHT_PAINT'}:
row = layout.row(align=True)
row.prop(tool_settings, "use_grease_pencil_multi_frame_editing", text="")
@ -961,9 +961,9 @@ class VIEW3D_HT_header(Header):
layout.separator_spacer()
if object_mode in {'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'PAINT_GREASE_PENCIL'}:
if object_mode in {'PAINT_GPENCIL', 'SCULPT_GPENCIL'}:
# Grease pencil
if object_mode in {'PAINT_GPENCIL', 'PAINT_GREASE_PENCIL'}:
if object_mode == 'PAINT_GPENCIL':
sub = layout.row(align=True)
sub.prop_with_popover(
tool_settings,
@ -972,7 +972,7 @@ class VIEW3D_HT_header(Header):
panel="VIEW3D_PT_gpencil_origin",
)
if object_mode in {'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'PAINT_GREASE_PENCIL'}:
if object_mode in {'PAINT_GPENCIL', 'SCULPT_GPENCIL'}:
sub = layout.row(align=True)
sub.active = tool_settings.gpencil_stroke_placement_view3d != 'SURFACE'
sub.prop_with_popover(
@ -985,7 +985,8 @@ class VIEW3D_HT_header(Header):
if object_mode == 'PAINT_GPENCIL':
# FIXME: this is bad practice!
# Tool options are to be displayed in the top-bar.
if context.workspace.tools.from_space_view3d_mode(object_mode).idname == "builtin_brush.Draw":
tool = context.workspace.tools.from_space_view3d_mode(object_mode)
if tool and tool.idname == "builtin_brush.Draw":
settings = tool_settings.gpencil_sculpt.guide
row = layout.row(align=True)
row.prop(settings, "use_guide", text="", icon='GRID')
@ -1166,7 +1167,7 @@ class VIEW3D_MT_editor_menus(Menu):
obj = context.active_object
mode_string = context.mode
edit_object = context.edit_object
gp_edit = obj and obj.mode in {
gp_edit = obj and obj.type == 'GPENCIL' and obj.mode in {
'EDIT_GPENCIL', 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL', 'VERTEX_GPENCIL',
}
tool_settings = context.tool_settings

View File

@ -84,6 +84,7 @@ extern const uchar PAINT_CURSOR_VERTEX_PAINT[3];
extern const uchar PAINT_CURSOR_WEIGHT_PAINT[3];
extern const uchar PAINT_CURSOR_TEXTURE_PAINT[3];
extern const uchar PAINT_CURSOR_SCULPT_CURVES[3];
extern const uchar PAINT_CURSOR_PAINT_GREASE_PENCIL[3];
extern const uchar PAINT_CURSOR_SCULPT_GREASE_PENCIL[3];
enum class PaintMode : int8_t {

View File

@ -1183,7 +1183,12 @@ enum eContextObjectMode CTX_data_mode_enum_ex(const Object *obedit,
return CTX_MODE_PARTICLE;
}
if (object_mode & OB_MODE_PAINT_GPENCIL_LEGACY) {
return CTX_MODE_PAINT_GPENCIL_LEGACY;
if (ob->type == OB_GPENCIL_LEGACY) {
return CTX_MODE_PAINT_GPENCIL_LEGACY;
}
if (ob->type == OB_GREASE_PENCIL) {
return CTX_MODE_PAINT_GREASE_PENCIL;
}
}
if (object_mode & OB_MODE_EDIT_GPENCIL_LEGACY) {
return CTX_MODE_EDIT_GPENCIL_LEGACY;
@ -1210,9 +1215,6 @@ enum eContextObjectMode CTX_data_mode_enum_ex(const Object *obedit,
if (object_mode & OB_MODE_SCULPT_CURVES) {
return CTX_MODE_SCULPT_CURVES;
}
if (object_mode & OB_MODE_PAINT_GREASE_PENCIL) {
return CTX_MODE_PAINT_GREASE_PENCIL;
}
}
}

View File

@ -251,6 +251,7 @@ const uchar PAINT_CURSOR_VERTEX_PAINT[3] = {255, 255, 255};
const uchar PAINT_CURSOR_WEIGHT_PAINT[3] = {200, 200, 255};
const uchar PAINT_CURSOR_TEXTURE_PAINT[3] = {255, 255, 255};
const uchar PAINT_CURSOR_SCULPT_CURVES[3] = {255, 100, 100};
const uchar PAINT_CURSOR_PAINT_GREASE_PENCIL[3] = {255, 100, 100};
const uchar PAINT_CURSOR_SCULPT_GREASE_PENCIL[3] = {255, 100, 100};
static ePaintOverlayControlFlags overlay_flags = (ePaintOverlayControlFlags)0;
@ -532,8 +533,6 @@ Paint *BKE_paint_get_active(Scene *sce, ViewLayer *view_layer)
return &ts->gp_weightpaint->paint;
case OB_MODE_SCULPT_CURVES:
return &ts->curves_sculpt->paint;
case OB_MODE_PAINT_GREASE_PENCIL:
return &ts->gp_paint->paint;
case OB_MODE_EDIT:
return ts->uvsculpt ? &ts->uvsculpt->paint : nullptr;
default:
@ -615,6 +614,8 @@ PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
return PaintMode::SculptGreasePencil;
}
return PaintMode::Invalid;
case OB_MODE_PAINT_GPENCIL_LEGACY:
return PaintMode::GPencil;
case OB_MODE_WEIGHT_GPENCIL_LEGACY:
return PaintMode::WeightGPencil;
case OB_MODE_VERTEX_PAINT:
@ -627,8 +628,6 @@ PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
return PaintMode::SculptUV;
case OB_MODE_SCULPT_CURVES:
return PaintMode::SculptCurves;
case OB_MODE_PAINT_GREASE_PENCIL:
return PaintMode::GPencil;
default:
return PaintMode::Texture2D;
}
@ -728,12 +727,7 @@ void BKE_paint_runtime_init(const ToolSettings *ts, Paint *paint)
}
else if (ts->gp_paint && paint == &ts->gp_paint->paint) {
paint->runtime.tool_offset = offsetof(Brush, gpencil_tool);
if (U.experimental.use_grease_pencil_version3) {
paint->runtime.ob_mode = OB_MODE_PAINT_GREASE_PENCIL;
}
else {
paint->runtime.ob_mode = OB_MODE_PAINT_GPENCIL_LEGACY;
}
paint->runtime.ob_mode = OB_MODE_PAINT_GPENCIL_LEGACY;
}
else if (ts->gp_vertexpaint && paint == &ts->gp_vertexpaint->paint) {
paint->runtime.tool_offset = offsetof(Brush, gpencil_vertex_tool);
@ -1115,7 +1109,7 @@ eObjectMode BKE_paint_object_mode_from_paintmode(const PaintMode mode)
case PaintMode::SculptCurves:
return OB_MODE_SCULPT_CURVES;
case PaintMode::GPencil:
return OB_MODE_PAINT_GREASE_PENCIL;
return OB_MODE_PAINT_GPENCIL_LEGACY;
case PaintMode::SculptGreasePencil:
return OB_MODE_SCULPT_GPENCIL_LEGACY;
case PaintMode::Invalid:

View File

@ -781,9 +781,11 @@ static GPENCIL_tObject *grease_pencil_object_cache_populate(GPENCIL_PrivateData
const VArray<int> stroke_materials = *attributes.lookup_or_default<int>(
"material_index", bke::AttrDomain::Curve, 0);
const bool only_lines =
!ELEM(ob->mode, OB_MODE_PAINT_GREASE_PENCIL, OB_MODE_WEIGHT_PAINT, OB_MODE_VERTEX_PAINT) &&
info.frame_number != pd->cfra && pd->use_multiedit_lines_only;
const bool only_lines = !ELEM(ob->mode,
OB_MODE_PAINT_GPENCIL_LEGACY,
OB_MODE_WEIGHT_GPENCIL_LEGACY,
OB_MODE_VERTEX_GPENCIL_LEGACY) &&
info.frame_number != pd->cfra && pd->use_multiedit_lines_only;
const bool is_onion = info.onion_id != 0;
visible_strokes.foreach_index([&](const int stroke_i) {

View File

@ -339,10 +339,22 @@ static bool gpencil_paintmode_toggle_poll(bContext *C)
{
/* if using gpencil object, use this gpd */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
if ((ob) && (ELEM(ob->type, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL))) {
return ob->data != nullptr;
}
return ED_gpencil_data_get_active(C) != nullptr;
LukasTonne marked this conversation as resolved
Review

Is this check important to keep for the GPv2 case? IIRC it compares the "internal" mode to make sure it matches the object mode.

Is this check important to keep for the GPv2 case? IIRC it compares the "internal" mode to make sure it matches the object mode.
Review

You're right I should keep it to avoid any potential issues.

You're right I should keep it to avoid any potential issues.
Review

Actually, ED_gpencil_data_get_active seems like it's doing the same exact thing as the if above.

Actually, `ED_gpencil_data_get_active` seems like it's doing the same exact thing as the `if` above.
return false;
}
static bool gpencil_paint_poll_view3d(bContext *C)
{
const Object *ob = CTX_data_active_object(C);
if (ob == nullptr || (ob->mode & OB_MODE_PAINT_GPENCIL_LEGACY) == 0) {
return false;
}
if (CTX_wm_region_view3d(C) == nullptr) {
return false;
}
return true;
}
static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op)
@ -351,7 +363,6 @@ static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op)
wmMsgBus *mbus = CTX_wm_message_bus(C);
Main *bmain = CTX_data_main(C);
bGPdata *gpd = ED_gpencil_data_get_active(C);
ToolSettings *ts = CTX_data_tool_settings(C);
bool is_object = false;
@ -359,28 +370,48 @@ static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op)
/* if using a gpencil object, use this datablock */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
gpd = static_cast<bGPdata *>(ob->data);
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
if (gpd == nullptr) {
return OPERATOR_CANCELLED;
}
/* Just toggle paintmode flag... */
gpd->flag ^= GP_DATA_STROKE_PAINTMODE;
/* set mode */
if (gpd->flag & GP_DATA_STROKE_PAINTMODE) {
mode = OB_MODE_PAINT_GPENCIL_LEGACY;
}
else {
mode = OB_MODE_OBJECT;
}
is_object = true;
}
if (gpd == nullptr) {
return OPERATOR_CANCELLED;
}
/* Just toggle paintmode flag... */
gpd->flag ^= GP_DATA_STROKE_PAINTMODE;
/* set mode */
if (gpd->flag & GP_DATA_STROKE_PAINTMODE) {
mode = OB_MODE_PAINT_GPENCIL_LEGACY;
}
else {
mode = OB_MODE_OBJECT;
if ((ob) && (ob->type == OB_GREASE_PENCIL)) {
const bool is_mode_set = (ob->mode & OB_MODE_PAINT_GPENCIL_LEGACY) != 0;
if (!is_mode_set) {
Scene *scene = CTX_data_scene(C);
BKE_paint_init(bmain, scene, PaintMode::GPencil, PAINT_CURSOR_PAINT_GREASE_PENCIL);
Paint *paint = BKE_paint_get_active_from_paintmode(scene, PaintMode::GPencil);
ED_paint_cursor_start(paint, gpencil_paint_poll_view3d);
mode = OB_MODE_PAINT_GPENCIL_LEGACY;
}
else {
mode = OB_MODE_OBJECT;
}
is_object = true;
}
if (is_object) {
/* try to back previous mode */
if ((ob->restore_mode) && ((gpd->flag & GP_DATA_STROKE_PAINTMODE) == 0) && (back == 1)) {
mode = ob->restore_mode;
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
if ((ob->restore_mode) && ((gpd->flag & GP_DATA_STROKE_PAINTMODE) == 0) && (back == 1)) {
mode = ob->restore_mode;
}
}
if (ob->type == OB_GREASE_PENCIL) {
if ((ob->restore_mode) && ((ob->mode & OB_MODE_PAINT_GPENCIL_LEGACY) == 0) && (back == 1)) {
mode = ob->restore_mode;
}
}
ob->restore_mode = ob->mode;
ob->mode = mode;
@ -406,10 +437,17 @@ static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op)
BKE_paint_toolslots_brush_validate(bmain, &ts->gp_paint->paint);
}
/* setup other modes */
ED_gpencil_setup_modes(C, gpd, mode);
/* set cache as dirty */
DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
/* setup other modes */
ED_gpencil_setup_modes(C, gpd, mode);
/* set cache as dirty */
DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
}
if (ob->type == OB_GREASE_PENCIL) {
GreasePencil *grease_pencil = static_cast<GreasePencil *>(ob->data);
DEG_id_tag_update(&grease_pencil->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
}
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, nullptr);
WM_event_add_notifier(C, NC_SCENE | ND_MODE, nullptr);

View File

@ -72,7 +72,7 @@ bool grease_pencil_painting_poll(bContext *C)
return false;
}
Object *object = CTX_data_active_object(C);
if ((object->mode & OB_MODE_PAINT_GREASE_PENCIL) == 0) {
if ((object->mode & OB_MODE_PAINT_GPENCIL_LEGACY) == 0) {
return false;
}
ToolSettings *ts = CTX_data_tool_settings(C);

View File

@ -2627,7 +2627,6 @@ int UI_icon_from_object_mode(const int mode)
return ICON_PARTICLEMODE;
case OB_MODE_POSE:
return ICON_POSE_HLT;
case OB_MODE_PAINT_GREASE_PENCIL:
case OB_MODE_PAINT_GPENCIL_LEGACY:
return ICON_GREASEPENCIL;
}

View File

@ -82,9 +82,6 @@ static const char *object_mode_op_string(eObjectMode mode)
if (mode == OB_MODE_EDIT_GPENCIL_LEGACY) {
return "GPENCIL_OT_editmode_toggle";
}
if (mode == OB_MODE_PAINT_GREASE_PENCIL) {
return "GREASE_PENCIL_OT_draw_mode_toggle";
}
if (mode == OB_MODE_PAINT_GPENCIL_LEGACY) {
return "GPENCIL_OT_paintmode_toggle";
}
@ -148,7 +145,7 @@ bool mode_compat_test(const Object *ob, eObjectMode mode)
}
break;
case OB_GREASE_PENCIL:
if (mode & (OB_MODE_EDIT | OB_MODE_PAINT_GREASE_PENCIL | OB_MODE_SCULPT_GPENCIL_LEGACY |
if (mode & (OB_MODE_EDIT | OB_MODE_PAINT_GPENCIL_LEGACY | OB_MODE_SCULPT_GPENCIL_LEGACY |
OB_MODE_WEIGHT_GPENCIL_LEGACY))
{
return true;
@ -307,10 +304,17 @@ static bool ed_object_mode_generic_exit_ex(
}
ED_object_gpencil_exit(bmain, ob);
}
else if (ob->mode & OB_MODE_PAINT_GREASE_PENCIL) {
ob->mode &= ~OB_MODE_PAINT_GREASE_PENCIL;
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY | ID_RECALC_SYNC_TO_EVAL);
WM_main_add_notifier(NC_SCENE | ND_MODE | NS_MODE_OBJECT, nullptr);
else if (ob->type == OB_GREASE_PENCIL) {
BLI_assert((ob->mode & OB_MODE_OBJECT) == 0);
if (only_test) {
return true;
}
ob->restore_mode = ob->mode;
ob->mode &= ~(OB_MODE_PAINT_GPENCIL_LEGACY | OB_MODE_EDIT | OB_MODE_SCULPT_GPENCIL_LEGACY |
OB_MODE_WEIGHT_GPENCIL_LEGACY | OB_MODE_VERTEX_GPENCIL_LEGACY);
/* Inform all evaluated versions that we changed the mode. */
DEG_id_tag_update_ex(bmain, &ob->id, ID_RECALC_SYNC_TO_EVAL);
}
else {
if (only_test) {

View File

@ -325,91 +325,6 @@ static void GREASE_PENCIL_OT_sculpt_paint(wmOperatorType *ot)
/** \} */
/* -------------------------------------------------------------------- */
/** \name Toggle Draw Mode
* \{ */
static bool grease_pencil_mode_poll_paint_cursor(bContext *C)
{
if (!grease_pencil_brush_stroke_poll(C)) {
return false;
}
if (CTX_wm_region_view3d(C) == nullptr) {
return false;
}
return true;
}
static void grease_pencil_draw_mode_enter(bContext *C)
{
Scene *scene = CTX_data_scene(C);
wmMsgBus *mbus = CTX_wm_message_bus(C);
Object *ob = CTX_data_active_object(C);
GpPaint *grease_pencil_paint = scene->toolsettings->gp_paint;
BKE_paint_ensure(scene->toolsettings, (Paint **)&grease_pencil_paint);
ob->mode = OB_MODE_PAINT_GREASE_PENCIL;
/* TODO: Setup cursor color. BKE_paint_init() could be used, but creates an additional brush. */
ED_paint_cursor_start(&grease_pencil_paint->paint, grease_pencil_mode_poll_paint_cursor);
paint_init_pivot(ob, scene);
/* Necessary to change the object mode on the evaluated object. */
DEG_id_tag_update(&ob->id, ID_RECALC_SYNC_TO_EVAL);
WM_msg_publish_rna_prop(mbus, &ob->id, ob, Object, mode);
WM_event_add_notifier(C, NC_SCENE | ND_MODE, nullptr);
}
static void grease_pencil_draw_mode_exit(bContext *C)
{
Object *ob = CTX_data_active_object(C);
ob->mode = OB_MODE_OBJECT;
}
static int grease_pencil_draw_mode_toggle_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
wmMsgBus *mbus = CTX_wm_message_bus(C);
const bool is_mode_set = ob->mode == OB_MODE_PAINT_GREASE_PENCIL;
if (is_mode_set) {
if (!object::mode_compat_set(C, ob, OB_MODE_PAINT_GREASE_PENCIL, op->reports)) {
return OPERATOR_CANCELLED;
}
}
if (is_mode_set) {
grease_pencil_draw_mode_exit(C);
}
else {
grease_pencil_draw_mode_enter(C);
}
WM_toolsystem_update_from_context_view3d(C);
/* Necessary to change the object mode on the evaluated object. */
DEG_id_tag_update(&ob->id, ID_RECALC_SYNC_TO_EVAL);
WM_msg_publish_rna_prop(mbus, &ob->id, ob, Object, mode);
WM_event_add_notifier(C, NC_SCENE | ND_MODE, nullptr);
return OPERATOR_FINISHED;
}
static void GREASE_PENCIL_OT_draw_mode_toggle(wmOperatorType *ot)
{
ot->name = "Grease Pencil Draw Mode Toggle";
ot->idname = "GREASE_PENCIL_OT_draw_mode_toggle";
ot->description = "Enter/Exit draw mode for grease pencil";
ot->exec = grease_pencil_draw_mode_toggle_exec;
ot->poll = ed::greasepencil::active_grease_pencil_poll;
ot->flag = OPTYPE_UNDO | OPTYPE_REGISTER;
}
/** \} */
} // namespace blender::ed::sculpt_paint
/* -------------------------------------------------------------------- */
@ -421,7 +336,6 @@ void ED_operatortypes_grease_pencil_draw()
using namespace blender::ed::sculpt_paint;
WM_operatortype_append(GREASE_PENCIL_OT_brush_stroke);
WM_operatortype_append(GREASE_PENCIL_OT_sculpt_paint);
WM_operatortype_append(GREASE_PENCIL_OT_draw_mode_toggle);
}
/** \} */

View File

@ -26,7 +26,6 @@ typedef enum eObjectMode {
OB_MODE_WEIGHT_GPENCIL_LEGACY = 1 << 10,
OB_MODE_VERTEX_GPENCIL_LEGACY = 1 << 11,
OB_MODE_SCULPT_CURVES = 1 << 12,
OB_MODE_PAINT_GREASE_PENCIL = 1 << 13,
} eObjectMode;
/** #Object.dt, #View3DShading.type */
@ -60,5 +59,4 @@ typedef enum eDrawType {
#define OB_MODE_ALL_MODE_DATA \
(OB_MODE_EDIT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_SCULPT | OB_MODE_POSE | \
OB_MODE_PAINT_GPENCIL_LEGACY | OB_MODE_EDIT_GPENCIL_LEGACY | OB_MODE_SCULPT_GPENCIL_LEGACY | \
OB_MODE_WEIGHT_GPENCIL_LEGACY | OB_MODE_VERTEX_GPENCIL_LEGACY | OB_MODE_SCULPT_CURVES | \
OB_MODE_PAINT_GREASE_PENCIL)
OB_MODE_WEIGHT_GPENCIL_LEGACY | OB_MODE_VERTEX_GPENCIL_LEGACY | OB_MODE_SCULPT_CURVES)

View File

@ -89,11 +89,6 @@ const EnumPropertyItem rna_enum_object_mode_items[] = {
"Vertex Paint",
"Grease Pencil Vertex Paint Strokes"},
{OB_MODE_SCULPT_CURVES, "SCULPT_CURVES", ICON_SCULPTMODE_HLT, "Sculpt Mode", ""},
{OB_MODE_PAINT_GREASE_PENCIL,
"PAINT_GREASE_PENCIL",
ICON_GREASEPENCIL,
"Draw Mode",
"Paint Grease Pencil Strokes"},
{0, nullptr, 0, nullptr, nullptr},
};

View File

@ -345,12 +345,7 @@ static bool rna_Brush_mode_with_tool_poll(PointerRNA *ptr, PointerRNA value)
if (slot_index != brush->gpencil_tool) {
return false;
}
if (U.experimental.use_grease_pencil_version3) {
mode = OB_MODE_PAINT_GREASE_PENCIL;
}
else {
mode = OB_MODE_PAINT_GPENCIL_LEGACY;
}
mode = OB_MODE_PAINT_GPENCIL_LEGACY;
}
else if (paint_contains_brush_slot(&ts->gp_vertexpaint->paint, tslot, &slot_index)) {
if (slot_index != brush->gpencil_vertex_tool) {