-
Notifications
You must be signed in to change notification settings - Fork 27
/
properties.py
64 lines (52 loc) · 2.26 KB
/
properties.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
56
57
58
59
60
61
62
63
64
import bpy
from bpy.props import *
from bpy.types import PropertyGroup, AddonPreferences
from . import prefs_display, prefs_behavior, prefs_sel_keymap, prefs_shortcut_keymap, prefs_tool_keymap
from .ui import update_panel
class AbnormalAddonPreferences(AddonPreferences):
bl_idname = __package__
object: StringProperty()
vertex_group: StringProperty(
description='Vertex Group to filter normal changes with')
vcol: StringProperty(
description='Vertex Color to write data to/from')
attribute: StringProperty(
description='Attribute to write data to/from')
use_n_panel: BoolProperty(
default=True, description='Use N Panel tab for addon. If False use the 3D View Header', update=update_panel)
settings: EnumProperty(
name='Settings', description='Settings to display',
items=[('PREFS_DISPLAY', 'Display', ''),
('PREFS_BEHAVIOR', 'Behavior', ''),
('PREFS_SEL_KEYMAP', 'Keymap Selection', ''),
('PREFS_SHORTCUT_KEYMAP', 'Keymap Shortcuts', ''),
('PREFS_TOOL_KEYMAP', 'Keymap Tools', '')],
default='PREFS_DISPLAY')
behavior: PointerProperty(type=prefs_behavior.prefs)
display: PointerProperty(type=prefs_display.prefs)
keymap_sel: PointerProperty(type=prefs_sel_keymap.prefs)
keymap_shortcut: PointerProperty(type=prefs_shortcut_keymap.prefs)
keymap_tool: PointerProperty(type=prefs_tool_keymap.prefs)
def draw(self, context):
layout = self.layout
column = layout.column(align=True)
row = column.row(align=True)
row.prop(self, 'settings', expand=True)
box = column.box()
globals()[self.settings.lower()].draw(self, context, box)
def register():
prefs_display.register()
prefs_behavior.register()
prefs_sel_keymap.register()
prefs_shortcut_keymap.register()
prefs_tool_keymap.register()
bpy.utils.register_class(AbnormalAddonPreferences)
return
def unregister():
prefs_display.unregister()
prefs_behavior.unregister()
prefs_sel_keymap.unregister()
prefs_shortcut_keymap.unregister()
prefs_tool_keymap.unregister()
bpy.utils.unregister_class(AbnormalAddonPreferences)
return