[Bf-extensions-cvs] [7ec6d84f] blender2.8: Fix T58952: view3d_pie_menus: using snapping pie causes error

Philipp Oeser noreply at git.blender.org
Sat Dec 8 16:25:24 CET 2018


Commit: 7ec6d84fccdd20f1410f09d7284ccc2ebf80cc3a
Author: Philipp Oeser
Date:   Sat Dec 8 16:15:22 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBA7ec6d84fccdd20f1410f09d7284ccc2ebf80cc3a

Fix T58952: view3d_pie_menus: using snapping pie causes error

note that logic is not taking into account that snapping to different
elements (mixing) is now possible, so it is still setting a single
choice as in 2.79. Supporting this is of course possible but would need
some more work on the UI to show which elements are currently selected.

===================================================================

M	space_view3d_pie_menus/pie_snap_menu.py

===================================================================

diff --git a/space_view3d_pie_menus/pie_snap_menu.py b/space_view3d_pie_menus/pie_snap_menu.py
index 9bcfd4ad..c1ee22e7 100644
--- a/space_view3d_pie_menus/pie_snap_menu.py
+++ b/space_view3d_pie_menus/pie_snap_menu.py
@@ -89,10 +89,9 @@ class SnapVolume(Operator):
         ts = context.tool_settings
         if ts.use_snap is False:
             ts.use_snap = True
-            ts.snap_element = 'VOLUME'
-
-        if ts.snap_element != 'VOLUME':
-            ts.snap_element = 'VOLUME'
+            ts.snap_elements = {'VOLUME'}
+        if ts.snap_elements != {'VOLUME'}:
+            ts.snap_elements = {'VOLUME'}
         return {'FINISHED'}
 
 
@@ -106,10 +105,10 @@ class SnapFace(Operator):
 
         if ts.use_snap is False:
             ts.use_snap = True
-            ts.snap_element = 'FACE'
+            ts.snap_elements = {'FACE'}
 
-        if ts.snap_element != 'FACE':
-            ts.snap_element = 'FACE'
+        if ts.snap_elements != {'FACE'}:
+            ts.snap_elements = {'FACE'}
         return {'FINISHED'}
 
 
@@ -123,10 +122,10 @@ class SnapEdge(Operator):
 
         if ts.use_snap is False:
             ts.use_snap = True
-            ts.snap_element = 'EDGE'
+            ts.snap_elements = {'EDGE'}
 
-        if ts.snap_element != 'EDGE':
-            ts.snap_element = 'EDGE'
+        if ts.snap_elements != {'EDGE'}:
+            ts.snap_elements = {'EDGE'}
         return {'FINISHED'}
 
 
@@ -140,10 +139,10 @@ class SnapVertex(Operator):
 
         if ts.use_snap is False:
             ts.use_snap = True
-            ts.snap_element = 'VERTEX'
+            ts.snap_elements = {'VERTEX'}
 
-        if ts.snap_element != 'VERTEX':
-            ts.snap_element = 'VERTEX'
+        if ts.snap_elements != {'VERTEX'}:
+            ts.snap_elements = {'VERTEX'}
         return {'FINISHED'}
 
 
@@ -157,10 +156,10 @@ class SnapIncrement(Operator):
 
         if ts.use_snap is False:
             ts.use_snap = True
-            ts.snap_element = 'INCREMENT'
+            ts.snap_elements = {'INCREMENT'}
 
-        if ts.snap_element != 'INCREMENT':
-            ts.snap_element = 'INCREMENT'
+        if ts.snap_elements != {'INCREMENT'}:
+            ts.snap_elements = {'INCREMENT'}
         return {'FINISHED'}



More information about the Bf-extensions-cvs mailing list