|
|
@@ -1,210 +0,0 @@
|
|
1
|
|
-# -*- coding: utf-8 -*-
|
|
2
|
|
-from bpy.types import Panel
|
|
3
|
|
-
|
|
4
|
|
-from . import cfg
|
|
5
|
|
-
|
|
6
|
|
-# ---------------------------- Panel --------------------------------
|
|
7
|
|
-class UIPANEL_PT_def(Panel):
|
|
8
|
|
- bl_space_type = "VIEW_3D"
|
|
9
|
|
- bl_region_type = "UI"
|
|
10
|
|
- bl_category = "Array Tools"
|
|
11
|
|
-
|
|
12
|
|
-
|
|
13
|
|
-class UIPANEL_PT_trans(UIPANEL_PT_def):
|
|
14
|
|
- """Panel containing the settings for translation, scale and rotation array"""
|
|
15
|
|
- bl_label = "Array Tools"
|
|
16
|
|
-
|
|
17
|
|
- @classmethod
|
|
18
|
|
- def poll(cls, context):
|
|
19
|
|
- return (len(context.selected_objects) > 0 and (context.object.mode == 'OBJECT'))
|
|
20
|
|
-
|
|
21
|
|
- def draw(self, context):
|
|
22
|
|
- layout = self.layout
|
|
23
|
|
- scn = context.scene
|
|
24
|
|
- my_prop = scn.arraytools_prop
|
|
25
|
|
-
|
|
26
|
|
- row = layout.row()
|
|
27
|
|
- row.operator('scene.at_op')
|
|
28
|
|
- row = layout.row()
|
|
29
|
|
- if not my_prop.already_start:
|
|
30
|
|
- row.alignment = 'CENTER'
|
|
31
|
|
- row.label(text="~ Click to begin ~")
|
|
32
|
|
- else:
|
|
33
|
|
- row.prop(my_prop, 'is_copy')
|
|
34
|
|
- row.prop(my_prop, 'count')
|
|
35
|
|
- box = layout.box()
|
|
36
|
|
- box.label(text="Translation")
|
|
37
|
|
- col = box.column()
|
|
38
|
|
- split = col.split()
|
|
39
|
|
- split.prop(my_prop, 'tr_offset')
|
|
40
|
|
- split.prop(my_prop, 'tr_global')
|
|
41
|
|
-
|
|
42
|
|
- row = layout.row()
|
|
43
|
|
- row.prop(my_prop, 'at_pivot')
|
|
44
|
|
-
|
|
45
|
|
- box = layout.box()
|
|
46
|
|
- box.label(text="Scaling (%)")
|
|
47
|
|
- col = box.column()
|
|
48
|
|
- split = col.split()
|
|
49
|
|
- split.prop(my_prop, 'sc_offset')
|
|
50
|
|
- split.prop(my_prop, 'sc_global')
|
|
51
|
|
-
|
|
52
|
|
- box = layout.box()
|
|
53
|
|
- if scn.unit_settings.system_rotation == 'DEGREES':
|
|
54
|
|
- box.label(text="Rotation (degrees)")
|
|
55
|
|
- else:
|
|
56
|
|
- box.label(text="Rotation (radians)")
|
|
57
|
|
- split = box.split(factor=0.08)
|
|
58
|
|
-
|
|
59
|
|
- col = split.column(align=True)
|
|
60
|
|
- col.label(text='')
|
|
61
|
|
- col.operator('scene.x360', text='X')
|
|
62
|
|
- col.operator('scene.y360', text='Y')
|
|
63
|
|
- col.operator('scene.z360', text='Z')
|
|
64
|
|
-
|
|
65
|
|
- col = split.column()
|
|
66
|
|
- col.prop(my_prop, 'rot_offset')
|
|
67
|
|
- col = split.column()
|
|
68
|
|
- col.prop(my_prop, 'rot_global')
|
|
69
|
|
-
|
|
70
|
|
- box = layout.box()
|
|
71
|
|
- row = box.row()
|
|
72
|
|
- row.scale_y = 1.5
|
|
73
|
|
- row.operator('scene.at_done')
|
|
74
|
|
- row.operator('scene.at_cancel')
|
|
75
|
|
-
|
|
76
|
|
- row = box.row()
|
|
77
|
|
- row.scale_y = 0.3
|
|
78
|
|
- row.alignment = 'CENTER'
|
|
79
|
|
- row.label(text="~ Tansforms are NOT applied ~")
|
|
80
|
|
-
|
|
81
|
|
-
|
|
82
|
|
-class UIPANEL_PT_rows(UIPANEL_PT_def):
|
|
83
|
|
- """Panel containing the row options"""
|
|
84
|
|
- bl_parent_id = 'UIPANEL_PT_trans'
|
|
85
|
|
- bl_label = 'Rows options'
|
|
86
|
|
- bl_options = {'DEFAULT_CLOSED'}
|
|
87
|
|
-
|
|
88
|
|
- def draw(self, context):
|
|
89
|
|
- layout = self.layout
|
|
90
|
|
- my_prop = context.scene.arraytools_prop
|
|
91
|
|
-
|
|
92
|
|
- if my_prop.already_start:
|
|
93
|
|
- row = layout.row()
|
|
94
|
|
- row.prop(my_prop, 'count')
|
|
95
|
|
- row.prop(my_prop, 'row')
|
|
96
|
|
- row = layout.row()
|
|
97
|
|
-
|
|
98
|
|
- row.scale_y = 0.8
|
|
99
|
|
- row.prop(my_prop, 'align', icon_only=True, expand=True)
|
|
100
|
|
- row.prop(my_prop, 'alter')
|
|
101
|
|
- row = layout.row()
|
|
102
|
|
-
|
|
103
|
|
- row.alignment = 'CENTER'
|
|
104
|
|
- row.scale_x = 1.5
|
|
105
|
|
- row.scale_y = 0.6
|
|
106
|
|
- row.label(text=" - Offset settings -")
|
|
107
|
|
- row.scale_x = 0.8
|
|
108
|
|
- row.operator('scene.at_reset_second')
|
|
109
|
|
-
|
|
110
|
|
- layout.use_property_split = True
|
|
111
|
|
-
|
|
112
|
|
- col = layout.column()
|
|
113
|
|
- row = col.row(align=True)
|
|
114
|
|
- row.prop(my_prop, 'tr_second')
|
|
115
|
|
- col = layout.column()
|
|
116
|
|
- row = col.row(align=True)
|
|
117
|
|
- row.prop(my_prop, 'sc_second')
|
|
118
|
|
- col = layout.column()
|
|
119
|
|
- row = col.row(align=True)
|
|
120
|
|
- row.prop(my_prop, 'rot_second')
|
|
121
|
|
-
|
|
122
|
|
- row = layout.row()
|
|
123
|
|
- row.scale_y = 0.5
|
|
124
|
|
- row.label(text="Total : " + my_prop.total + " | current row : " + my_prop.erow)
|
|
125
|
|
- """
|
|
126
|
|
- box = layout.box()
|
|
127
|
|
- box.prop(my_prop, 'tr_second')
|
|
128
|
|
- #row = layout.row()
|
|
129
|
|
- box.prop(my_prop, 'sc_second')
|
|
130
|
|
- #row = layout.row()
|
|
131
|
|
- box.prop(my_prop, 'rot_second')
|
|
132
|
|
- """
|
|
133
|
|
-
|
|
134
|
|
-
|
|
135
|
|
-class UIPANEL_PT_options(UIPANEL_PT_def):
|
|
136
|
|
- """Panel containing the random options"""
|
|
137
|
|
- bl_parent_id = 'UIPANEL_PT_trans'
|
|
138
|
|
- bl_label = 'Random options'
|
|
139
|
|
- bl_options = {'DEFAULT_CLOSED'}
|
|
140
|
|
-
|
|
141
|
|
- def draw(self, context):
|
|
142
|
|
- layout = self.layout
|
|
143
|
|
- my_prop = context.scene.arraytools_prop
|
|
144
|
|
-
|
|
145
|
|
- layout.enabled = my_prop.already_start
|
|
146
|
|
- row = layout.row()
|
|
147
|
|
- row.alignment = 'CENTER'
|
|
148
|
|
- row.prop(my_prop, 'at_seed')
|
|
149
|
|
- row = layout.row()
|
|
150
|
|
- row.prop(my_prop, 'at_mode', expand=True)
|
|
151
|
|
- row = layout.row()
|
|
152
|
|
- if my_prop.at_mode == 'SIM':
|
|
153
|
|
- row.prop(my_prop, 'at_is_tr')
|
|
154
|
|
- row = layout.row()
|
|
155
|
|
- row.prop(my_prop, 'tr_rand')
|
|
156
|
|
- row = layout.row()
|
|
157
|
|
- row.prop(my_prop, 'at_is_sc')
|
|
158
|
|
- row = layout.row()
|
|
159
|
|
- row.prop(my_prop, 'sc_rand')
|
|
160
|
|
- row = layout.row()
|
|
161
|
|
- row.prop(my_prop, 'at_is_rot')
|
|
162
|
|
- row = layout.row()
|
|
163
|
|
- row.prop(my_prop, 'rot_rand')
|
|
164
|
|
- else:
|
|
165
|
|
- row.label(text=' ')
|
|
166
|
|
- row.label(text='X')
|
|
167
|
|
- row.label(text='Y')
|
|
168
|
|
- row.label(text='Z')
|
|
169
|
|
- row = layout.row()
|
|
170
|
|
- row.prop(my_prop, 'at_is_tr')
|
|
171
|
|
- row.scale_x = 0.5
|
|
172
|
|
- row.scale_y = 0.7
|
|
173
|
|
- row.operator('scene.at_reset_tr')
|
|
174
|
|
- row.operator('scene.fill_tr')
|
|
175
|
|
- row = layout.row()
|
|
176
|
|
- row.prop(my_prop, 'tr_min')
|
|
177
|
|
- row = layout.row()
|
|
178
|
|
- row.prop(my_prop, 'tr_max')
|
|
179
|
|
- row = layout.row()
|
|
180
|
|
-
|
|
181
|
|
- row.prop(my_prop, 'at_is_sc')
|
|
182
|
|
- row.scale_x = 0.5
|
|
183
|
|
- row.scale_y = 0.7
|
|
184
|
|
- row.operator('scene.at_reset_sc')
|
|
185
|
|
- row.operator('scene.fill_sc')
|
|
186
|
|
- row = layout.row()
|
|
187
|
|
- row.alignment = "CENTER"
|
|
188
|
|
- row.scale_y = 0.7
|
|
189
|
|
- row.prop(my_prop, 'sc_all')
|
|
190
|
|
- row = layout.row(align=True)
|
|
191
|
|
- row.label(text='min:')
|
|
192
|
|
- row.prop(my_prop, 'sc_min_x', text='')
|
|
193
|
|
- row.prop(my_prop, 'sc_min_y', text='')
|
|
194
|
|
- row.prop(my_prop, 'sc_min_z', text='')
|
|
195
|
|
- row = layout.row(align=True)
|
|
196
|
|
- row.label(text='max:')
|
|
197
|
|
- row.prop(my_prop, 'sc_max_x', text='')
|
|
198
|
|
- row.prop(my_prop, 'sc_max_y', text='')
|
|
199
|
|
- row.prop(my_prop, 'sc_max_z', text='')
|
|
200
|
|
-
|
|
201
|
|
- row = layout.row()
|
|
202
|
|
- row.prop(my_prop, "at_is_rot")
|
|
203
|
|
- row.scale_x = 0.5
|
|
204
|
|
- row.scale_y = 0.7
|
|
205
|
|
- row.operator('scene.at_reset_rot')
|
|
206
|
|
- row.operator('scene.fill_rot')
|
|
207
|
|
- row = layout.row()
|
|
208
|
|
- row.prop(my_prop, 'rot_min')
|
|
209
|
|
- row = layout.row()
|
|
210
|
|
- row.prop(my_prop, 'rot_max')
|