Refactor main init to call module inits instead

This commit is contained in:
Dion Moult
2020-12-29 13:49:53 +11:00
parent 17e805e144
commit f49174cab4
3 changed files with 64 additions and 44 deletions
@@ -0,0 +1,21 @@
import bpy
from . import ui, prop, operator
classes = (
prop.CoveToolProject,
prop.CoveToolSimpleAnalysis,
prop.CoveToolProperties,
ui.BIM_UL_covetool_projects,
ui.BIM_PT_covetool,
operator.Login,
operator.RunSimpleAnalysis,
operator.RunAnalysis,
)
def register():
bpy.types.Scene.CoveToolProperties = bpy.props.PointerProperty(type=prop.CoveToolProperties)
def unregister():
del bpy.types.Scene.CoveToolProperties
@@ -0,0 +1,32 @@
import bpy
from . import grid, wall, stair, door, window, slab, opening
classes = (
grid.BIM_OT_add_object,
wall.BIM_OT_add_object,
stair.BIM_OT_add_object,
door.BIM_OT_add_object,
window.BIM_OT_add_object,
slab.BIM_OT_add_object,
opening.BIM_OT_add_object,
)
def register():
bpy.types.VIEW3D_MT_mesh_add.append(grid.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.append(wall.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.append(stair.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.append(door.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.append(window.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.append(slab.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.append(opening.add_object_button)
def unregister():
bpy.types.VIEW3D_MT_mesh_add.remove(grid.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.remove(wall.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.remove(stair.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.remove(door.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.remove(window.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.remove(slab.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.remove(opening.add_object_button)