GP: Rename CTX and OB modes
authorAntonioya <blendergit@gmail.com>
Fri, 14 Dec 2018 15:45:57 +0000 (16:45 +0100)
committerAntonioya <blendergit@gmail.com>
Fri, 14 Dec 2018 15:52:12 +0000 (16:52 +0100)
Part of T59335.

33 files changed:
release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
release/scripts/startup/bl_ui/properties_grease_pencil_common.py
release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
release/scripts/startup/bl_ui/space_topbar.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/blenkernel/BKE_context.h
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/paint.c
source/blender/blenloader/intern/versioning_defaults.c
source/blender/draw/engines/gpencil/gpencil_draw_utils.c
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_view.c
source/blender/editors/gpencil/gpencil_brush.c
source/blender/editors/gpencil/gpencil_data.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/gpencil/gpencil_utils.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_modes.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/undo/ed_undo.c
source/blender/makesdna/DNA_object_enums.h
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_context.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/windowmanager/intern/wm_keymap_utils.c
source/blender/windowmanager/intern/wm_toolsystem.c

index ddba25609ea10c207a5b1fa1b0335016a967c53d..ba7684260176b34f6014b8524dde9034af906b9e 100644 (file)
@@ -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)
index fff4a063ef80d7577131409c98e76882633e531c..09e81115d6a725120caaa02d640e8ec0992983b1 100644 (file)
@@ -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
index 3699c021b7d7477a7e149e13006d1fa1f09097f4..4da5455298f0ff36f9facf5784c72d664dd32380 100644 (file)
@@ -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,
         ],
     }
index 01c9b355be837fbbe5711f7489ec60c46dd0265d..f73d21dcfb843863259292860c2571ec8a69ea1b 100644 (file)
@@ -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
index ef2569672bf04d65c52479db2caf9e7264264e75..b3c52adff2bfaf01dffa23f136fb64e4ddb58719 100644 (file)
@@ -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")
 
index 3f6518e80a6639f83ca3b6a4139c1f721b22d670..68d334dfaea341662d8296b6cdc2f003e0a61f82 100644 (file)
@@ -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
 
index 798150aee3c46365164425ac5b83057110f7aa38..246ba5ba5f04f4a76d47f4b846d84ddc9f89cd33 100644 (file)
@@ -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 */
 
index c2e5659a64fdf55cc6281e3bde72971f7235e214..b000b3709f2542c2a1162003b6810a6ffa09bd5b 100644 (file)
@@ -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);
index 96dd90cdf35aff4c1e469dc911da15595d5c83a1..a907babd661273b2f4529ad6115a13624685ddb7 100644 (file)
@@ -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;
                }
        }
 
index 08c6413efa28eca08905568d5624552a0b154bcf..c5bfa41fa0b799522a4e521f5cfb2b2290ccae22 100644 (file)
@@ -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. */
index 171e40deb2460f94c7d599f608eeecab6bb49704..4dd046d9a7305db4223d34a339f2df5fe14e83cf 100644 (file)
@@ -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;
                        }
index 2450f9419bf643185ab86714b268e9139e8b46bd..87772a7201556219b4f6745348fe82c11953f2dc 100644 (file)
@@ -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))
index 494cae467b44dba1c988490d1d6eb116b615a6c8..38938ea107c2b7a7f685010f01a28090cc5adb0e 100644 (file)
@@ -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");
index 4a890c3be84ada71707d8358a1c2923e68fdf70d..4c53049e7720c375edfe285cfa2ddb92a22d76a5 100644 (file)
@@ -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;
        }
index 9feea61c6727f1432df88cbffcae389a8b1bdd87..5ec55d1e98eb113f2b6326f8f7102b6c633d6c64 100644 (file)
@@ -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;
index a2cb9612e4324d1dffe9cce26733893343bb66a5..51046726e19306715d4e4bbbfbab7075b51d88d8 100644 (file)
@@ -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;
                        }
                }
index 072f4d0e317cc5b734376a632adaef0f48989237..916a268dc57a5250f5f16562e614348e4ea044cc 100644 (file)
@@ -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;
index b97e335d0818bc21872c277cd09e2769eef2ddfb..68d0f6506d0db9dd2552a05ecd0cba8bb6aae2ac 100644 (file)
@@ -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);
                }
index 40c2567f1c05d5aabfefe6fc9527b6e35674f7d1..2ccaea84e6b5663b406a65c57dee54dc3a33d38e 100644 (file)
@@ -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:
index 36624f475ce75b58fe3baa28366f2c4eae92d0f8..f371bae77c06a35681fd305570b526970c75fc45 100644 (file)
@@ -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) {
index 676d44e3ea42353ac9a0b9ac16c7857d6905d7a2..59ce42c50a5511053589eb5c58285595dbe302c1 100644 (file)
@@ -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))
index 4c625a4d33cf947eb10983039d819faa9778caf0..771bbc5c18c96cce303acaf6e0c9755e72ded856 100644 (file)
@@ -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;
                                }
index 11565d665b1206138fe6a2cea38b664f26dc246a..ed40a22bd78e763cb1a525e794ea328d2b29661e 100644 (file)
@@ -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 */
        }
 
index 4520f837a0a3ec3ebe3d50c990777be3e863c5ee..c9ba5722572b4041336773543c7bea2c58dba82f 100644 (file)
@@ -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;
        }
index 08d8d168e810c22e1ec86bd498dbfabb74ce5a51..c976803065e9bfe464f608ed577c718442f2eb15 100644 (file)
@@ -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);
                                }
index 8b4292dedbd2fd25c73191f8d7168f9690c60fb9..dd45974902991d53b6c4df0854221f468600e048 100644 (file)
@@ -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 {
index 8a7016ccd130bbac7ae4650a51cb96ae4be91508..13e68698d1a587ba57aaab615864fd5aa495b9b9 100644 (file)
@@ -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)
index d9b9677bbc624da2c52070cf92a3c5006ed10767..445ceb6ddb51889f354420f7a4b49502a113f5ca 100644 (file)
@@ -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 */
index 618cefe13e5d92e64bbd9bcb29863407011f09f9..240d21407d0a30bfca120fb075e9b561cb0028bb 100644 (file)
@@ -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}
 };
 
index 19d758a90e750c61a1b492486ed7cadf4f100163..390a80ce551f68cbd2a6aff85e872f3c9bf9a7bf 100644 (file)
@@ -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}
 };
 
index 8cda9677057328d92a3f01ff4347745aa4618acc..8ee542fcc51e258a4534b6e61a21997f48fec29f 100644 (file)
@@ -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;
index e3fe1b7abdd6ab0f88b84f8ed883d498ca7ab614..412a35f2daa17fafa7eed2b4a31cbc07c4a84f7b 100644 (file)
@@ -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) {
index 5843aba4ed879dd4819187bf3554944c89073b83..ef8a57a1255c2f9ca5066f301a7e957cbcd6f288 100644 (file)
@@ -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. */