-
Notifications
You must be signed in to change notification settings - Fork 2
/
startMenu.py
55 lines (39 loc) · 1.54 KB
/
startMenu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import sys
import importlib
import bpy
# Local imports implemented to support Blender refreshes
modulesNames = ("newProject", "openProject")
for module in modulesNames:
if module in sys.modules:
importlib.reload(sys.modules[module])
else:
parent = ".".join(__name__.split(".")[:-1])
globals()[module] = importlib.import_module(f"{parent}.{module}")
def drawFileMenu(self, context, layout=None):
if not layout:
layout = self.layout
layout.operator(newProject.BlenditNewProject.bl_idname,
text="New Project", icon=newProject.NEW_PROJECT_ICON)
layout.operator(openProject.BlenditOpenProject.bl_idname,
text="Open Project", icon=openProject.OPEN_PROJECT_ICON)
layout.separator()
def drawStartMenu(self, context):
layout = self.layout
layout.emboss = 'PULLDOWN_MENU'
split = layout.split()
col1 = split.column()
col1.label(text="Blendit")
drawFileMenu(self, context, col1)
col2 = split.column()
col2.label(text="Getting Started")
col2.operator("wm.url_open", text="Blendit Website",
icon='URL').url = "https://blendit.imaginelenses.com"
col2.operator("wm.url_open", text="About Git",
icon='URL').url = "https://git-scm.com/about"
col2.separator()
def register():
bpy.types.TOPBAR_MT_file.prepend(drawFileMenu)
bpy.types.WM_MT_splash.prepend(drawStartMenu)
def unregister():
bpy.types.TOPBAR_MT_file.remove(drawFileMenu)
bpy.types.WM_MT_splash.remove(drawStartMenu)