archipack 2.8 move to UI panel, fix auto-boolean in draw tools

This commit is contained in:
stephen leger 2019-04-07 10:13:42 +02:00
parent 71846207f1
commit a68c4204ac
4 changed files with 7 additions and 4 deletions

View File

@ -31,7 +31,7 @@ bl_info = {
'author': 's-leger',
'license': 'GPL',
'deps': '',
'version': (1, 2, 81),
'version': (1, 2, 82),
'blender': (2, 80, 0),
'location': 'View3D > Tools > Create > Archipack',
'warning': '',
@ -308,8 +308,8 @@ class TOOLS_PT_Archipack_Create(Panel):
bl_label = "Archipack"
bl_idname = "TOOLS_PT_Archipack_Create"
bl_space_type = "VIEW_3D"
bl_region_type = "TOOLS"
# bl_category = "Create"
bl_region_type = "UI"
bl_category = "Create"
bl_context = "objectmode"
@classmethod

View File

@ -554,7 +554,7 @@ class ARCHIPACK_OT_single_boolean(Operator):
@classmethod
def poll(cls, context):
w = context.active_object
return (w.data is not None and
return (w is not None and w.data is not None and
("archipack_wall2" in w.data or
"archipack_wall" in w.data or
"archipack_roof" in w.data) and

View File

@ -1749,6 +1749,7 @@ class ARCHIPACK_OT_door_draw(ArchipackDrawTool, Operator):
if event.type in {'LEFTMOUSE', 'RET', 'NUMPAD_ENTER', 'SPACE'}:
if wall is not None:
o.select_set(state=True)
context.view_layer.objects.active = wall
wall.select_set(state=True)
if bpy.ops.archipack.single_boolean.poll():

View File

@ -1939,10 +1939,12 @@ class ARCHIPACK_OT_window_draw(ArchipackDrawTool, Operator):
if event.type in {'LEFTMOUSE', 'RET', 'NUMPAD_ENTER', 'SPACE'}:
if wall is not None:
o.select_set(state=True)
context.view_layer.objects.active = wall
wall.select_set(state=True)
if bpy.ops.archipack.single_boolean.poll():
bpy.ops.archipack.single_boolean()
wall.select_set(state=False)
# o must be a window here
if d is not None: