-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
37 lines (32 loc) · 1.02 KB
/
main.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
import tkinter as tk
import sys
import getopt
import argparse
import logging
from gui.gui_main import ProgramGUI
import gui.properties as props
try:
import bpy
except:
print("Failed to import bpy")
exit()
else:
print("Successfully imported bpy!")
verbose_help = "Enables detailed render logging from blender"
debug_help = "Debug mode, loads default value and creates additional sliders"
parser = argparse.ArgumentParser(description="Program description")
parser.add_argument("--verbose", dest="verbose", action="store_true", help=verbose_help)
# DO NOT call this "--debug", because blender will recognize it then as an argument
parser.add_argument("--debugging", dest="debug", action="store_true", help=debug_help)
args = parser.parse_args()
if args.debug:
print("Debug mode enabled")
props.DEBUG = True
if args.verbose:
props.VERBOSE = True
root = tk.Tk()
my_gui = ProgramGUI(root)
root.columnconfigure(0, weight=1)
root.rowconfigure(0, weight=1)
my_gui.grid(row=0, column=0, sticky="news")
root.mainloop()