-
Notifications
You must be signed in to change notification settings - Fork 11
/
Preferences.py
51 lines (43 loc) · 1.43 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
42
43
44
45
46
47
48
49
50
51
import bpy
import os
class MindMapperPreferences(bpy.types.AddonPreferences):
bl_idname = __package__
image_resolution = bpy.props.EnumProperty(
items=(
('256', '256', '256 x 256'),
('512', '512', '512 x 512'),
('1K', '1K', '1024 x 1024'),
('2K', '2K', '2048 x 2048'),
('4K', '4K', '4096 x 4096')
),
name='Image Resolution',
description='Resolution of the main node image',
default='1K',
)
image_folder = os.path.join(os.path.dirname(__file__), "images")
node_images_dir: bpy.props.StringProperty(
name="", #
subtype='DIR_PATH', # noqa f821
default=image_folder
)
ShowInNode: bpy.props.BoolProperty(
name='Show Shortcuts in Node (Global)',
description='They will remain visible in the Node properties panel.',
default=True,
)
WrapAmount: bpy.props.IntProperty(
name='Text Wrap Amount',
description='Bigger numbers mean shorter lines',
default=6,
soft_max=10,
soft_min=1,
)
def draw(self, context):
layout = self.layout
box = layout.box()
column = box.column()
row = column.row()
row.prop(self, 'ShowInNode')
row.prop(self, 'WrapAmount')
column.label(text='Image Folder:')
column.prop(self, 'node_images_dir')