[Bf-extensions-cvs] [58e7a9a5] master: archipack: feature allow backspace while drawing to remove segments

Stephen Leger noreply at git.blender.org
Sat May 13 21:34:15 CEST 2017


Commit: 58e7a9a5d77512a244956c107667a79b4a9067c5
Author: Stephen Leger
Date:   Sat May 13 21:34:03 2017 +0200
Branches: master
https://developer.blender.org/rBAC58e7a9a5d77512a244956c107667a79b4a9067c5

archipack: feature allow backspace while drawing to remove segments

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

M	archipack/archipack_wall2.py

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

diff --git a/archipack/archipack_wall2.py b/archipack/archipack_wall2.py
index ee45f4bb..143a644c 100644
--- a/archipack/archipack_wall2.py
+++ b/archipack/archipack_wall2.py
@@ -1087,7 +1087,7 @@ class ARCHIPACK_OT_wall2(Operator):
     bl_options = {'REGISTER', 'UNDO'}
 
     auto_manipulate = BoolProperty(default=True)
-
+    
     def draw(self, context):
         layout = self.layout
         row = layout.row()
@@ -1249,6 +1249,7 @@ class ARCHIPACK_OT_wall2_draw(Operator):
                 ('CTRL', 'Snap'),
                 ('MMBTN', 'Constraint to axis'),
                 ('X Y', 'Constraint to axis'),
+                ('BACK_SPACE', 'Remove part'),
                 ('RIGHTCLICK or ESC', 'exit')
                 ])
 
@@ -1267,7 +1268,17 @@ class ARCHIPACK_OT_wall2_draw(Operator):
 
                 snap_point(takeloc, self.sp_draw, self.sp_callback, constraint_axis=(True, True, False))
             return {'RUNNING_MODAL'}
-
+            
+        if event.type in {'BACK_SPACE'} and event.value == 'RELEASE':
+            if self.o is not None:
+                o = self.o                
+                o.select = True
+                context.scene.objects.active = o
+                d = o.data.archipack_wall2[0]
+                if d.n_parts > 1:
+                    d.n_parts -= 1
+                
+            
         if self.state == 'CANCEL' or (event.type in {'ESC', 'RIGHTMOUSE'} and
                 event.value == 'RELEASE'):



More information about the Bf-extensions-cvs mailing list