From 780f0f646da1aac01dc3164fd7d493426aca9e19 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Fri, 14 Dec 2018 16:45:57 +0100 Subject: GP: Rename CTX and OB modes Part of T59335. --- .../modules/bl_keymap_utils/keymap_from_toolbar.py | 2 +- .../bl_ui/properties_grease_pencil_common.py | 4 +-- .../startup/bl_ui/space_toolsystem_toolbar.py | 8 ++--- release/scripts/startup/bl_ui/space_topbar.py | 14 ++++----- release/scripts/startup/bl_ui/space_view3d.py | 34 +++++++++++----------- .../scripts/startup/bl_ui/space_view3d_toolbar.py | 2 +- source/blender/blenkernel/BKE_context.h | 10 +++---- source/blender/blenkernel/intern/brush.c | 2 +- source/blender/blenkernel/intern/context.c | 8 ++--- source/blender/blenkernel/intern/paint.c | 6 ++-- .../blenloader/intern/versioning_defaults.c | 4 +-- .../draw/engines/gpencil/gpencil_draw_utils.c | 2 +- source/blender/draw/intern/draw_manager.c | 8 ++--- source/blender/draw/intern/draw_view.c | 2 +- source/blender/editors/gpencil/gpencil_brush.c | 2 +- source/blender/editors/gpencil/gpencil_data.c | 6 ++-- source/blender/editors/gpencil/gpencil_edit.c | 10 +++---- source/blender/editors/gpencil/gpencil_paint.c | 4 +-- source/blender/editors/gpencil/gpencil_utils.c | 18 ++++++------ source/blender/editors/interface/interface_icons.c | 2 +- source/blender/editors/object/object_edit.c | 6 ++-- source/blender/editors/object/object_modes.c | 12 ++++---- source/blender/editors/sculpt_paint/paint_ops.c | 2 +- .../blender/editors/space_buttons/space_buttons.c | 14 ++++----- .../blender/editors/space_view3d/view3d_select.c | 6 ++-- source/blender/editors/undo/ed_undo.c | 2 +- source/blender/makesdna/DNA_object_enums.h | 10 +++---- source/blender/makesrna/intern/rna_brush.c | 4 +-- source/blender/makesrna/intern/rna_context.c | 8 ++--- source/blender/makesrna/intern/rna_object.c | 16 +++++----- source/blender/makesrna/intern/rna_sculpt_paint.c | 2 +- .../blender/windowmanager/intern/wm_keymap_utils.c | 8 ++--- .../blender/windowmanager/intern/wm_toolsystem.c | 18 ++++++------ 33 files changed, 128 insertions(+), 128 deletions(-) diff --git a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py index ddba25609ea..ba768426017 100644 --- a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py +++ b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py @@ -196,7 +196,7 @@ def generate(context, space_type): 'VERTEX_PAINT': "vertex_tool", 'WEIGHT_PAINT': "weight_tool", 'TEXTURE_PAINT': "image_tool", - 'GPENCIL_PAINT': "gpencil_tool", + 'PAINT_GPENCIL': "gpencil_tool", }.get(mode, None) if attr is not None: setattr(kmi_hack_brush_select_properties, attr, item.data_block) diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index fff4a063ef8..09e81115d6a 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -326,7 +326,7 @@ class GreasePencilAppearancePanel: ob = context.active_object - if ob.mode == 'GPENCIL_PAINT': + if ob.mode == 'PAINT_GPENCIL': brush = context.active_gpencil_brush gp_settings = brush.gpencil_settings @@ -347,7 +347,7 @@ class GreasePencilAppearancePanel: if brush.gpencil_tool == 'FILL': layout.prop(brush, "cursor_color_add", text="Color") - elif ob.mode in {'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}: + elif ob.mode in {'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}: settings = context.tool_settings.gpencil_sculpt brush = settings.brush tool = settings.sculpt_tool diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 3699c021b7d..4da5455298f 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1574,7 +1574,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): None, _defs_weight_paint.gradient, ], - 'GPENCIL_PAINT': [ + 'PAINT_GPENCIL': [ _defs_view3d_generic.cursor, None, _defs_gpencil_paint.generate_from_brushes, @@ -1584,7 +1584,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): _defs_gpencil_paint.circle, _defs_gpencil_paint.arc, ], - 'GPENCIL_EDIT': [ + 'EDIT_GPENCIL': [ *_tools_gpencil_select, _defs_view3d_generic.cursor, None, @@ -1594,12 +1594,12 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): _defs_gpencil_edit.shear, _defs_gpencil_edit.tosphere, ], - 'GPENCIL_SCULPT': [ + 'SCULPT_GPENCIL': [ *_tools_gpencil_select, None, _defs_gpencil_sculpt.generate_from_brushes, ], - 'GPENCIL_WEIGHT': [ + 'WEIGHT_GPENCIL': [ _defs_gpencil_weight.generate_from_brushes, ], } diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 01c9b355be8..f73d21dcfb8 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -145,12 +145,12 @@ class TOPBAR_HT_lower_bar(Header): # if tool.has_datablock: # layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="") pass - elif tool_mode == 'GPENCIL_PAINT': + elif tool_mode == 'PAINT_GPENCIL': if (tool is not None) and tool.has_datablock: layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".greasepencil_paint", category="") - elif tool_mode == 'GPENCIL_SCULPT': + elif tool_mode == 'SCULPT_GPENCIL': layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".greasepencil_sculpt", category="") - elif tool_mode == 'GPENCIL_WEIGHT': + elif tool_mode == 'WEIGHT_GPENCIL': layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".greasepencil_weight", category="") elif tool_space_type == 'IMAGE_EDITOR': if tool_mode == 'PAINT': @@ -199,7 +199,7 @@ class TOPBAR_HT_lower_bar(Header): layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".particlemode", category="") elif tool_mode == 'OBJECT': layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".objectmode", category="") - elif tool_mode in {'GPENCIL_PAINT', 'GPENCIL_EDIT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}: + elif tool_mode in {'PAINT_GPENCIL', 'EDIT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}: # Grease pencil layer. gpl = context.active_gpencil_layer if gpl and gpl.info is not None: @@ -296,7 +296,7 @@ class _draw_left_context_mode: UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength") @staticmethod - def GPENCIL_PAINT(context, layout, tool): + def PAINT_GPENCIL(context, layout, tool): if tool is None: return @@ -376,7 +376,7 @@ class _draw_left_context_mode: draw_color_selector() @staticmethod - def GPENCIL_SCULPT(context, layout, tool): + def SCULPT_GPENCIL(context, layout, tool): if (tool is None) or (not tool.has_datablock): return tool_settings = context.tool_settings @@ -399,7 +399,7 @@ class _draw_left_context_mode: row.prop(brush, "direction", expand=True, text="") @staticmethod - def GPENCIL_WEIGHT(context, layout, tool): + def WEIGHT_GPENCIL(context, layout, tool): if (tool is None) or (not tool.has_datablock): return tool_settings = context.tool_settings diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index ef2569672bf..b3c52adff2b 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -120,7 +120,7 @@ class VIEW3D_HT_header(Header): scene = context.scene # Orientation - if object_mode in {'OBJECT', 'EDIT', 'POSE', 'GPENCIL_EDIT'}: + if object_mode in {'OBJECT', 'EDIT', 'POSE', 'EDIT_GPENCIL'}: orientation = scene.transform_orientation current_orientation = scene.current_orientation @@ -148,7 +148,7 @@ class VIEW3D_HT_header(Header): show_snap = True else: if object_mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT', - 'GPENCIL_PAINT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}: + 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}: show_snap = True else: @@ -217,7 +217,7 @@ class VIEW3D_HT_header(Header): sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True) # Pivot - if object_mode in {'OBJECT', 'EDIT', 'POSE', 'GPENCIL_EDIT', 'GPENCIL_SCULPT'}: + if object_mode in {'OBJECT', 'EDIT', 'POSE', 'EDIT_GPENCIL', 'SCULPT_GPENCIL'}: pivot_point = tool_settings.transform_pivot_point act_pivot_point = bpy.types.ToolSettings.bl_rna.properties["transform_pivot_point"].enum_items[pivot_point] row = layout.row(align=True) @@ -227,7 +227,7 @@ class VIEW3D_HT_header(Header): text="", ) # grease pencil - if object_mode == 'GPENCIL_PAINT': + if object_mode == 'PAINT_GPENCIL': origin = tool_settings.gpencil_stroke_placement_view3d gp_origin = tool_settings.bl_rna.properties['gpencil_stroke_placement_view3d'].enum_items[origin] @@ -239,7 +239,7 @@ class VIEW3D_HT_header(Header): icon=or_icon, ) - if object_mode in {'GPENCIL_PAINT', 'GPENCIL_SCULPT'}: + if object_mode in {'PAINT_GPENCIL', 'SCULPT_GPENCIL'}: lock = tool_settings.gpencil_sculpt.lock_axis gp_lock = tool_settings.gpencil_sculpt.bl_rna.properties["lock_axis"].enum_items[lock] @@ -302,13 +302,13 @@ 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 {'GPENCIL_EDIT', 'GPENCIL_PAINT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'} + gp_edit = obj and obj.mode in {'EDIT_GPENCIL', 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'} layout.menu("VIEW3D_MT_view") # Select Menu if gp_edit: - if mode_string not in {'GPENCIL_PAINT', 'GPENCIL_WEIGHT'}: + if mode_string not in {'PAINT_GPENCIL', 'WEIGHT_GPENCIL'}: layout.menu("VIEW3D_MT_select_gpencil") elif mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}: mesh = obj.data @@ -335,11 +335,11 @@ class VIEW3D_MT_editor_menus(Menu): layout.menu("TOPBAR_MT_edit_armature_add", text="Add") if gp_edit: - if obj and obj.mode == 'GPENCIL_PAINT': + if obj and obj.mode == 'PAINT_GPENCIL': layout.menu("VIEW3D_MT_paint_gpencil") - elif obj and obj.mode == 'GPENCIL_EDIT': + elif obj and obj.mode == 'EDIT_GPENCIL': layout.menu("VIEW3D_MT_edit_gpencil") - elif obj and obj.mode == 'GPENCIL_WEIGHT': + elif obj and obj.mode == 'WEIGHT_GPENCIL': layout.menu("VIEW3D_MT_weight_gpencil") elif edit_object: @@ -5147,10 +5147,10 @@ class VIEW3D_PT_overlay_gpencil_options(Panel): def draw_header(self, context): layout = self.layout layout.label(text={ - 'GPENCIL_PAINT': "Draw Grease Pencil", - 'GPENCIL_EDIT': "Edit Grease Pencil", - 'GPENCIL_SCULPT': "Sculpt Grease Pencil", - 'GPENCIL_WEIGHT': "Weight Grease Pencil", + 'PAINT_GPENCIL': "Draw Grease Pencil", + 'EDIT_GPENCIL': "Edit Grease Pencil", + 'SCULPT_GPENCIL': "Sculpt Grease Pencil", + 'WEIGHT_GPENCIL': "Weight Grease Pencil", 'OBJECT': "Grease Pencil", }[context.mode]) @@ -5174,14 +5174,14 @@ class VIEW3D_PT_overlay_gpencil_options(Panel): sub.active = overlay.use_gpencil_paper sub.prop(overlay, "gpencil_paper_opacity", text="Fade 3D Objects", slider=True) - if context.object.mode == 'GPENCIL_PAINT': + if context.object.mode == 'PAINT_GPENCIL': row = col.row() row.prop(overlay, "use_gpencil_fade_layers", text="") sub = row.row() sub.active = overlay.use_gpencil_fade_layers sub.prop(overlay, "gpencil_fade_layer", text="Fade Layers", slider=True) - if context.object.mode in {'GPENCIL_EDIT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}: + if context.object.mode in {'EDIT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}: layout.prop(overlay, "use_gpencil_edit_lines", text="Edit Lines") layout.prop(overlay, "use_gpencil_multiedit_line_only", text="Show Edit Lines only in multiframe") layout.prop(overlay, "vertex_opacity", text="Vertex Opacity", slider=True) @@ -5404,7 +5404,7 @@ class VIEW3D_MT_gpencil_sculpt_specials(Menu): layout.operator("gpencil.stroke_simplify_fixed", text="Simplify") layout.operator("gpencil.stroke_simplify", text="Simplify Adaptative") - if context.mode == 'GPENCIL_WEIGHT': + if context.mode == 'WEIGHT_GPENCIL': layout.separator() layout.menu("VIEW3D_MT_gpencil_autoweights") diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 3f6518e80a6..68d334dfaea 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -76,7 +76,7 @@ def draw_vpaint_symmetry(layout, vpaint): def is_not_gpencil_edit_mode(context): is_gpmode = ( context.active_object and - context.active_object.mode in {'GPENCIL_EDIT', 'GPENCIL_PAINT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'} + context.active_object.mode in {'EDIT_GPENCIL', 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'} ) return not is_gpmode diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index 798150aee3c..246ba5ba5f0 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -118,12 +118,12 @@ enum eContextObjectMode { CTX_MODE_PAINT_TEXTURE, CTX_MODE_PARTICLE, CTX_MODE_OBJECT, - CTX_MODE_GPENCIL_PAINT, - CTX_MODE_GPENCIL_EDIT, - CTX_MODE_GPENCIL_SCULPT, - CTX_MODE_GPENCIL_WEIGHT, + CTX_MODE_PAINT_GPENCIL, + CTX_MODE_EDIT_GPENCIL, + CTX_MODE_SCULPT_GPENCIL, + CTX_MODE_WEIGHT_GPENCIL, }; -#define CTX_MODE_NUM (CTX_MODE_GPENCIL_WEIGHT + 1) +#define CTX_MODE_NUM (CTX_MODE_WEIGHT_GPENCIL + 1) /* Context */ diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index c2e5659a64f..b000b3709f2 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -194,7 +194,7 @@ Brush *BKE_brush_add_gpencil(Main *bmain, ToolSettings *ts, const char *name) { Brush *brush; Paint *paint = &ts->gp_paint->paint; - brush = BKE_brush_add(bmain, name, OB_MODE_GPENCIL_PAINT); + brush = BKE_brush_add(bmain, name, OB_MODE_PAINT_GPENCIL); BKE_paint_brush_set(paint, brush); id_us_min(&brush->id); diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 96dd90cdf35..a907babd661 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -1007,10 +1007,10 @@ int CTX_data_mode_enum_ex(const Object *obedit, const Object *ob, const eObjectM else if (object_mode & OB_MODE_VERTEX_PAINT) return CTX_MODE_PAINT_VERTEX; else if (object_mode & OB_MODE_TEXTURE_PAINT) return CTX_MODE_PAINT_TEXTURE; else if (object_mode & OB_MODE_PARTICLE_EDIT) return CTX_MODE_PARTICLE; - else if (object_mode & OB_MODE_GPENCIL_PAINT) return CTX_MODE_GPENCIL_PAINT; - else if (object_mode & OB_MODE_GPENCIL_EDIT) return CTX_MODE_GPENCIL_EDIT; - else if (object_mode & OB_MODE_GPENCIL_SCULPT) return CTX_MODE_GPENCIL_SCULPT; - else if (object_mode & OB_MODE_GPENCIL_WEIGHT) return CTX_MODE_GPENCIL_WEIGHT; + else if (object_mode & OB_MODE_PAINT_GPENCIL) return CTX_MODE_PAINT_GPENCIL; + else if (object_mode & OB_MODE_EDIT_GPENCIL) return CTX_MODE_EDIT_GPENCIL; + else if (object_mode & OB_MODE_SCULPT_GPENCIL) return CTX_MODE_SCULPT_GPENCIL; + else if (object_mode & OB_MODE_WEIGHT_GPENCIL) return CTX_MODE_WEIGHT_GPENCIL; } } diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 08c6413efa2..c5bfa41fa0b 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -226,7 +226,7 @@ Paint *BKE_paint_get_active(Scene *sce, ViewLayer *view_layer) return &ts->wpaint->paint; case OB_MODE_TEXTURE_PAINT: return &ts->imapaint.paint; - case OB_MODE_GPENCIL_PAINT: + case OB_MODE_PAINT_GPENCIL: return &ts->gp_paint->paint; case OB_MODE_EDIT: if (ts->use_uv_sculpt) @@ -337,7 +337,7 @@ ePaintMode BKE_paintmode_get_from_tool(const struct bToolRef *tref) return PAINT_MODE_VERTEX; case CTX_MODE_PAINT_WEIGHT: return PAINT_MODE_WEIGHT; - case CTX_MODE_GPENCIL_PAINT: + case CTX_MODE_PAINT_GPENCIL: return PAINT_MODE_GPENCIL; case CTX_MODE_PAINT_TEXTURE: return PAINT_MODE_TEXTURE_3D; @@ -389,7 +389,7 @@ void BKE_paint_runtime_init(const ToolSettings *ts, Paint *paint) } else if (paint == &ts->gp_paint->paint) { paint->runtime.tool_offset = offsetof(Brush, gpencil_tool); - paint->runtime.ob_mode = OB_MODE_GPENCIL_PAINT; + paint->runtime.ob_mode = OB_MODE_PAINT_GPENCIL; } else if (paint == &ts->uvsculpt->paint) { /* We don't use these yet. */ diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 171e40deb24..4dd046d9a73 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -174,14 +174,14 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) const char *name = workspace->id.name + 2; if (STREQ(name, "Drawing")) { - workspace->object_mode = OB_MODE_GPENCIL_PAINT; + workspace->object_mode = OB_MODE_PAINT_GPENCIL; } } /* set object in drawing mode */ for (Object *object = bmain->object.first; object; object = object->id.next) { if (object->type == OB_GPENCIL) { bGPdata *gpd = (bGPdata *)object->data; - object->mode = OB_MODE_GPENCIL_PAINT; + object->mode = OB_MODE_PAINT_GPENCIL; gpd->flag |= GP_DATA_STROKE_PAINTMODE; break; } diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 2450f9419bf..87772a72015 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -1577,7 +1577,7 @@ void DRW_gpencil_populate_datablock( opacity = opacity * v3d->overlay.xray_alpha_bone; } /* fade no active layers */ - if ((overlay) && (draw_ctx->object_mode == OB_MODE_GPENCIL_PAINT) && + if ((overlay) && (draw_ctx->object_mode == OB_MODE_PAINT_GPENCIL) && (v3d->gp_flag & V3D_GP_FADE_NOACTIVE_LAYERS) && (draw_ctx->obact) && (draw_ctx->obact == ob) && (gpl != gpl_active)) diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 494cae467b4..38938ea107c 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1255,10 +1255,10 @@ static void drw_engines_enable_from_mode(int mode) case CTX_MODE_PAINT_VERTEX: case CTX_MODE_PAINT_TEXTURE: case CTX_MODE_OBJECT: - case CTX_MODE_GPENCIL_PAINT: - case CTX_MODE_GPENCIL_EDIT: - case CTX_MODE_GPENCIL_SCULPT: - case CTX_MODE_GPENCIL_WEIGHT: + case CTX_MODE_PAINT_GPENCIL: + case CTX_MODE_EDIT_GPENCIL: + case CTX_MODE_SCULPT_GPENCIL: + case CTX_MODE_WEIGHT_GPENCIL: break; default: BLI_assert(!"Draw mode invalid"); diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index 4a890c3be84..4c53049e772 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -154,7 +154,7 @@ static bool is_cursor_visible(const DRWContextState *draw_ctx, Scene *scene, Vie /* no exception met? then don't draw cursor! */ return false; } - else if (draw_ctx->object_mode & OB_MODE_GPENCIL_WEIGHT) { + else if (draw_ctx->object_mode & OB_MODE_WEIGHT_GPENCIL) { /* grease pencil hide always in some modes */ return false; } diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 9feea61c672..5ec55d1e98e 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -1192,7 +1192,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op) ToolSettings *ts = CTX_data_tool_settings(C); Object *ob = CTX_data_active_object(C); - const bool is_weight_mode = ob->mode == OB_MODE_GPENCIL_WEIGHT; + const bool is_weight_mode = ob->mode == OB_MODE_WEIGHT_GPENCIL; /* set the brush using the tool */ #if 0 GP_Sculpt_Settings *gset = &ts->gp_sculpt; diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index a2cb9612e43..51046726e19 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -1555,8 +1555,8 @@ static bool gpencil_vertex_group_poll(bContext *C) if ((ob) && (ob->type == OB_GPENCIL)) { if (!ID_IS_LINKED(ob) && !ID_IS_LINKED(ob->data) && ob->defbase.first) { if (ELEM(ob->mode, - OB_MODE_GPENCIL_EDIT, - OB_MODE_GPENCIL_SCULPT)) + OB_MODE_EDIT_GPENCIL, + OB_MODE_SCULPT_GPENCIL)) { return true; } @@ -1572,7 +1572,7 @@ static bool gpencil_vertex_group_weight_poll(bContext *C) if ((ob) && (ob->type == OB_GPENCIL)) { if (!ID_IS_LINKED(ob) && !ID_IS_LINKED(ob->data) && ob->defbase.first) { - if (ob->mode == OB_MODE_GPENCIL_WEIGHT) { + if (ob->mode == OB_MODE_WEIGHT_GPENCIL) { return true; } } diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 072f4d0e317..916a268dc57 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -172,7 +172,7 @@ static int gpencil_editmode_toggle_exec(bContext *C, wmOperator *op) } /* set mode */ if (gpd->flag & GP_DATA_STROKE_EDITMODE) { - mode = OB_MODE_GPENCIL_EDIT; + mode = OB_MODE_EDIT_GPENCIL; } else { mode = OB_MODE_OBJECT; @@ -301,7 +301,7 @@ static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op) gpd->flag ^= GP_DATA_STROKE_PAINTMODE; /* set mode */ if (gpd->flag & GP_DATA_STROKE_PAINTMODE) { - mode = OB_MODE_GPENCIL_PAINT; + mode = OB_MODE_PAINT_GPENCIL; } else { mode = OB_MODE_OBJECT; @@ -316,7 +316,7 @@ static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op) ob->mode = mode; } - if (mode == OB_MODE_GPENCIL_PAINT) { + if (mode == OB_MODE_PAINT_GPENCIL) { /* be sure we have brushes */ BKE_paint_ensure(ts, (Paint **)&ts->gp_paint); Paint *paint = &ts->gp_paint->paint; @@ -400,7 +400,7 @@ static int gpencil_sculptmode_toggle_exec(bContext *C, wmOperator *op) gpd->flag ^= GP_DATA_STROKE_SCULPTMODE; /* set mode */ if (gpd->flag & GP_DATA_STROKE_SCULPTMODE) { - mode = OB_MODE_GPENCIL_SCULPT; + mode = OB_MODE_SCULPT_GPENCIL; } else { mode = OB_MODE_OBJECT; @@ -488,7 +488,7 @@ static int gpencil_weightmode_toggle_exec(bContext *C, wmOperator *op) gpd->flag ^= GP_DATA_STROKE_WEIGHTMODE; /* set mode */ if (gpd->flag & GP_DATA_STROKE_WEIGHTMODE) { - mode = OB_MODE_GPENCIL_WEIGHT; + mode = OB_MODE_WEIGHT_GPENCIL; } else { mode = OB_MODE_OBJECT; diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index b97e335d081..68d0f6506d0 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1650,7 +1650,7 @@ static Brush *gp_get_default_eraser(Main *bmain, ToolSettings *ts) Paint *paint = &ts->gp_paint->paint; Brush *brush_old = paint->brush; for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { - if ((brush->ob_mode == OB_MODE_GPENCIL_PAINT) && + if ((brush->ob_mode == OB_MODE_PAINT_GPENCIL) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) { /* save first eraser to use later if no default */ @@ -2794,7 +2794,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event p->gpd->flag &= ~GP_DATA_STROKE_WEIGHTMODE; /* set workspace mode */ ob->restore_mode = ob->mode; - ob->mode = OB_MODE_GPENCIL_PAINT; + ob->mode = OB_MODE_PAINT_GPENCIL; /* redraw mode on screen */ WM_event_add_notifier(C, NC_SCENE | ND_MODE, NULL); } diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 40c2567f1c0..2ccaea84e6b 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1449,7 +1449,7 @@ static bool gp_check_cursor_region(bContext *C, int mval_i[2]) Object *ob = CTX_data_active_object(C); if ((ob == NULL) || - (!ELEM(ob->mode, OB_MODE_GPENCIL_PAINT, OB_MODE_GPENCIL_SCULPT, OB_MODE_GPENCIL_WEIGHT))) + (!ELEM(ob->mode, OB_MODE_PAINT_GPENCIL, OB_MODE_SCULPT_GPENCIL, OB_MODE_WEIGHT_GPENCIL))) { return false; } @@ -1705,13 +1705,13 @@ static void gpencil_verify_brush_type(bContext *C, int newmode) GP_Sculpt_Settings *gset = &ts->gp_sculpt; switch (newmode) { - case OB_MODE_GPENCIL_SCULPT: + case OB_MODE_SCULPT_GPENCIL: gset->flag &= ~GP_SCULPT_SETT_FLAG_WEIGHT_MODE; if ((gset->brushtype < 0) || (gset->brushtype >= GP_SCULPT_TYPE_WEIGHT)) { gset->brushtype = GP_SCULPT_TYPE_PUSH; } break; - case OB_MODE_GPENCIL_WEIGHT: + case OB_MODE_WEIGHT_GPENCIL: gset->flag |= GP_SCULPT_SETT_FLAG_WEIGHT_MODE; if ((gset->weighttype < GP_SCULPT_TYPE_WEIGHT) || (gset->weighttype >= GP_SCULPT_TYPE_MAX)) { gset->weighttype = GP_SCULPT_TYPE_WEIGHT; @@ -1730,34 +1730,34 @@ void ED_gpencil_setup_modes(bContext *C, bGPdata *gpd, int newmode) } switch (newmode) { - case OB_MODE_GPENCIL_EDIT: + case OB_MODE_EDIT_GPENCIL: gpd->flag |= GP_DATA_STROKE_EDITMODE; gpd->flag &= ~GP_DATA_STROKE_PAINTMODE; gpd->flag &= ~GP_DATA_STROKE_SCULPTMODE; gpd->flag &= ~GP_DATA_STROKE_WEIGHTMODE; ED_gpencil_toggle_brush_cursor(C, false, NULL); break; - case OB_MODE_GPENCIL_PAINT: + case OB_MODE_PAINT_GPENCIL: gpd->flag &= ~GP_DATA_STROKE_EDITMODE; gpd->flag |= GP_DATA_STROKE_PAINTMODE; gpd->flag &= ~GP_DATA_STROKE_SCULPTMODE; gpd->flag &= ~GP_DATA_STROKE_WEIGHTMODE; ED_gpencil_toggle_brush_cursor(C, true, NULL); break; - case OB_MODE_GPENCIL_SCULPT: + case OB_MODE_SCULPT_GPENCIL: gpd->flag &= ~GP_DATA_STROKE_EDITMODE; gpd->flag &= ~GP_DATA_STROKE_PAINTMODE; gpd->flag |= GP_DATA_STROKE_SCULPTMODE; gpd->flag &= ~GP_DATA_STROKE_WEIGHTMODE; - gpencil_verify_brush_type(C, OB_MODE_GPENCIL_SCULPT); + gpencil_verify_brush_type(C, OB_MODE_SCULPT_GPENCIL); ED_gpencil_toggle_brush_cursor(C, true, NULL); break; - case OB_MODE_GPENCIL_WEIGHT: + case OB_MODE_WEIGHT_GPENCIL: gpd->flag &= ~GP_DATA_STROKE_EDITMODE; gpd->flag &= ~GP_DATA_STROKE_PAINTMODE; gpd->flag &= ~GP_DATA_STROKE_SCULPTMODE; gpd->flag |= GP_DATA_STROKE_WEIGHTMODE; - gpencil_verify_brush_type(C, OB_MODE_GPENCIL_WEIGHT); + gpencil_verify_brush_type(C, OB_MODE_WEIGHT_GPENCIL); ED_gpencil_toggle_brush_cursor(C, true, NULL); break; default: diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 36624f475ce..f371bae77c0 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1719,7 +1719,7 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id) /* reset the icon */ if ((ob != NULL) && - (ob->mode & OB_MODE_GPENCIL_PAINT) && + (ob->mode & OB_MODE_PAINT_GPENCIL) && (br->gpencil_settings != NULL)) { switch (br->gpencil_settings->icon_id) { diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 676d44e3ea4..59ce42c50a5 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1615,8 +1615,8 @@ static const EnumPropertyItem *object_mode_set_itemsf( (input->value == OB_MODE_PARTICLE_EDIT && use_mode_particle_edit) || (ELEM(input->value, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, OB_MODE_TEXTURE_PAINT) && (ob->type == OB_MESH)) || - (ELEM(input->value, OB_MODE_GPENCIL_EDIT, OB_MODE_GPENCIL_PAINT, - OB_MODE_GPENCIL_SCULPT, OB_MODE_GPENCIL_WEIGHT) && (ob->type == OB_GPENCIL)) || + (ELEM(input->value, OB_MODE_EDIT_GPENCIL, OB_MODE_PAINT_GPENCIL, + OB_MODE_SCULPT_GPENCIL, OB_MODE_WEIGHT_GPENCIL) && (ob->type == OB_GPENCIL)) || (input->value == OB_MODE_OBJECT)) { RNA_enum_item_add(&item, &totitem, input); @@ -1674,7 +1674,7 @@ static int object_mode_set_exec(bContext *C, wmOperator *op) /* by default the operator assume is a mesh, but if gp object change mode */ if ((ob != NULL) && (ob->type == OB_GPENCIL) && (mode == OB_MODE_EDIT)) { - mode = OB_MODE_GPENCIL_EDIT; + mode = OB_MODE_EDIT_GPENCIL; } if (!ob || !ED_object_mode_compat_test(ob, mode)) diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c index 4c625a4d33c..771bbc5c18c 100644 --- a/source/blender/editors/object/object_modes.c +++ b/source/blender/editors/object/object_modes.c @@ -74,13 +74,13 @@ static const char *object_mode_op_string(eObjectMode mode) return "PARTICLE_OT_particle_edit_toggle"; if (mode == OB_MODE_POSE) return "OBJECT_OT_posemode_toggle"; - if (mode == OB_MODE_GPENCIL_EDIT) + if (mode == OB_MODE_EDIT_GPENCIL) return "GPENCIL_OT_editmode_toggle"; - if (mode == OB_MODE_GPENCIL_PAINT) + if (mode == OB_MODE_PAINT_GPENCIL) return "GPENCIL_OT_paintmode_toggle"; - if (mode == OB_MODE_GPENCIL_SCULPT) + if (mode == OB_MODE_SCULPT_GPENCIL) return "GPENCIL_OT_sculptmode_toggle"; - if (mode == OB_MODE_GPENCIL_WEIGHT) + if (mode == OB_MODE_WEIGHT_GPENCIL) return "GPENCIL_OT_weightmode_toggle"; return NULL; } @@ -119,8 +119,8 @@ bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode) return true; break; case OB_GPENCIL: - if (mode & (OB_MODE_EDIT | OB_MODE_GPENCIL_EDIT | OB_MODE_GPENCIL_PAINT | - OB_MODE_GPENCIL_SCULPT | OB_MODE_GPENCIL_WEIGHT)) + if (mode & (OB_MODE_EDIT | OB_MODE_EDIT_GPENCIL | OB_MODE_PAINT_GPENCIL | + OB_MODE_SCULPT_GPENCIL | OB_MODE_WEIGHT_GPENCIL)) { return true; } diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 11565d665b1..ed40a22bd78 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -118,7 +118,7 @@ static int brush_add_gpencil_exec(bContext *C, wmOperator *UNUSED(op)) br = BKE_brush_copy(bmain, br); } else { - br = BKE_brush_add(bmain, "Brush", OB_MODE_GPENCIL_PAINT); + br = BKE_brush_add(bmain, "Brush", OB_MODE_PAINT_GPENCIL); id_us_min(&br->id); /* fake user only */ } diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 4520f837a0a..c9ba5722572 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -258,13 +258,13 @@ static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar) case CTX_MODE_OBJECT: ARRAY_SET_ITEMS(contexts, ".objectmode"); break; - case CTX_MODE_GPENCIL_PAINT: + case CTX_MODE_PAINT_GPENCIL: ARRAY_SET_ITEMS(contexts, ".greasepencil_paint"); break; - case CTX_MODE_GPENCIL_SCULPT: + case CTX_MODE_SCULPT_GPENCIL: ARRAY_SET_ITEMS(contexts, ".greasepencil_sculpt"); break; - case CTX_MODE_GPENCIL_WEIGHT: + case CTX_MODE_WEIGHT_GPENCIL: ARRAY_SET_ITEMS(contexts, ".greasepencil_weight"); break; } @@ -290,16 +290,16 @@ static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar) * workspace->tools_space_type because this value is not available */ switch (mode) { - case CTX_MODE_GPENCIL_PAINT: + case CTX_MODE_PAINT_GPENCIL: ARRAY_SET_ITEMS(contexts, ".greasepencil_paint"); break; - case CTX_MODE_GPENCIL_SCULPT: + case CTX_MODE_SCULPT_GPENCIL: ARRAY_SET_ITEMS(contexts, ".greasepencil_sculpt"); break; - case CTX_MODE_GPENCIL_WEIGHT: + case CTX_MODE_WEIGHT_GPENCIL: ARRAY_SET_ITEMS(contexts, ".greasepencil_weight"); break; - case CTX_MODE_GPENCIL_EDIT: + case CTX_MODE_EDIT_GPENCIL: ARRAY_SET_ITEMS(contexts, ".greasepencil_edit"); break; } diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 08d8d168e81..c976803065e 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1849,9 +1849,9 @@ static bool ed_object_select_pick( { /* set cursor */ if (ELEM(basact->object->mode, - OB_MODE_GPENCIL_PAINT, - OB_MODE_GPENCIL_SCULPT, - OB_MODE_GPENCIL_WEIGHT)) + OB_MODE_PAINT_GPENCIL, + OB_MODE_SCULPT_GPENCIL, + OB_MODE_WEIGHT_GPENCIL)) { ED_gpencil_toggle_brush_cursor(C, true, NULL); } diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c index 8b4292dedbd..dd459749029 100644 --- a/source/blender/editors/undo/ed_undo.c +++ b/source/blender/editors/undo/ed_undo.c @@ -181,7 +181,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname, ReportList Object *obact = CTX_data_active_object(C); if (obact && (obact->type == OB_GPENCIL)) { /* set cursor */ - if (ELEM(obact->mode, OB_MODE_GPENCIL_PAINT, OB_MODE_GPENCIL_SCULPT, OB_MODE_GPENCIL_WEIGHT)) { + if (ELEM(obact->mode, OB_MODE_PAINT_GPENCIL, OB_MODE_SCULPT_GPENCIL, OB_MODE_WEIGHT_GPENCIL)) { ED_gpencil_toggle_brush_cursor(C, true, NULL); } else { diff --git a/source/blender/makesdna/DNA_object_enums.h b/source/blender/makesdna/DNA_object_enums.h index 8a7016ccd13..13e68698d1a 100644 --- a/source/blender/makesdna/DNA_object_enums.h +++ b/source/blender/makesdna/DNA_object_enums.h @@ -37,16 +37,16 @@ typedef enum eObjectMode { OB_MODE_TEXTURE_PAINT = 1 << 4, OB_MODE_PARTICLE_EDIT = 1 << 5, OB_MODE_POSE = 1 << 6, - OB_MODE_GPENCIL_EDIT = 1 << 7, - OB_MODE_GPENCIL_PAINT = 1 << 8, - OB_MODE_GPENCIL_SCULPT = 1 << 9, - OB_MODE_GPENCIL_WEIGHT = 1 << 10, + OB_MODE_EDIT_GPENCIL = 1 << 7, + OB_MODE_PAINT_GPENCIL = 1 << 8, + OB_MODE_SCULPT_GPENCIL = 1 << 9, + OB_MODE_WEIGHT_GPENCIL = 1 << 10, } eObjectMode; /* Any mode where the brush system is used. */ #define OB_MODE_ALL_PAINT (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT) -#define OB_MODE_ALL_PAINT_GPENCIL (OB_MODE_GPENCIL_PAINT | OB_MODE_GPENCIL_SCULPT | OB_MODE_GPENCIL_WEIGHT) +#define OB_MODE_ALL_PAINT_GPENCIL (OB_MODE_PAINT_GPENCIL | OB_MODE_SCULPT_GPENCIL | OB_MODE_WEIGHT_GPENCIL) /* Any mode that uses Object.sculpt. */ #define OB_MODE_ALL_SCULPT (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT) diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index d9b9677bbc6..445ceb6ddb5 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -675,7 +675,7 @@ static void rna_BrushGpencilSettings_default_eraser_update(Main *bmain, Scene *s /* disable default eraser in all brushes */ for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { if ((brush != brush_cur) && - (brush->ob_mode == OB_MODE_GPENCIL_PAINT) && + (brush->ob_mode == OB_MODE_PAINT_GPENCIL) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) { brush->gpencil_settings->flag &= ~GP_BRUSH_DEFAULT_ERASER; @@ -1820,7 +1820,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode"); prop = RNA_def_property(srna, "use_paint_grease_pencil", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_GPENCIL_PAINT); + RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_PAINT_GPENCIL); RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in grease pencil drawing mode"); /* texture */ diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 618cefe13e5..240d21407d0 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -53,10 +53,10 @@ const EnumPropertyItem rna_enum_context_mode_items[] = { {CTX_MODE_PAINT_TEXTURE, "PAINT_TEXTURE", 0, "Texture Paint", ""}, {CTX_MODE_PARTICLE, "PARTICLE", 0, "Particle", ""}, {CTX_MODE_OBJECT, "OBJECT", 0, "Object", ""}, - {CTX_MODE_GPENCIL_PAINT, "GPENCIL_PAINT", 0, "Grease Pencil Paint", "" }, - {CTX_MODE_GPENCIL_EDIT, "GPENCIL_EDIT", 0, "Grease Pencil Edit", "" }, - {CTX_MODE_GPENCIL_SCULPT, "GPENCIL_SCULPT", 0, "Grease Pencil Sculpt", "" }, - {CTX_MODE_GPENCIL_WEIGHT, "GPENCIL_WEIGHT", 0, "Grease Pencil Weight Paint", "" }, + {CTX_MODE_PAINT_GPENCIL, "PAINT_GPENCIL", 0, "Grease Pencil Paint", "" }, + {CTX_MODE_EDIT_GPENCIL, "EDIT_GPENCIL", 0, "Grease Pencil Edit", "" }, + {CTX_MODE_SCULPT_GPENCIL, "SCULPT_GPENCIL", 0, "Grease Pencil Sculpt", "" }, + {CTX_MODE_WEIGHT_GPENCIL, "WEIGHT_GPENCIL", 0, "Grease Pencil Weight Paint", "" }, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 19d758a90e7..390a80ce551 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -74,10 +74,10 @@ const EnumPropertyItem rna_enum_object_mode_items[] = { {OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""}, {OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""}, {OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", ICON_PARTICLEMODE, "Particle Edit", ""}, - {OB_MODE_GPENCIL_EDIT, "GPENCIL_EDIT", ICON_EDITMODE_HLT, "Edit Mode", "Edit Grease Pencil Strokes"}, - {OB_MODE_GPENCIL_SCULPT, "GPENCIL_SCULPT", ICON_SCULPTMODE_HLT, "Sculpt Mode", "Sculpt Grease Pencil Strokes"}, - {OB_MODE_GPENCIL_PAINT, "GPENCIL_PAINT", ICON_GREASEPENCIL, "Draw", "Paint Grease Pencil Strokes"}, - {OB_MODE_GPENCIL_WEIGHT, "GPENCIL_WEIGHT", ICON_WPAINT_HLT, "Weight Paint", "Grease Pencil Weight Paint Strokes" }, + {OB_MODE_EDIT_GPENCIL, "EDIT_GPENCIL", ICON_EDITMODE_HLT, "Edit Mode", "Edit Grease Pencil Strokes"}, + {OB_MODE_SCULPT_GPENCIL, "SCULPT_GPENCIL", ICON_SCULPTMODE_HLT, "Sculpt Mode", "Sculpt Grease Pencil Strokes"}, + {OB_MODE_PAINT_GPENCIL, "PAINT_GPENCIL", ICON_GREASEPENCIL, "Draw", "Paint Grease Pencil Strokes"}, + {OB_MODE_WEIGHT_GPENCIL, "WEIGHT_GPENCIL", ICON_WPAINT_HLT, "Weight Paint", "Grease Pencil Weight Paint Strokes" }, {0, NULL, 0, NULL, NULL} }; @@ -91,10 +91,10 @@ const EnumPropertyItem rna_enum_workspace_object_mode_items[] = { {OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""}, {OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""}, {OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", ICON_PARTICLEMODE, "Particle Edit", ""}, - {OB_MODE_GPENCIL_EDIT, "GPENCIL_EDIT", ICON_EDITMODE_HLT, "Grease Pencil Edit Mode", "Edit Grease Pencil Strokes"}, - {OB_MODE_GPENCIL_SCULPT, "GPENCIL_SCULPT", ICON_SCULPTMODE_HLT, "Grease Pencil Sculpt Mode", "Sculpt Grease Pencil Strokes"}, - {OB_MODE_GPENCIL_PAINT, "GPENCIL_PAINT", ICON_GREASEPENCIL, "Grease Pencil Draw", "Paint Grease Pencil Strokes"}, - {OB_MODE_GPENCIL_WEIGHT, "GPENCIL_WEIGHT", ICON_WPAINT_HLT, "Grease Pencil Weight Paint", "Grease Pencil Weight Paint Strokes" }, + {OB_MODE_EDIT_GPENCIL, "EDIT_GPENCIL", ICON_EDITMODE_HLT, "Grease Pencil Edit Mode", "Edit Grease Pencil Strokes"}, + {OB_MODE_SCULPT_GPENCIL, "SCULPT_GPENCIL", ICON_SCULPTMODE_HLT, "Grease Pencil Sculpt Mode", "Sculpt Grease Pencil Strokes"}, + {OB_MODE_PAINT_GPENCIL, "PAINT_GPENCIL", ICON_GREASEPENCIL, "Grease Pencil Draw", "Paint Grease Pencil Strokes"}, + {OB_MODE_WEIGHT_GPENCIL, "WEIGHT_GPENCIL", ICON_WPAINT_HLT, "Grease Pencil Weight Paint", "Grease Pencil Weight Paint Strokes" }, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 8cda9677057..8ee542fcc51 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -342,7 +342,7 @@ static bool rna_Brush_mode_with_tool_poll(PointerRNA *ptr, PointerRNA value) if (slot_index != brush->gpencil_tool) { return false; } - mode = OB_MODE_GPENCIL_PAINT; + mode = OB_MODE_PAINT_GPENCIL; } return brush->ob_mode & mode; diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.c b/source/blender/windowmanager/intern/wm_keymap_utils.c index e3fe1b7abdd..412a35f2daa 100644 --- a/source/blender/windowmanager/intern/wm_keymap_utils.c +++ b/source/blender/windowmanager/intern/wm_keymap_utils.c @@ -123,10 +123,10 @@ wmKeyMap *WM_keymap_guess_from_context(const bContext *C) case CTX_MODE_PAINT_TEXTURE: km_id = "Image Paint"; break; case CTX_MODE_PARTICLE: km_id = "Particle"; break; case CTX_MODE_OBJECT: km_id = "Object Mode"; break; - case CTX_MODE_GPENCIL_PAINT: km_id = "Grease Pencil Stroke Paint Mode"; break; - case CTX_MODE_GPENCIL_EDIT: km_id = "Grease Pencil Stroke Edit Mode"; break; - case CTX_MODE_GPENCIL_SCULPT: km_id = "Grease Pencil Stroke Sculpt Mode"; break; - case CTX_MODE_GPENCIL_WEIGHT: km_id = "Grease Pencil Stroke Weight Mode"; break; + case CTX_MODE_PAINT_GPENCIL: km_id = "Grease Pencil Stroke Paint Mode"; break; + case CTX_MODE_EDIT_GPENCIL: km_id = "Grease Pencil Stroke Edit Mode"; break; + case CTX_MODE_SCULPT_GPENCIL: km_id = "Grease Pencil Stroke Sculpt Mode"; break; + case CTX_MODE_WEIGHT_GPENCIL: km_id = "Grease Pencil Stroke Weight Mode"; break; } } else if (sl->spacetype == SPACE_IMAGE) { diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 5843aba4ed8..ef8a57a1255 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -205,7 +205,7 @@ static void toolsystem_ref_link(bContext *C, WorkSpace *workspace, bToolRef *tre Main *bmain = CTX_data_main(C); if ((tref->space_type == SPACE_VIEW3D) && - (tref->mode == CTX_MODE_GPENCIL_SCULPT)) + (tref->mode == CTX_MODE_SCULPT_GPENCIL)) { const EnumPropertyItem *items = rna_enum_gpencil_sculpt_brush_items; const int i = RNA_enum_from_identifier(items, tref_rt->data_block); @@ -222,7 +222,7 @@ static void toolsystem_ref_link(bContext *C, WorkSpace *workspace, bToolRef *tre } } else if ((tref->space_type == SPACE_VIEW3D) && - (tref->mode == CTX_MODE_GPENCIL_WEIGHT)) + (tref->mode == CTX_MODE_WEIGHT_GPENCIL)) { const EnumPropertyItem *items = rna_enum_gpencil_weight_brush_items; const int i = RNA_enum_from_identifier(items, tref_rt->data_block); @@ -471,9 +471,9 @@ void WM_toolsystem_ref_sync_from_context( /* pass */ } else if ((tref->space_type == SPACE_VIEW3D) && - (tref->mode == CTX_MODE_GPENCIL_SCULPT)) + (tref->mode == CTX_MODE_SCULPT_GPENCIL)) { - if (ob->mode & OB_MODE_GPENCIL_SCULPT) { + if (ob->mode & OB_MODE_SCULPT_GPENCIL) { const EnumPropertyItem *items = rna_enum_gpencil_sculpt_brush_items; const int i = RNA_enum_from_value(items, ts->gp_sculpt.brushtype); const EnumPropertyItem *item = &items[i]; @@ -484,9 +484,9 @@ void WM_toolsystem_ref_sync_from_context( } } else if ((tref->space_type == SPACE_VIEW3D) && - (tref->mode == CTX_MODE_GPENCIL_WEIGHT)) + (tref->mode == CTX_MODE_WEIGHT_GPENCIL)) { - if (ob->mode & OB_MODE_GPENCIL_WEIGHT) { + if (ob->mode & OB_MODE_WEIGHT_GPENCIL) { const EnumPropertyItem *items = rna_enum_gpencil_weight_brush_items; const int i = RNA_enum_from_value(items, ts->gp_sculpt.weighttype); const EnumPropertyItem *item = &items[i]; @@ -791,11 +791,11 @@ static const char *toolsystem_default_tool(const bToolKey *tkey) case CTX_MODE_SCULPT: case CTX_MODE_PAINT_VERTEX: case CTX_MODE_PAINT_WEIGHT: - case CTX_MODE_GPENCIL_WEIGHT: + case CTX_MODE_WEIGHT_GPENCIL: case CTX_MODE_PAINT_TEXTURE: - case CTX_MODE_GPENCIL_PAINT: + case CTX_MODE_PAINT_GPENCIL: return "Draw"; - case CTX_MODE_GPENCIL_SCULPT: + case CTX_MODE_SCULPT_GPENCIL: return "Push"; /* end temporary hack. */ -- cgit v1.2.3