解析逻辑修改
parent
dac79450fa
commit
88d8ea4389
|
|
@ -35,6 +35,9 @@ nouse_group = 'nouse'
|
|||
tfull_layer = 'tfull'
|
||||
base_layer = 'base'
|
||||
mask_layer = 'tmask'
|
||||
tlight_name = 'tlight'
|
||||
tshadow_name = 'tshadow'
|
||||
group_name = 'group_'
|
||||
|
||||
json_level_id = 'levelId'
|
||||
json_list = 'JsonPiecesDataList'
|
||||
|
|
@ -89,6 +92,20 @@ def run(psd_path, levels_output_dir, thumbnail_output_dir):
|
|||
piece_list.append(piece_data)
|
||||
img_cur_item_layer = item_layer.composite()
|
||||
img_cur_item_layer.save(f"{titem_out_path}/{psd_name}_{item_layer.name}.png")
|
||||
|
||||
if layer.is_group() and group_name in layer.name:
|
||||
for child_layer in layer:
|
||||
piece_data = {}
|
||||
lt_x, lt_y = child_layer.offset
|
||||
c_w, c_h = child_layer.size
|
||||
c_x, c_y = lt_x + c_w / 2, lt_y + c_h / 2
|
||||
piece_data[json_x_pos] = c_x
|
||||
piece_data[json_y_pos] = c_y
|
||||
piece_data[json_name] = f'{psd_name}_{child_layer.name}'
|
||||
|
||||
img_cur_layer = child_layer.composite()
|
||||
img_cur_layer.save(f"{levels_output_dir}/{psd_name}_{child_layer.name}.png")
|
||||
piece_list.append(piece_data)
|
||||
if not layer.is_group():
|
||||
piece_data = {}
|
||||
lt_x, lt_y = layer.offset
|
||||
|
|
|
|||
Loading…
Reference in New Issue