Skip to content

Commit ee8e987

Browse files
Merge pull request AUTOMATIC1111#13266 from wkpark/xyz-prepare
xyz_grid: add prepare
2 parents 87b5039 + afd0624 commit ee8e987

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/xyz_grid.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,14 @@ def csv_string_to_list_strip(data_str):
205205

206206

207207
class AxisOption:
208-
def __init__(self, label, type, apply, format_value=format_value_add_label, confirm=None, cost=0.0, choices=None):
208+
def __init__(self, label, type, apply, format_value=format_value_add_label, confirm=None, cost=0.0, choices=None, prepare=None):
209209
self.label = label
210210
self.type = type
211211
self.apply = apply
212212
self.format_value = format_value
213213
self.confirm = confirm
214214
self.cost = cost
215+
self.prepare = prepare
215216
self.choices = choices
216217

217218

@@ -536,6 +537,8 @@ def process_axis(opt, vals, vals_dropdown):
536537

537538
if opt.choices is not None and not csv_mode:
538539
valslist = vals_dropdown
540+
elif opt.prepare is not None:
541+
valslist = opt.prepare(vals)
539542
else:
540543
valslist = csv_string_to_list_strip(vals)
541544

0 commit comments

Comments
 (0)