1 # SPDX-FileCopyrightText: 2016-2023 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 # ----------------------------------------------------------
6 # Author: Antonio Vazquez (antonioya)
7 # ----------------------------------------------------------
9 # ----------------------------------------------
11 # ----------------------------------------------
14 "author": "Antonio Vazquez (antonioya)",
15 "location": "View3D > Add Mesh / Sidebar > Create Tab",
18 "description": "Generate rooms, doors, windows, and other architecture objects",
19 "doc_url": "{BLENDER_MANUAL_URL}/addons/add_mesh/archimesh.html",
20 "category": "Add Mesh"
26 # ----------------------------------------------
28 # ----------------------------------------------
31 importlib
.reload(achm_room_maker
)
32 importlib
.reload(achm_door_maker
)
33 importlib
.reload(achm_window_maker
)
34 importlib
.reload(achm_roof_maker
)
35 importlib
.reload(achm_column_maker
)
36 importlib
.reload(achm_stairs_maker
)
37 importlib
.reload(achm_kitchen_maker
)
38 importlib
.reload(achm_shelves_maker
)
39 importlib
.reload(achm_books_maker
)
40 importlib
.reload(achm_lamp_maker
)
41 importlib
.reload(achm_curtain_maker
)
42 importlib
.reload(achm_venetian_maker
)
43 importlib
.reload(achm_main_panel
)
44 importlib
.reload(achm_window_panel
)
45 # print("archimesh: Reloaded multifiles")
47 from . import achm_books_maker
48 from . import achm_column_maker
49 from . import achm_curtain_maker
50 from . import achm_venetian_maker
51 from . import achm_door_maker
52 from . import achm_kitchen_maker
53 from . import achm_lamp_maker
54 from . import achm_main_panel
55 from . import achm_roof_maker
56 from . import achm_room_maker
57 from . import achm_shelves_maker
58 from . import achm_stairs_maker
59 from . import achm_window_maker
60 from . import achm_window_panel
62 # print("archimesh: Imported multifiles")
64 # noinspection PyUnresolvedReferences
66 # noinspection PyUnresolvedReferences
67 from bpy
.props
import (
74 # noinspection PyUnresolvedReferences
75 from bpy
.types
import (
83 # ----------------------------------------------------------
85 # ----------------------------------------------------------
88 class ARCHIMESH_MT_MeshDecorationAdd(Menu
):
89 bl_idname
= "VIEW3D_MT_mesh_decoration_add"
90 bl_label
= "Decoration assets"
92 # noinspection PyUnusedLocal
93 def draw(self
, context
):
94 self
.layout
.operator("mesh.archimesh_books", text
="Books")
95 self
.layout
.operator("mesh.archimesh_light", text
="Lamp")
96 self
.layout
.operator("mesh.archimesh_roller", text
="Roller curtains")
97 self
.layout
.operator("mesh.archimesh_venetian", text
="Venetian blind")
98 self
.layout
.operator("mesh.archimesh_japan", text
="Japanese curtains")
100 # ----------------------------------------------------------
102 # ----------------------------------------------------------
105 class ARCHIMESH_MT_CustomMenuAdd(Menu
):
106 bl_idname
= "VIEW3D_MT_mesh_custom_menu_add"
107 bl_label
= "Archimesh"
109 # noinspection PyUnusedLocal
110 def draw(self
, context
):
111 self
.layout
.operator_context
= 'INVOKE_REGION_WIN'
112 self
.layout
.operator("mesh.archimesh_room", text
="Room")
113 self
.layout
.operator("mesh.archimesh_door", text
="Door")
114 self
.layout
.operator("mesh.archimesh_window", text
="Rail Window")
115 self
.layout
.operator("mesh.archimesh_winpanel", text
="Panel Window")
116 self
.layout
.operator("mesh.archimesh_kitchen", text
="Cabinet")
117 self
.layout
.operator("mesh.archimesh_shelves", text
="Shelves")
118 self
.layout
.operator("mesh.archimesh_column", text
="Column")
119 self
.layout
.operator("mesh.archimesh_stairs", text
="Stairs")
120 self
.layout
.operator("mesh.archimesh_roof", text
="Roof")
121 self
.layout
.menu("VIEW3D_MT_mesh_decoration_add", text
="Decoration props", icon
="GROUP")
123 # --------------------------------------------------------------
124 # Register all operators and panels
125 # --------------------------------------------------------------
128 # noinspection PyUnusedLocal
129 def AchmMenu_func(self
, context
):
132 self
.layout
.menu("VIEW3D_MT_mesh_custom_menu_add", icon
="GROUP")
136 ARCHIMESH_MT_CustomMenuAdd
,
137 ARCHIMESH_MT_MeshDecorationAdd
,
138 achm_room_maker
.ARCHIMESH_OT_Room
,
139 achm_room_maker
.ARCHIMESH_PT_RoomGenerator
,
140 achm_room_maker
.ARCHIMESH_OT_ExportRoom
,
141 achm_room_maker
.ARCHIMESH_OT_ImportRoom
,
142 achm_door_maker
.ARCHIMESH_OT_Door
,
143 achm_door_maker
.ARCHIMESH_PT_DoorObjectgenerator
,
144 achm_window_maker
.ARCHIMESH_OT_Windows
,
145 achm_window_maker
.ARCHIMESH_PT_WindowObjectgenerator
,
146 achm_roof_maker
.ARCHIMESH_OT_Roof
,
147 achm_column_maker
.ARCHIMESH_OT_Column
,
148 achm_stairs_maker
.ARCHIMESH_OT_Stairs
,
149 achm_kitchen_maker
.ARCHIMESH_OT_Kitchen
,
150 achm_kitchen_maker
.ARCHIMESH_OT_ExportInventory
,
151 achm_shelves_maker
.ARCHIMESH_OT_Shelves
,
152 achm_books_maker
.ARCHIMESH_OT_Books
,
153 achm_lamp_maker
.ARCHIMESH_PT_Lamp
,
154 achm_curtain_maker
.ARCHIMESH_OT_Roller
,
155 achm_curtain_maker
.ARCHIMESH_OT_Japan
,
156 achm_venetian_maker
.ARCHIMESH_OT_Venetian
,
157 achm_venetian_maker
.ARCHIMESH_PT_VenetianObjectgenerator
,
158 achm_main_panel
.ARCHIMESH_PT_Main
,
159 achm_main_panel
.ARCHIMESH_OT_Hole
,
160 achm_main_panel
.ARCHIMESH_OT_Pencil
,
161 achm_main_panel
.ARCHIMESH_OT_HintDisplay
,
162 achm_window_panel
.ARCHIMESH_PT_Win
,
163 achm_window_panel
.ARCHIMESH_PT_WindowEdit
167 from bpy
.utils
import register_class
171 VIEW3D_MT_mesh_add
.append(AchmMenu_func
)
174 Scene
.archimesh_select_only
= BoolProperty(
175 name
="Only selected",
176 description
="Apply auto holes only to selected objects",
179 Scene
.archimesh_ceiling
= BoolProperty(
181 description
="Create a ceiling",
184 Scene
.archimesh_floor
= BoolProperty(
186 description
="Create a floor automatically",
190 Scene
.archimesh_merge
= BoolProperty(
192 description
="Close walls to create a full closed room",
196 Scene
.archimesh_text_color
= FloatVectorProperty(
198 description
="Color for the text and lines",
199 default
=(0.173, 0.545, 1.0, 1.0),
205 Scene
.archimesh_walltext_color
= FloatVectorProperty(
207 description
="Color for the wall label",
208 default
=(1, 0.8, 0.1, 1.0),
214 Scene
.archimesh_font_size
= IntProperty(
216 description
="Text size for hints",
217 default
=14, min=10, max=150,
219 Scene
.archimesh_wfont_size
= IntProperty(
221 description
="Text size for wall labels",
222 default
=16, min=10, max=150,
224 Scene
.archimesh_hint_space
= FloatProperty(
225 name
='Separation', min=0, max=5, default
=0.1,
227 description
='Distance from object to display hint',
229 Scene
.archimesh_gl_measure
= BoolProperty(
231 description
="Display measures",
234 Scene
.archimesh_gl_name
= BoolProperty(
236 description
="Display names",
239 Scene
.archimesh_gl_ghost
= BoolProperty(
241 description
="Display measures for all objects,"
242 " not only selected",
248 # register internal property
249 wm
.archimesh_run_opengl
= BoolProperty(default
=False)
253 from bpy
.utils
import unregister_class
254 for cls
in reversed(classes
):
255 unregister_class(cls
)
257 VIEW3D_MT_mesh_add
.remove(AchmMenu_func
)
260 del Scene
.archimesh_select_only
261 del Scene
.archimesh_ceiling
262 del Scene
.archimesh_floor
263 del Scene
.archimesh_merge
264 del Scene
.archimesh_text_color
265 del Scene
.archimesh_walltext_color
266 del Scene
.archimesh_font_size
267 del Scene
.archimesh_wfont_size
268 del Scene
.archimesh_hint_space
269 del Scene
.archimesh_gl_measure
270 del Scene
.archimesh_gl_name
271 del Scene
.archimesh_gl_ghost
273 achm_main_panel
.ARCHIMESH_OT_HintDisplay
.handle_remove(achm_main_panel
.ARCHIMESH_OT_HintDisplay
, bpy
.context
)
274 wm
= bpy
.context
.window_manager
275 p
= 'archimesh_run_opengl'
280 if __name__
== '__main__':