-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathpreferences.py
101 lines (80 loc) · 2.73 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#Version 0.1.6
import bpy
class SimpleLatticePrefs(bpy.types.AddonPreferences):
bl_idname = __package__
orientation_types = (('GLOBAL', 'Global', ''),
('LOCAL', 'Local', ''),
('CURSOR', 'Cursor', ''),
('NORMAL', 'Normal', ''))
# position_types = (('on_top','On Top',''),
# ('bottom','Bottom',''))
interpolation_types = (('KEY_LINEAR', 'Linear', ''),
('KEY_CARDINAL', 'Cardinal', ''),
('KEY_CATMULL_ROM', 'Catmull-Rom', ''),
('KEY_BSPLINE', 'BSpline', ''))
default_orientation: bpy.props.EnumProperty(
name="Default Orientation",
items=orientation_types,
default='GLOBAL'
)
# default_position: bpy.props.EnumProperty(
# name="Default Position",
# items=position_types,
# default='bottom'
# )
default_ignore_mods: bpy.props.BoolProperty(
name="Ignore Modifiers",
default = False,
description="Ignore Modifiers for calculation BBOX for lattice")
default_resolution_u: bpy.props.IntProperty(
#name="Default U",
default=2,
min=2
)
default_resolution_v: bpy.props.IntProperty(
#name="Default V",
default=2,
min=2
)
default_resolution_w: bpy.props.IntProperty(
#name="Default W",
default=2,
min=2
)
default_interpolation: bpy.props.EnumProperty(
name="Default Interpolation",
items=interpolation_types,
default='KEY_LINEAR'
)
default_scale: bpy.props.FloatProperty(
name="Scale",
default=1.0,
min=0.001,
soft_min=0.1,
soft_max=2.0
)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
box = layout.box()
col = box.column()
sub = col.row()
sub.prop(self, "default_orientation", expand=True)
# col.separator()
# sub = col.row()
# sub.prop(self, "default_position", expand=True)
col.separator()
sub = col.row()
sub.prop(self, "default_ignore_mods")
col.separator()
sub = col.row()
sub2 = sub.column(align=True)
sub2.prop(self, "default_resolution_u", text="Default U")
sub2.prop(self, "default_resolution_v", text="V")
sub2.prop(self, "default_resolution_w", text="W")
col.separator()
sub = col.row()
sub.prop(self, "default_interpolation")
col.separator()
sub = col.row()
sub.prop(self, "default_scale")