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:
authorAntonioya <blendergit@gmail.com>2018-09-20 19:50:07 +0300
committerAntonioya <blendergit@gmail.com>2018-09-20 19:50:19 +0300
commit963d668a03991072b8fef6e70f0d105ff146735b (patch)
tree77fd442f6124532782cf3ba0c178c5f80630ac60 /release
parentce1b57227dad714723b68174e44a81aa775b08b9 (diff)
GP: Move origin selector to center and convert to popup
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py13
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py35
2 files changed, 36 insertions, 12 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 88af0c53c3d..54498abfc7c 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -184,12 +184,6 @@ class TOPBAR_HT_lower_bar(Header):
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".particlemode", category="")
elif mode == 'OBJECT':
layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".objectmode", category="")
- elif mode in ('GPENCIL_EDIT', 'GPENCIL_WEIGHT'):
- layout.label(text="Layer:")
- layout.popover(
- panel="TOPBAR_PT_gpencil_layers",
- text=txt
- )
elif mode == 'GPENCIL_PAINT':
layout.label(text="Layer:")
layout.popover(
@@ -197,20 +191,15 @@ class TOPBAR_HT_lower_bar(Header):
text=txt
)
- layout.prop(context.tool_settings, "gpencil_stroke_placement_view3d", text='')
- if context.tool_settings.gpencil_stroke_placement_view3d in ('ORIGIN', 'CURSOR'):
- layout.prop(context.tool_settings.gpencil_sculpt, "lockaxis", text='')
layout.prop(context.tool_settings, "use_gpencil_draw_onback", text="", icon='ORTHO')
layout.prop(context.tool_settings, "add_gpencil_weight_data", text="", icon='WPAINT_HLT')
layout.prop(context.tool_settings, "use_gpencil_additive_drawing", text="", icon='FREEZE')
-
- elif mode == 'GPENCIL_SCULPT':
+ elif mode in ('GPENCIL_EDIT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'):
layout.label(text="Layer:")
layout.popover(
panel="TOPBAR_PT_gpencil_layers",
text=txt
)
- layout.prop(context.tool_settings.gpencil_sculpt, "lockaxis", text='')
class _draw_left_context_mode:
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 885df0faaaa..f55ff95e3f8 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -215,6 +215,26 @@ class VIEW3D_HT_header(Header):
icon=act_pivot_point.icon,
text="",
)
+ # grease pencil
+ if object_mode == 'GPENCIL_PAINT':
+ origin = tool_settings.gpencil_stroke_placement_view3d
+ gp_origin = \
+ tool_settings.bl_rna.properties['gpencil_stroke_placement_view3d'].enum_items[origin]
+
+ or_icon = getattr(gp_origin, "icon", "BLANK1")
+ or_name = getattr(gp_origin, "name", "Origin")
+ layout.popover(
+ panel="VIEW3D_PT_gpencil_origin",
+ text=or_name,
+ 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 == 'GPENCIL_SCULPT':
+ layout.prop(context.tool_settings.gpencil_sculpt, "lockaxis", text='')
layout.separator_spacer()
@@ -4752,6 +4772,20 @@ class VIEW3D_PT_transform_orientations(Panel):
row.operator("transform.delete_orientation", text="", icon='X', emboss=False)
+class VIEW3D_PT_gpencil_origin(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'HEADER'
+ bl_label = "Origin"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.label(text="Origin")
+
+ row = layout.row()
+ col = row.column()
+ col.prop(context.tool_settings, "gpencil_stroke_placement_view3d", expand=True)
+
+
class VIEW3D_PT_overlay_gpencil_options(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'HEADER'
@@ -5181,6 +5215,7 @@ classes = (
VIEW3D_PT_overlay_sculpt,
VIEW3D_PT_pivot_point,
VIEW3D_PT_snapping,
+ VIEW3D_PT_gpencil_origin,
VIEW3D_PT_transform_orientations,
VIEW3D_PT_overlay_gpencil_options,
VIEW3D_PT_context_properties,