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 +- 6 files changed, 32 insertions(+), 32 deletions(-) (limited to 'release') 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 -- cgit v1.2.3