diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-06-21 09:17:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-06-21 09:19:45 +0300 |
commit | 1abf7dd83509b61d16589c5b12b3a2b941bab79f (patch) | |
tree | b86a7676ff393a254bb29035970564bac2e95e6c /release/scripts/startup | |
parent | 7cbd1285a5522971c9e46e417d63bac8c07bc1a4 (diff) |
Fix T48697: Brush curve-stroke snaps strangely
Support Snapping screen-space 2d curves, (was applying world-space coords in screen-space).
Also show snap settings in header.
Diffstat (limited to 'release/scripts/startup')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index b88b831ec4b..62d71b2c06a 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -81,7 +81,20 @@ class VIEW3D_HT_header(Header): row.prop(toolsettings, "proportional_edit_falloff", icon_only=True) # Snap - if not obj or mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}: + show_snap = False + if obj is None: + show_snap = True + else: + if mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}: + show_snap = True + else: + paint_settings = UnifiedPaintPanel.paint_settings(context) + if paint_settings: + brush = paint_settings.brush + if brush and brush.stroke_method == 'CURVE': + show_snap = True + + if show_snap: snap_element = toolsettings.snap_element row = layout.row(align=True) row.prop(toolsettings, "use_snap", text="") |