Cleanup: formatting

This commit is contained in:
Falk David
2023-05-30 11:18:35 +02:00
parent 3aaacd6e30
commit d21f4efc8e
7 changed files with 29 additions and 23 deletions

View File

@@ -3838,25 +3838,25 @@ def km_grease_pencil_stroke_paint_draw_brush(params):
# Draw
if params.experimental and params.experimental.use_grease_pencil_version3:
items.extend([
("grease_pencil.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("mode", 'NORMAL')]}),
("grease_pencil.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'INVERT')]}),
("grease_pencil.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'SMOOTH')]}),
("grease_pencil.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("mode", 'NORMAL')]}),
("grease_pencil.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'INVERT')]}),
("grease_pencil.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'SMOOTH')]}),
])
else:
items.extend([
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
# Draw - straight lines
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'DRAW_STRAIGHT'), ("wait_for_input", False)]}),
# Erase
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'ERASER'), ("wait_for_input", False)]}),
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS'},
{"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'DRAW'), ("wait_for_input", False)]}),
# Draw - straight lines
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True},
{"properties": [("mode", 'DRAW_STRAIGHT'), ("wait_for_input", False)]}),
# Erase
("gpencil.draw", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
{"properties": [("mode", 'ERASER'), ("wait_for_input", False)]}),
])
items.extend([

View File

@@ -501,7 +501,7 @@ class GreasePencilMaterialsPanel:
is_view3d = (self.bl_space_type == 'VIEW_3D')
is_grease_pencil_version3 = context.preferences.experimental.use_grease_pencil_version3
tool_settings = context.scene.tool_settings
gpencil_paint = tool_settings.gpencil_paint
brush = gpencil_paint.brush if gpencil_paint else None

View File

@@ -1191,7 +1191,9 @@ void GreasePencil::free_drawing_array()
/** \name Layer tree read/write functions
* \{ */
static void read_layer(BlendDataReader *reader, GreasePencilLayer *node, GreasePencilLayerTreeGroup *parent)
static void read_layer(BlendDataReader *reader,
GreasePencilLayer *node,
GreasePencilLayerTreeGroup *parent)
{
BLO_read_data_address(reader, &node->base.name);
node->base.parent = parent;
@@ -1214,7 +1216,9 @@ static void read_layer(BlendDataReader *reader, GreasePencilLayer *node, GreaseP
}
}
static void read_layer_tree_group(BlendDataReader *reader, GreasePencilLayerTreeGroup *node, GreasePencilLayerTreeGroup *parent)
static void read_layer_tree_group(BlendDataReader *reader,
GreasePencilLayerTreeGroup *node,
GreasePencilLayerTreeGroup *parent)
{
BLO_read_data_address(reader, &node->base.name);
node->base.parent = parent;

View File

@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0-or-later
/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2023 Blender Foundation. */
#ifndef GPU_SHADER

View File

@@ -1889,7 +1889,8 @@ bool DRW_render_check_grease_pencil(Depsgraph *depsgraph)
deg_iter_settings.flags = DEG_OBJECT_ITER_FOR_RENDER_ENGINE_FLAGS;
DEG_OBJECT_ITER_BEGIN (&deg_iter_settings, ob) {
if (ob->type == OB_GPENCIL_LEGACY ||
(U.experimental.use_grease_pencil_version3 && ob->type == OB_GREASE_PENCIL)) {
(U.experimental.use_grease_pencil_version3 && ob->type == OB_GREASE_PENCIL))
{
if (DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF) {
return true;
}

View File

@@ -3104,7 +3104,8 @@ static int object_convert_exec(bContext *C, wmOperator *op)
ob_gpencil->actcol = actcol;
}
else if (U.experimental.use_grease_pencil_version3 && ob->type == OB_GPENCIL_LEGACY &&
target == OB_GREASE_PENCIL) {
target == OB_GREASE_PENCIL)
{
ob->flag |= OB_DONE;
bGPdata *gpd = static_cast<bGPdata *>(ob->data);

View File

@@ -191,7 +191,7 @@ static void grease_pencil_draw_mode_enter(bContext *C)
/* TODO: Setup cursor color. BKE_paint_init() could be used, but creates an additional brush. */
/* TODO: Call ED_paint_cursor_start(...) */
paint_init_pivot(ob, scene);
/* Necessary to change the object mode on the evaluated object. */