-
Notifications
You must be signed in to change notification settings - Fork 21
/
preferences.py
41 lines (29 loc) · 1.14 KB
/
preferences.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
import os
import sys
import bpy
from bpy.props import *
currentFileDirectory = os.path.dirname(__file__)
addonName = os.path.basename(os.path.dirname(__file__))
class DeveloperProperties(bpy.types.PropertyGroup):
bl_idname = "umog_DeveloperProperties"
executionInfo : BoolProperty(name = "Execution Info", default = False,
description = "Enable informative print statements")
traceInfo : BoolProperty(name = "Trace Info", default = False,
description = "Enable selective traceback statements")
class AddonPreferences(bpy.types.AddonPreferences):
bl_idname = addonName
developer : PointerProperty(type = DeveloperProperties)
def draw(self, context):
layout = self.layout
row = layout.row()
col = row.column(align = True)
col.prop(self.developer, "executionInfo")
col.prop(self.developer, "traceInfo")
def getPreferences():
return bpy.context.preferences.addons[addonName].preferences
def getDeveloperSettings():
return getPreferences().developer
def getBlenderVersion():
return bpy.app.version
def getUMOGVersion():
return sys.modules[addonName].bl_info["version"]