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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Leger <stephen@3dservices.ch>2017-08-03 16:59:40 +0300
committerStephen Leger <stephen@3dservices.ch>2017-08-09 23:37:00 +0300
commit92301276de6919b27b79d548ea69cd0b07ec0549 (patch)
tree6ea2ea916b4f374d37cd59d540d55b33cbe891e9 /archipack/archipack_window.py
parent948149cefc5501497b6500b6436f86418eb08367 (diff)
archipack: fix left select issue in draw window/door and allow selecting preset while drawing
Diffstat (limited to 'archipack/archipack_window.py')
-rw-r--r--archipack/archipack_window.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/archipack/archipack_window.py b/archipack/archipack_window.py
index 4b052643..3979b181 100644
--- a/archipack/archipack_window.py
+++ b/archipack/archipack_window.py
@@ -1841,6 +1841,7 @@ class ARCHIPACK_OT_window_draw(ArchpackDrawTool, Operator):
filepath = StringProperty(default="")
feedback = None
stack = []
+ object_name = ""
@classmethod
def poll(cls, context):
@@ -1881,6 +1882,8 @@ class ARCHIPACK_OT_window_draw(ArchpackDrawTool, Operator):
bpy.ops.archipack.window(auto_manipulate=False, filepath=self.filepath)
o = context.active_object
+ self.object_name = o.name
+
bpy.ops.archipack.generate_hole('INVOKE_DEFAULT')
o.select = True
context.scene.objects.active = o
@@ -1888,7 +1891,11 @@ class ARCHIPACK_OT_window_draw(ArchpackDrawTool, Operator):
def modal(self, context, event):
context.area.tag_redraw()
- o = context.active_object
+ o = context.scene.objects.get(self.object_name)
+
+ if o is None:
+ return {'FINISHED'}
+
d = archipack_window.datablock(o)
hole = None
if d is not None:
@@ -1911,6 +1918,14 @@ class ARCHIPACK_OT_window_draw(ArchpackDrawTool, Operator):
d.y = wall.data.archipack_wall2[0].width
if event.value == 'PRESS':
+
+ if event.type in {'C'}:
+ bpy.ops.archipack.window(mode='DELETE')
+ self.feedback.disable()
+ bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
+ bpy.ops.archipack.window_preset_menu('INVOKE_DEFAULT', preset_operator="archipack.window_draw")
+ return {'FINISHED'}
+
if event.type in {'LEFTMOUSE', 'RET', 'NUMPAD_ENTER', 'SPACE'}:
if wall is not None:
context.scene.objects.active = wall
@@ -1970,6 +1985,7 @@ class ARCHIPACK_OT_window_draw(ArchpackDrawTool, Operator):
self.feedback.instructions(context, "Draw a window", "Click & Drag over a wall", [
('LEFTCLICK, RET, SPACE, ENTER', 'Create a window'),
('BACKSPACE, CTRL+Z', 'undo last'),
+ ('C', 'Choose another window'),
('SHIFT', 'Make independant copy'),
('RIGHTCLICK or ESC', 'exit')
])