Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-20 16:29:19 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-20 16:30:45 +0300
commit576e7c82da44a2374d0c070c5c89e33f1b79ba10 (patch)
tree9294509d3d20cabc3d4083777ad16445d2e81647
parent97047db16ce6748f30c0e24f0a2053a11286c5fb (diff)
UI: keep grease pencil stroke placement / guides button always in main header
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py67
1 files changed, 35 insertions, 32 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index ac622da8a4c..ce62f47a77d 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -499,37 +499,6 @@ class VIEW3D_HT_header(Header):
panel="VIEW3D_PT_proportional_edit",
)
- # grease pencil
- if object_mode == 'PAINT_GPENCIL':
- layout.prop_with_popover(
- tool_settings,
- "gpencil_stroke_placement_view3d",
- text="",
- panel="VIEW3D_PT_gpencil_origin",
- )
-
- if object_mode in {'PAINT_GPENCIL', 'SCULPT_GPENCIL'}:
- layout.prop_with_popover(
- tool_settings.gpencil_sculpt,
- "lock_axis",
- text="",
- panel="VIEW3D_PT_gpencil_lock",
- )
-
- if object_mode == 'PAINT_GPENCIL':
- # FIXME: this is bad practice!
- # Tool options are to be displayed in the topbar.
- if context.workspace.tools.from_space_view3d_mode(object_mode).idname == "builtin_brush.Draw":
- settings = tool_settings.gpencil_sculpt.guide
- row = layout.row(align=True)
- row.prop(settings, "use_guide", text="", icon='GRID')
- sub = row.row(align=True)
- sub.active = settings.use_guide
- sub.popover(
- panel="VIEW3D_PT_gpencil_guide",
- text="Guides",
- )
-
def draw(self, context):
layout = self.layout
@@ -621,7 +590,41 @@ class VIEW3D_HT_header(Header):
layout.separator_spacer()
- if not show_region_tool_header:
+ if object_mode in {'PAINT_GPENCIL', 'SCULPT_GPENCIL'}:
+ # Grease pencil
+ if object_mode == 'PAINT_GPENCIL':
+ layout.prop_with_popover(
+ tool_settings,
+ "gpencil_stroke_placement_view3d",
+ text="",
+ panel="VIEW3D_PT_gpencil_origin",
+ )
+
+ if object_mode in {'PAINT_GPENCIL', 'SCULPT_GPENCIL'}:
+ layout.prop_with_popover(
+ tool_settings.gpencil_sculpt,
+ "lock_axis",
+ text="",
+ panel="VIEW3D_PT_gpencil_lock",
+ )
+
+ if object_mode == 'PAINT_GPENCIL':
+ # FIXME: this is bad practice!
+ # Tool options are to be displayed in the topbar.
+ if context.workspace.tools.from_space_view3d_mode(object_mode).idname == "builtin_brush.Draw":
+ settings = tool_settings.gpencil_sculpt.guide
+ row = layout.row(align=True)
+ row.prop(settings, "use_guide", text="", icon='GRID')
+ sub = row.row(align=True)
+ sub.active = settings.use_guide
+ sub.popover(
+ panel="VIEW3D_PT_gpencil_guide",
+ text="Guides",
+ )
+
+ layout.separator_spacer()
+ elif not show_region_tool_header:
+ # Transform settings depending on tool header visibility
VIEW3D_HT_header.draw_xform_template(layout, context)
layout.separator_spacer()