[Bf-blender-cvs] [780f0f646da] blender2.8: GP: Rename CTX and OB modes
Antonioya
noreply at git.blender.org
Fri Dec 14 16:52:24 CET 2018
Commit: 780f0f646da1aac01dc3164fd7d493426aca9e19
Author: Antonioya
Date: Fri Dec 14 16:45:57 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB780f0f646da1aac01dc3164fd7d493426aca9e19
GP: Rename CTX and OB modes
Part of T59335.
===================================================================
M release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M release/scripts/startup/bl_ui/space_topbar.py
M release/scripts/startup/bl_ui/space_view3d.py
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/blenkernel/BKE_context.h
M source/blender/blenkernel/intern/brush.c
M source/blender/blenkernel/intern/context.c
M source/blender/blenkernel/intern/paint.c
M source/blender/blenloader/intern/versioning_defaults.c
M source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M source/blender/draw/intern/draw_manager.c
M source/blender/draw/intern/draw_view.c
M source/blender/editors/gpencil/gpencil_brush.c
M source/blender/editors/gpencil/gpencil_data.c
M source/blender/editors/gpencil/gpencil_edit.c
M source/blender/editors/gpencil/gpencil_paint.c
M source/blender/editors/gpencil/gpencil_utils.c
M source/blender/editors/interface/interface_icons.c
M source/blender/editors/object/object_edit.c
M source/blender/editors/object/object_modes.c
M source/blender/editors/sculpt_paint/paint_ops.c
M source/blender/editors/space_buttons/space_buttons.c
M source/blender/editors/space_view3d/view3d_select.c
M source/blender/editors/undo/ed_undo.c
M source/blender/makesdna/DNA_object_enums.h
M source/blender/makesrna/intern/rna_brush.c
M source/blender/makesrna/intern/rna_context.c
M source/blender/makesrna/intern/rna_object.c
M source/blender/makesrna/intern/rna_sculpt_paint.c
M source/blender/windowmanager/intern/wm_keymap_utils.c
M source/blender/windowmanager/intern/wm_toolsystem.c
===================================================================
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")
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list