[Bf-blender-cvs] [cf34c165ea3] blender2.8: GP: Convert lock axis to popover
Antonioya
noreply at git.blender.org
Fri Sep 21 08:51:36 CEST 2018
Commit: cf34c165ea379e14fa1522a203f0555802631677
Author: Antonioya
Date: Fri Sep 21 08:51:04 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBcf34c165ea379e14fa1522a203f0555802631677
GP: Convert lock axis to popover
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 2effcf738ef..1b7687a22c1 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -229,12 +229,18 @@ class VIEW3D_HT_header(Header):
icon=or_icon,
)
- row = layout.row()
- row.enabled = context.tool_settings.gpencil_stroke_placement_view3d in ('ORIGIN', 'CURSOR')
- row.prop(context.tool_settings.gpencil_sculpt, "lockaxis", text='')
+ if object_mode in ('GPENCIL_PAINT', 'GPENCIL_SCULPT'):
+ lock = tool_settings.gpencil_sculpt.lockaxis
+ gp_lock = \
+ tool_settings.gpencil_sculpt.bl_rna.properties['lockaxis'].enum_items[lock]
- if object_mode == 'GPENCIL_SCULPT':
- layout.prop(context.tool_settings.gpencil_sculpt, "lockaxis", text='')
+ lk_icon = getattr(gp_lock, "icon", "BLANK1")
+ lk_name = getattr(gp_lock, "name", "None")
+ layout.popover(
+ panel="VIEW3D_PT_gpencil_lock",
+ text=lk_name,
+ icon=lk_icon,
+ )
layout.separator_spacer()
@@ -4786,6 +4792,20 @@ class VIEW3D_PT_gpencil_origin(Panel):
col.prop(context.tool_settings, "gpencil_stroke_placement_view3d", expand=True)
+class VIEW3D_PT_gpencil_lock(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'HEADER'
+ bl_label = "Lock Axis"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.label(text="Drawing Plane Lock")
+
+ row = layout.row()
+ col = row.column()
+ col.prop(context.tool_settings.gpencil_sculpt, "lockaxis", expand=True)
+
+
class VIEW3D_PT_overlay_gpencil_options(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'HEADER'
@@ -5216,6 +5236,7 @@ classes = (
VIEW3D_PT_pivot_point,
VIEW3D_PT_snapping,
VIEW3D_PT_gpencil_origin,
+ VIEW3D_PT_gpencil_lock,
VIEW3D_PT_transform_orientations,
VIEW3D_PT_overlay_gpencil_options,
VIEW3D_PT_context_properties,
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 2ce45173fdb..8a5f96de521 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -85,9 +85,9 @@ static EnumPropertyItem rna_enum_gpencil_weight_brush_items[] = {
static const EnumPropertyItem rna_enum_gpencil_lockaxis_items[] = {
{ GP_LOCKAXIS_NONE, "GP_LOCKAXIS_NONE", ICON_UNLOCKED, "None", "" },
- { GP_LOCKAXIS_X, "GP_LOCKAXIS_X", ICON_NDOF_DOM, "X", "Project strokes to plane locked to X" },
- { GP_LOCKAXIS_Y, "GP_LOCKAXIS_Y", ICON_NDOF_DOM, "Y", "Project strokes to plane locked to Y" },
- { GP_LOCKAXIS_Z, "GP_LOCKAXIS_Z", ICON_NDOF_DOM, "Z", "Project strokes to plane locked to Z" },
+ { GP_LOCKAXIS_X, "GP_LOCKAXIS_X", ICON_NDOF_DOM, "Y-Z Plane", "Project strokes to plane locked to X" },
+ { GP_LOCKAXIS_Y, "GP_LOCKAXIS_Y", ICON_NDOF_DOM, "X-Z Plane", "Project strokes to plane locked to Y" },
+ { GP_LOCKAXIS_Z, "GP_LOCKAXIS_Z", ICON_NDOF_DOM, "X-Y Plane", "Project strokes to plane locked to Z" },
{ 0, NULL, 0, NULL, NULL }
};
#endif
More information about the Bf-blender-cvs
mailing list