Texture Utility Tool TUT
Vers 2.5unknown
python
14 days ago
152 kB
4
Indexable
# Form implementation generated from reading ui file 'daisy_9newui.ui'
#
# Created by: PyQt6 UI code generator 6.4.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
from PyQt6.QtWidgets import QFileDialog,QMainWindow
import os
import math
import PIL.Image
import numpy as np
from PIL import Image
################################################
############# parameters for dropdowns and default file locations
############################################
dropdown_options=['Targa (.TGA)', 'Web Picture (.WEBP)','PNG (.PNG)', 'JPEG (.JPEG)']
dropdown_endings=['.tga','.webp','.png','.jpeg','.jpg']
dropdown_filesize=['KB','MB','GB']
stored_images=[]
thumbnail_counter=0
thumbnail_current_loaded=0
dropdown_scale=['Increase Resolution','Reduce Resolution']
dropdown_resolutions_pick=['256','512','1024','2048','4096']
dropdown_resolutions_pick_view=['256 x 256','512 x 512','1024 x 1024','2048 x 2048','4096 x 4096']
file_path_to_script=os.path.dirname(os.path.abspath(__file__))
default_picture=str(str(file_path_to_script))+"/uv_empty.png"
daisy_icon=str(str(file_path_to_script))+"/daisy_icon.png"
stored_combiner_files=[0,0,0,0]
from pathlib import Path
save_file_path_split_comb=str(Path.home() / "Downloads")
game_engine_formats=['Unreal Engine Packed','Unity Universal Render Pipeline']
stored_engine_image_files=[0,0,0]
stored_engine_full_paths=[0,0,0]
#########
#variables for atlas
atlas_image_store=[0,0,0,0]
###############################################################
##this is tab 1 for file format saving and general ui stuff
#####################
class Ui_DaisyWindow(object):
def setupUi(self, DaisyWindow):
DaisyWindow.setObjectName("DaisyWindow")
DaisyWindow.resize(832, 452)
DaisyWindow.setStyleSheet("background-color:rgb(48, 48, 48)")
self.config_load_icons()
self.centralwidget = QtWidgets.QWidget(parent=DaisyWindow)
self.centralwidget.setObjectName("centralwidget")
self.tabs_functions = QtWidgets.QTabWidget(parent=self.centralwidget)
self.tabs_functions.setGeometry(QtCore.QRect(10, 50, 601, 331))
self.tabs_functions.setStyleSheet("QTabBar::tab {\n"
" background-color: rgb(82, 82, 82);\n"
" color:rgb(136, 136, 136);\n"
"font: 300 11pt \"Segoe UI\";\n"
" padding: 10px;\n"
" }\n"
"\n"
"QTabWidget::pane { \n"
"border:2px solid teal;\n"
" color: rgb(222, 235, 255);\n"
"}\n"
"\n"
"QTabBar::tab:selected { \n"
" font: 700 11pt \"Segoe UI\";\n"
" background-color: rgb(92, 92, 92);\n"
" color: white;\n"
"}")
self.tabs_functions.setObjectName("tabs_functions")
self.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.label_intro_convert_type = QtWidgets.QLabel(parent=self.tab)
self.label_intro_convert_type.setGeometry(QtCore.QRect(20, 40, 171, 16))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
font.setStrikeOut(False)
font.setKerning(True)
self.label_intro_convert_type.setFont(font)
self.label_intro_convert_type.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_intro_convert_type.setWordWrap(True)
self.label_intro_convert_type.setObjectName("label_intro_convert_type")
self.combo_file_types = QtWidgets.QComboBox(parent=self.tab)
self.combo_file_types.setGeometry(QtCore.QRect(20, 70, 171, 41))
self.combo_file_types.setStyleSheet("background-color: rgb(100, 100, 100);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.combo_file_types.setCurrentText("")
self.combo_file_types.setObjectName("combo_file_types")
self.combo_file_types.addItems(dropdown_options)
self.combo_file_types.currentIndexChanged.connect(self.file_size_getter)
self.spn_save_quality = QtWidgets.QSpinBox(parent=self.tab)
self.spn_save_quality.setGeometry(QtCore.QRect(470, 80, 101, 22))
self.spn_save_quality.setStyleSheet("background-color: rgb(36, 36, 36);\n"
"color:grey;")
self.spn_save_quality.setMinimum(10)
self.spn_save_quality.setMaximum(91)
self.spn_save_quality.setProperty("value", 82)
self.spn_save_quality.setObjectName("spn_save_quality")
self.box_optimise = QtWidgets.QCheckBox(parent=self.tab)
self.box_optimise.setGeometry(QtCore.QRect(210, 80, 131, 20))
font = QtGui.QFont()
font.setBold(True)
self.box_optimise.setFont(font)
self.box_optimise.setStyleSheet("color:white;")
self.box_optimise.setChecked(True)
self.box_optimise.setTristate(False)
self.box_optimise.setObjectName("box_optimise")
self.button_convert_loaded = QtWidgets.QPushButton(parent=self.tab)
self.button_convert_loaded.setGeometry(QtCore.QRect(200, 120, 371, 71))
font = QtGui.QFont()
font.setPointSize(13)
font.setBold(True)
self.button_convert_loaded.setFont(font)
self.button_convert_loaded.setStyleSheet("background-color:rgb(51, 101, 167);\n"
"color:white;")
self.button_convert_loaded.setObjectName("button_convert_loaded")
self.button_convert_loaded.clicked.connect(self.convert_files)
self.label_intro_convert_type_2 = QtWidgets.QLabel(parent=self.tab)
self.label_intro_convert_type_2.setGeometry(QtCore.QRect(360, 80, 101, 20))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
font.setStrikeOut(False)
font.setKerning(True)
self.label_intro_convert_type_2.setFont(font)
self.label_intro_convert_type_2.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_intro_convert_type_2.setWordWrap(True)
self.label_intro_convert_type_2.setObjectName("label_intro_convert_type_2")
self.label_intro_convert_type_5 = QtWidgets.QLabel(parent=self.tab)
self.label_intro_convert_type_5.setGeometry(QtCore.QRect(210, 30, 361, 21))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
font.setStrikeOut(False)
font.setKerning(True)
self.label_intro_convert_type_5.setFont(font)
self.label_intro_convert_type_5.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_intro_convert_type_5.setWordWrap(True)
self.label_intro_convert_type_5.setObjectName("label_intro_convert_type_5")
self.label_intro_convert_type_6 = QtWidgets.QLabel(parent=self.tab)
self.label_intro_convert_type_6.setGeometry(QtCore.QRect(20, 220, 551, 16))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
font.setStrikeOut(False)
font.setKerning(True)
self.label_intro_convert_type_6.setFont(font)
self.label_intro_convert_type_6.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_intro_convert_type_6.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_intro_convert_type_6.setWordWrap(True)
self.label_intro_convert_type_6.setObjectName("label_intro_convert_type_6")
self.label_intro_convert_type_7 = QtWidgets.QLabel(parent=self.tab)
self.label_intro_convert_type_7.setGeometry(QtCore.QRect(10, 250, 551, 16))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
font.setStrikeOut(False)
font.setKerning(True)
self.label_intro_convert_type_7.setFont(font)
self.label_intro_convert_type_7.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_intro_convert_type_7.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_intro_convert_type_7.setWordWrap(True)
self.label_intro_convert_type_7.setObjectName("label_intro_convert_type_7")
self.tabs_functions.addTab(self.tab, "")
###############################################################
##this is tab 2 - rescale
#####################
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
self.checkBox_only_scale_loaded = QtWidgets.QCheckBox(parent=self.tab_2)
self.checkBox_only_scale_loaded.setGeometry(QtCore.QRect(370, 100, 221, 20))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.checkBox_only_scale_loaded.setFont(font)
self.checkBox_only_scale_loaded.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.checkBox_only_scale_loaded.setObjectName("checkBox_only_scale_loaded")
self.label_current_resolution_rescaler = QtWidgets.QLabel(parent=self.tab_2)
self.label_current_resolution_rescaler.setGeometry(QtCore.QRect(20, 10, 341, 16))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
font.setStrikeOut(False)
font.setKerning(True)
self.label_current_resolution_rescaler.setFont(font)
self.label_current_resolution_rescaler.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_current_resolution_rescaler.setWordWrap(True)
self.label_current_resolution_rescaler.setObjectName("label_current_resolution_rescaler")
self.tabs_rescale_function = QtWidgets.QTabWidget(parent=self.tab_2)
self.tabs_rescale_function.setGeometry(QtCore.QRect(10, 30, 341, 241))
self.tabs_rescale_function.setStyleSheet("QTabBar::tab {\n"
" background-color: rgb(82, 82, 82);\n"
" color:rgb(136, 136, 136);\n"
"font: 300 8pt \"Segoe UI\";\n"
" padding: 6px;\n"
" }\n"
"\n"
"QTabWidget::pane { \n"
"border:2px solid grey;\n"
" color: rgb(222, 235, 255);\n"
"}\n"
"\n"
"QTabBar::tab:selected { \n"
" font: 700 8pt \"Segoe UI\";\n"
" background-color: rgb(92, 92, 92);\n"
" color: white;\n"
"}")
self.tabs_rescale_function.setTabShape(QtWidgets.QTabWidget.TabShape.Rounded)
self.tabs_rescale_function.setDocumentMode(False)
self.tabs_rescale_function.setObjectName("tabs_rescale_function")
self.set_scale_tab = QtWidgets.QWidget()
self.set_scale_tab.setObjectName("set_scale_tab")
self.combo_resolution_dropdown = QtWidgets.QComboBox(parent=self.set_scale_tab)
self.combo_resolution_dropdown.setGeometry(QtCore.QRect(20, 60, 301, 31))
self.combo_resolution_dropdown.setStyleSheet("background-color: rgb(65, 65, 65);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.combo_resolution_dropdown.setObjectName("combo_resolution_dropdown")
self.combo_resolution_dropdown.addItems(dropdown_resolutions_pick_view)
self.combo_resolution_dropdown.setCurrentIndex(2)
self.label_4 = QtWidgets.QLabel(parent=self.set_scale_tab)
self.label_4.setGeometry(QtCore.QRect(20, 30, 291, 20))
font = QtGui.QFont()
font.setBold(True)
self.label_4.setFont(font)
self.label_4.setStyleSheet("color:white;")
self.label_4.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_4.setObjectName("label_4")
self.tabs_rescale_function.addTab(self.set_scale_tab, "")
self.percent_tab = QtWidgets.QWidget()
self.percent_tab.setObjectName("percent_tab")
self.spinBox_rescale_percentage = QtWidgets.QSpinBox(parent=self.percent_tab)
self.spinBox_rescale_percentage.setGeometry(QtCore.QRect(100, 60, 81, 22))
self.spinBox_rescale_percentage.setStyleSheet("background-color: rgb(71, 71, 71);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.spinBox_rescale_percentage.setMinimum(1)
self.spinBox_rescale_percentage.setProperty("value", 50)
self.spinBox_rescale_percentage.setObjectName("spinBox_rescale_percentage")
self.checkBox_apply_to_width = QtWidgets.QCheckBox(parent=self.percent_tab)
self.checkBox_apply_to_width.setGeometry(QtCore.QRect(210, 100, 111, 20))
self.checkBox_apply_to_width.setStyleSheet("font: 300 9pt \"Segoe UI\";\n"
"color: white;")
self.checkBox_apply_to_width.setChecked(True)
self.checkBox_apply_to_width.setObjectName("checkBox_apply_to_width")
self.checkBox_apply_to_height = QtWidgets.QCheckBox(parent=self.percent_tab)
self.checkBox_apply_to_height.setGeometry(QtCore.QRect(210, 140, 111, 20))
self.checkBox_apply_to_height.setStyleSheet("font: 300 9pt \"Segoe UI\";\n"
"color: white;")
self.checkBox_apply_to_height.setChecked(True)
self.checkBox_apply_to_height.setObjectName("checkBox_apply_to_height")
self.label = QtWidgets.QLabel(parent=self.percent_tab)
self.label.setGeometry(QtCore.QRect(20, 60, 81, 21))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(True)
font.setItalic(False)
self.label.setFont(font)
self.label.setStyleSheet("font: 700 9pt \"Segoe UI\";\n"
"color: white;")
self.label.setObjectName("label")
self.combo_scale_up_or_down = QtWidgets.QComboBox(parent=self.percent_tab)
self.combo_scale_up_or_down.setGeometry(QtCore.QRect(20, 100, 161, 31))
self.combo_scale_up_or_down.setStyleSheet("background-color: rgb(65, 65, 65);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.combo_scale_up_or_down.setObjectName("combo_scale_up_or_down")
self.combo_scale_up_or_down.addItems(dropdown_scale)
self.combo_scale_up_or_down.setCurrentIndex(0)
self.label_intro_convert_type_4 = QtWidgets.QLabel(parent=self.percent_tab)
self.label_intro_convert_type_4.setGeometry(QtCore.QRect(210, 40, 111, 41))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(True)
font.setItalic(False)
font.setStrikeOut(False)
font.setKerning(True)
self.label_intro_convert_type_4.setFont(font)
self.label_intro_convert_type_4.setStyleSheet("font: 700 9pt \"Segoe UI\";\n"
"color: white;")
self.label_intro_convert_type_4.setWordWrap(True)
self.label_intro_convert_type_4.setObjectName("label_intro_convert_type_4")
self.tabs_rescale_function.addTab(self.percent_tab, "")
self.tab_3 = QtWidgets.QWidget()
self.tab_3.setObjectName("tab_3")
self.label_reuse_scale_option_text = QtWidgets.QLabel(parent=self.tab_3)
self.label_reuse_scale_option_text.setGeometry(QtCore.QRect(10, 30, 311, 141))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(True)
font.setItalic(False)
font.setStrikeOut(False)
font.setKerning(True)
self.label_reuse_scale_option_text.setFont(font)
self.label_reuse_scale_option_text.setStyleSheet("font: 900 9pt \"Segoe UI\";\n"
"color: white;")
self.label_reuse_scale_option_text.setFrameShape(QtWidgets.QFrame.Shape.NoFrame)
self.label_reuse_scale_option_text.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_reuse_scale_option_text.setWordWrap(True)
self.label_reuse_scale_option_text.setObjectName("label_reuse_scale_option_text")
self.tabs_rescale_function.addTab(self.tab_3, "")
self.Custom_Tab = QtWidgets.QWidget()
self.Custom_Tab.setObjectName("Custom_Tab")
self.spin_width_custom = QtWidgets.QSpinBox(parent=self.Custom_Tab)
self.spin_width_custom.setGeometry(QtCore.QRect(80, 60, 101, 22))
self.spin_width_custom.setStyleSheet("background-color: rgb(100, 100, 100);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.spin_width_custom.setObjectName("spin_width_custom")
self.spin_width_custom.setMaximum(2147483647)
self.spin_width_custom.setMinimum(200)
self.spin_height_custom = QtWidgets.QSpinBox(parent=self.Custom_Tab)
self.spin_height_custom.setGeometry(QtCore.QRect(80, 110, 101, 22))
self.spin_height_custom.setStyleSheet("background-color: rgb(100, 100, 100);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.spin_height_custom.setMaximum(2147483647)
self.spin_height_custom.setMinimum(200)
self.spin_height_custom.setObjectName("spin_height_custom")
self.label_2 = QtWidgets.QLabel(parent=self.Custom_Tab)
self.label_2.setGeometry(QtCore.QRect(10, 60, 61, 21))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.label_2.setFont(font)
self.label_2.setStyleSheet("font: 300 9pt \"Segoe UI\";\n"
"color: white;")
self.label_2.setObjectName("label_2")
self.label_3 = QtWidgets.QLabel(parent=self.Custom_Tab)
self.label_3.setGeometry(QtCore.QRect(10, 110, 61, 21))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.label_3.setFont(font)
self.label_3.setStyleSheet("font: 300 9pt \"Segoe UI\";\n"
"color: white;")
self.label_3.setObjectName("label_3")
self.button_autofill_custom_data = QtWidgets.QPushButton(parent=self.Custom_Tab)
self.button_autofill_custom_data.setGeometry(QtCore.QRect(190, 20, 141, 161))
self.button_autofill_custom_data.setStyleSheet("background-color:rgb(60, 60, 60);\n"
"color:white;\n"
"font: 800 9pt \"Segoe UI\";")
self.button_autofill_custom_data.setObjectName("button_autofill_custom_data")
self.button_autofill_custom_data.clicked.connect(self.fill_scale_info)
self.tabs_rescale_function.addTab(self.Custom_Tab, "")
self.checkBox_overwrite_rescale = QtWidgets.QCheckBox(parent=self.tab_2)
self.checkBox_overwrite_rescale.setGeometry(QtCore.QRect(370, 70, 211, 20))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.checkBox_overwrite_rescale.setFont(font)
self.checkBox_overwrite_rescale.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.checkBox_overwrite_rescale.setObjectName("checkBox_overwrite_rescale")
self.button_rescale_images = QtWidgets.QPushButton(parent=self.tab_2)
self.button_rescale_images.setGeometry(QtCore.QRect(360, 140, 231, 121))
font = QtGui.QFont()
font.setPointSize(13)
font.setBold(True)
self.button_rescale_images.setFont(font)
self.button_rescale_images.setStyleSheet("background-color:rgb(51, 101, 167);\n"
"color:white;")
self.button_rescale_images.setObjectName("button_rescale_images")
self.button_rescale_images.clicked.connect(self.rescale_func)
self.label_intro_convert_type_3 = QtWidgets.QLabel(parent=self.tab_2)
self.label_intro_convert_type_3.setGeometry(QtCore.QRect(370, 40, 171, 16))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(True)
font.setItalic(False)
font.setStrikeOut(False)
font.setKerning(True)
self.label_intro_convert_type_3.setFont(font)
self.label_intro_convert_type_3.setStyleSheet("font: 700 9pt \"Segoe UI\";\n"
"color: white;")
self.label_intro_convert_type_3.setWordWrap(True)
self.label_intro_convert_type_3.setObjectName("label_intro_convert_type_3")
self.tabs_functions.addTab(self.tab_2, "")
self.tab_splitter_combiner = QtWidgets.QWidget()
self.tab_splitter_combiner.setObjectName("tab_splitter_combiner")
self.frame_5 = QtWidgets.QFrame(parent=self.tab_splitter_combiner)
self.frame_5.setGeometry(QtCore.QRect(0, 0, 151, 151))
self.frame_5.setStyleSheet("background-color: rgb(255, 0, 4);")
self.frame_5.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_5.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_5.setObjectName("frame_5")
self.channel_thumb_combiner_red = QtWidgets.QLabel(parent=self.frame_5)
self.channel_thumb_combiner_red.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.channel_thumb_combiner_red.setFont(font)
self.channel_thumb_combiner_red.setAutoFillBackground(False)
self.channel_thumb_combiner_red.setText("")
self.channel_thumb_combiner_red.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_combiner_red.setScaledContents(True)
self.channel_thumb_combiner_red.setObjectName("channel_thumb_combiner_red")
self.frame_6 = QtWidgets.QFrame(parent=self.tab_splitter_combiner)
self.frame_6.setGeometry(QtCore.QRect(150, 0, 151, 151))
self.frame_6.setStyleSheet("background-color: rgb(0, 168, 53)")
self.frame_6.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_6.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_6.setObjectName("frame_6")
self.channel_thumb_combiner_green = QtWidgets.QLabel(parent=self.frame_6)
self.channel_thumb_combiner_green.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.channel_thumb_combiner_green.setFont(font)
self.channel_thumb_combiner_green.setAutoFillBackground(False)
self.channel_thumb_combiner_green.setText("")
self.channel_thumb_combiner_green.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_combiner_green.setScaledContents(True)
self.channel_thumb_combiner_green.setObjectName("channel_thumb_combiner_green")
self.frame_8 = QtWidgets.QFrame(parent=self.tab_splitter_combiner)
self.frame_8.setGeometry(QtCore.QRect(300, 0, 151, 151))
self.frame_8.setStyleSheet("background-color: rgb(0, 148, 240)")
self.frame_8.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_8.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_8.setObjectName("frame_8")
self.channel_thumb_combiner_blue = QtWidgets.QLabel(parent=self.frame_8)
self.channel_thumb_combiner_blue.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.channel_thumb_combiner_blue.setFont(font)
self.channel_thumb_combiner_blue.setAutoFillBackground(False)
self.channel_thumb_combiner_blue.setText("")
self.channel_thumb_combiner_blue.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_combiner_blue.setScaledContents(True)
self.channel_thumb_combiner_blue.setObjectName("channel_thumb_combiner_blue")
self.frame_9 = QtWidgets.QFrame(parent=self.tab_splitter_combiner)
self.frame_9.setGeometry(QtCore.QRect(450, 0, 151, 151))
self.frame_9.setStyleSheet("background-color: rgb(65, 65, 65)")
self.frame_9.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_9.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_9.setObjectName("frame_9")
self.channel_thumb_combiner_alpha = QtWidgets.QLabel(parent=self.frame_9)
self.channel_thumb_combiner_alpha.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.channel_thumb_combiner_alpha.setFont(font)
self.channel_thumb_combiner_alpha.setAutoFillBackground(False)
self.channel_thumb_combiner_alpha.setText("")
self.channel_thumb_combiner_alpha.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_combiner_alpha.setScaledContents(True)
self.channel_thumb_combiner_alpha.setObjectName("channel_thumb_combiner_alpha")
self.combobox_save_files_combiner = QtWidgets.QComboBox(parent=self.tab_splitter_combiner)
self.combobox_save_files_combiner.setGeometry(QtCore.QRect(30, 240, 121, 22))
self.combobox_save_files_combiner.setStyleSheet("background-color: rgb(71, 71, 71);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.combobox_save_files_combiner.setObjectName("combobox_save_files_combiner")
self.combobox_save_files_combiner.addItems(dropdown_options)
self.combobox_save_files_combiner.setCurrentIndex(2)
self.label_11 = QtWidgets.QLabel(parent=self.tab_splitter_combiner)
self.label_11.setGeometry(QtCore.QRect(10, 220, 161, 16))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.label_11.setFont(font)
self.label_11.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_11.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_11.setObjectName("label_11")
self.button_combine_final = QtWidgets.QPushButton(parent=self.tab_splitter_combiner)
self.button_combine_final.setGeometry(QtCore.QRect(340, 210, 251, 71))
font = QtGui.QFont()
font.setPointSize(13)
font.setBold(True)
font.setUnderline(False)
self.button_combine_final.setFont(font)
self.button_combine_final.setStyleSheet("background-color:rgb(51, 101, 167);\n"
"color:white;")
self.button_combine_final.setObjectName("button_combine_final")
self.button_combine_final.clicked.connect(self.final_file_combiner)
self.spin_combiner_export_width = QtWidgets.QSpinBox(parent=self.tab_splitter_combiner)
self.spin_combiner_export_width.setGeometry(QtCore.QRect(180, 240, 71, 22))
self.spin_combiner_export_width.setStyleSheet("background-color: rgb(71, 71, 71);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.spin_combiner_export_width.setMinimum(512)
self.spin_combiner_export_width.setMaximum(2000000000)
self.spin_combiner_export_width.setProperty("value", 1024)
self.spin_combiner_export_width.setObjectName("spin_combiner_export_width")
self.label_expor_size_combiner = QtWidgets.QLabel(parent=self.tab_splitter_combiner)
self.label_expor_size_combiner.setGeometry(QtCore.QRect(170, 220, 161, 16))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.label_expor_size_combiner.setFont(font)
self.label_expor_size_combiner.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_expor_size_combiner.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_expor_size_combiner.setObjectName("label_expor_size_combiner")
self.spin_combiner_export_height = QtWidgets.QSpinBox(parent=self.tab_splitter_combiner)
self.spin_combiner_export_height.setGeometry(QtCore.QRect(260, 240, 71, 22))
self.spin_combiner_export_height.setStyleSheet("background-color: rgb(71, 71, 71);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.spin_combiner_export_height.setMinimum(512)
self.spin_combiner_export_height.setMaximum(2000000000)
self.spin_combiner_export_height.setProperty("value", 1024)
self.spin_combiner_export_height.setObjectName("spin_combiner_export_height")
self.button_clear_red_channel = QtWidgets.QPushButton(parent=self.tab_splitter_combiner)
self.button_clear_red_channel.setGeometry(QtCore.QRect(10, 180, 131, 20))
self.button_clear_red_channel.setStyleSheet("background-color:rgb(77, 77, 77);\n"
"color:white;\n"
"")
self.button_clear_red_channel.setObjectName("button_clear_red_channel")
self.button_load_red_channel = QtWidgets.QPushButton(parent=self.tab_splitter_combiner)
self.button_load_red_channel.setGeometry(QtCore.QRect(10, 160, 131, 21))
self.button_load_red_channel.setStyleSheet("background-color: rgb(99, 99, 99);\n"
"color:white;\n"
"")
self.button_load_red_channel.setObjectName("button_load_red_channel")
self.button_load_red_channel.clicked.connect(lambda: self.combine_load_images(color_image="Red",clear_mode="Load"))
self.button_clear_red_channel.clicked.connect(lambda: self.combine_load_images(color_image="Red",clear_mode="Clear"))
self.button_clear_green_channel = QtWidgets.QPushButton(parent=self.tab_splitter_combiner)
self.button_clear_green_channel.setGeometry(QtCore.QRect(160, 180, 131, 20))
self.button_clear_green_channel.setStyleSheet("background-color:rgb(77, 77, 77);\n"
"color:white;\n"
"")
self.button_clear_green_channel.setObjectName("button_clear_green_channel")
self.button_load_green_channel = QtWidgets.QPushButton(parent=self.tab_splitter_combiner)
self.button_load_green_channel.setGeometry(QtCore.QRect(160, 160, 131, 21))
self.button_load_green_channel.setStyleSheet("background-color: rgb(99, 99, 99);\n"
"color:white;\n"
"")
self.button_load_green_channel.setObjectName("button_load_green_channel")
self.button_load_green_channel.clicked.connect(lambda: self.combine_load_images(color_image="Green",clear_mode="Load"))
self.button_clear_green_channel.clicked.connect(lambda: self.combine_load_images(color_image="Green",clear_mode="Clear"))
self.button_clear_blue_channel = QtWidgets.QPushButton(parent=self.tab_splitter_combiner)
self.button_clear_blue_channel.setGeometry(QtCore.QRect(310, 180, 131, 20))
self.button_clear_blue_channel.setStyleSheet("background-color:rgb(77, 77, 77);\n"
"color:white;\n"
"")
self.button_clear_blue_channel.setObjectName("button_clear_blue_channel")
self.button_load_blue_channel = QtWidgets.QPushButton(parent=self.tab_splitter_combiner)
self.button_load_blue_channel.setGeometry(QtCore.QRect(310, 160, 131, 21))
self.button_load_blue_channel.setStyleSheet("background-color: rgb(99, 99, 99);\n"
"color:white;\n"
"")
self.button_load_blue_channel.clicked.connect(lambda: self.combine_load_images(color_image="Blue",clear_mode="Load"))
self.button_clear_blue_channel.clicked.connect(lambda: self.combine_load_images(color_image="Blue",clear_mode="Clear"))
self.button_load_blue_channel.setObjectName("button_load_blue_channel")
self.button_clear_alpha_channel = QtWidgets.QPushButton(parent=self.tab_splitter_combiner)
self.button_clear_alpha_channel.setGeometry(QtCore.QRect(460, 180, 131, 20))
self.button_clear_alpha_channel.setStyleSheet("background-color:rgb(77, 77, 77);\n"
"color:white;\n"
"")
self.button_clear_alpha_channel.setObjectName("button_clear_alpha_channel")
self.button_load_alpha_channel = QtWidgets.QPushButton(parent=self.tab_splitter_combiner)
self.button_load_alpha_channel.setGeometry(QtCore.QRect(460, 160, 131, 21))
self.button_load_alpha_channel.setStyleSheet("background-color: rgb(99, 99, 99);\n"
"color:white;\n"
"")
self.button_load_alpha_channel.setObjectName("button_load_alpha_channel")
self.button_load_alpha_channel.clicked.connect(lambda: self.combine_load_images(color_image="Alpha",clear_mode="Load"))
self.button_clear_alpha_channel.clicked.connect(lambda: self.combine_load_images(color_image="Alpha",clear_mode="Clear"))
self.tabs_functions.addTab(self.tab_splitter_combiner, "")
self.tab_4 = QtWidgets.QWidget()
self.tab_4.setObjectName("tab_4")
self.button_split_channels = QtWidgets.QPushButton(parent=self.tab_4)
self.button_split_channels.setGeometry(QtCore.QRect(340, 210, 251, 31))
font = QtGui.QFont()
font.setPointSize(13)
font.setBold(True)
font.setUnderline(False)
self.button_split_channels.setFont(font)
self.button_split_channels.setStyleSheet("background-color:rgb(51, 101, 167);\n"
"color:white;")
self.button_split_channels.setObjectName("button_split_channels")
self.button_split_channels.clicked.connect(lambda: self.splitting_maps(delete_stat=True))
self.frame_10 = QtWidgets.QFrame(parent=self.tab_4)
self.frame_10.setGeometry(QtCore.QRect(300, 0, 151, 151))
self.frame_10.setStyleSheet("background-color: rgb(0, 148, 240)")
self.frame_10.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_10.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_10.setObjectName("frame_10")
self.channel_thumb_splitter_blue = QtWidgets.QLabel(parent=self.frame_10)
self.channel_thumb_splitter_blue.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.channel_thumb_splitter_blue.setFont(font)
self.channel_thumb_splitter_blue.setAutoFillBackground(False)
self.channel_thumb_splitter_blue.setText("")
self.channel_thumb_splitter_blue.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_splitter_blue.setScaledContents(True)
self.channel_thumb_splitter_blue.setObjectName("channel_thumb_splitter_blue")
self.label_12 = QtWidgets.QLabel(parent=self.tab_4)
self.label_12.setGeometry(QtCore.QRect(10, 220, 161, 16))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.label_12.setFont(font)
self.label_12.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_12.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_12.setObjectName("label_12")
self.frame_11 = QtWidgets.QFrame(parent=self.tab_4)
self.frame_11.setGeometry(QtCore.QRect(150, 0, 151, 151))
self.frame_11.setStyleSheet("background-color: rgb(0, 168, 53)")
self.frame_11.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_11.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_11.setObjectName("frame_11")
self.channel_thumb_splitter_green = QtWidgets.QLabel(parent=self.frame_11)
self.channel_thumb_splitter_green.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.channel_thumb_splitter_green.setFont(font)
self.channel_thumb_splitter_green.setAutoFillBackground(False)
self.channel_thumb_splitter_green.setText("")
self.channel_thumb_splitter_green.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_splitter_green.setScaledContents(True)
self.channel_thumb_splitter_green.setObjectName("channel_thumb_splitter_green")
self.frame_12 = QtWidgets.QFrame(parent=self.tab_4)
self.frame_12.setGeometry(QtCore.QRect(0, 0, 151, 151))
self.frame_12.setStyleSheet("background-color: rgb(255, 0, 4);")
self.frame_12.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_12.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_12.setObjectName("frame_12")
self.channel_thumb_splitter_red = QtWidgets.QLabel(parent=self.frame_12)
self.channel_thumb_splitter_red.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.channel_thumb_splitter_red.setFont(font)
self.channel_thumb_splitter_red.setAutoFillBackground(False)
self.channel_thumb_splitter_red.setText("")
self.channel_thumb_splitter_red.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_splitter_red.setScaledContents(True)
self.channel_thumb_splitter_red.setObjectName("channel_thumb_splitter_red")
self.combobox_save_files_splitter = QtWidgets.QComboBox(parent=self.tab_4)
self.combobox_save_files_splitter.setGeometry(QtCore.QRect(30, 240, 121, 22))
self.combobox_save_files_splitter.setStyleSheet("background-color: rgb(71, 71, 71);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.combobox_save_files_splitter.setObjectName("combobox_save_files_splitter")
self.combobox_save_files_splitter.addItems(dropdown_options)
self.combobox_save_files_splitter.setCurrentIndex(2)
self.frame_13 = QtWidgets.QFrame(parent=self.tab_4)
self.frame_13.setGeometry(QtCore.QRect(450, 0, 151, 151))
self.frame_13.setStyleSheet("background-color: rgb(57, 57, 57)")
self.frame_13.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_13.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_13.setObjectName("frame_13")
self.channel_thumb_splitter_alpha = QtWidgets.QLabel(parent=self.frame_13)
self.channel_thumb_splitter_alpha.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.channel_thumb_splitter_alpha.setFont(font)
self.channel_thumb_splitter_alpha.setAutoFillBackground(False)
self.channel_thumb_splitter_alpha.setText("")
self.channel_thumb_splitter_alpha.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_splitter_alpha.setScaledContents(True)
self.channel_thumb_splitter_alpha.setObjectName("channel_thumb_splitter_alpha")
self.button_clear_images_splitter = QtWidgets.QPushButton(parent=self.tab_4)
self.button_clear_images_splitter.setGeometry(QtCore.QRect(340, 250, 251, 31))
font = QtGui.QFont()
font.setPointSize(13)
font.setBold(True)
font.setUnderline(False)
self.button_clear_images_splitter.setFont(font)
self.button_clear_images_splitter.setStyleSheet("background-color:rgb(31, 61, 100);\n"
"color:white;")
self.button_clear_images_splitter.setObjectName("button_clear_images_splitter")
self.button_clear_images_splitter.clicked.connect(lambda: self.splitting_maps(delete_stat=False))
self.spin_splitter_export_width = QtWidgets.QSpinBox(parent=self.tab_4)
self.spin_splitter_export_width.setGeometry(QtCore.QRect(180, 240, 71, 22))
self.spin_splitter_export_width.setStyleSheet("background-color: rgb(71, 71, 71);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.spin_splitter_export_width.setMinimum(512)
self.spin_splitter_export_width.setMaximum(2000000000)
self.spin_splitter_export_width.setProperty("value", 1024)
self.spin_splitter_export_width.setObjectName("spin_splitter_export_width")
self.spin_splitter_export_height = QtWidgets.QSpinBox(parent=self.tab_4)
self.spin_splitter_export_height.setGeometry(QtCore.QRect(260, 240, 71, 22))
self.spin_splitter_export_height.setStyleSheet("background-color: rgb(71, 71, 71);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.spin_splitter_export_height.setMinimum(512)
self.spin_splitter_export_height.setMaximum(2000000000)
self.spin_splitter_export_height.setProperty("value", 1024)
self.spin_splitter_export_height.setObjectName("spin_splitter_export_height")
self.label_expor_size_splitter = QtWidgets.QLabel(parent=self.tab_4)
self.label_expor_size_splitter.setGeometry(QtCore.QRect(170, 220, 161, 16))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.label_expor_size_splitter.setFont(font)
self.label_expor_size_splitter.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_expor_size_splitter.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_expor_size_splitter.setObjectName("label_expor_size_splitter")
self.chbox_red_channel = QtWidgets.QCheckBox(parent=self.tab_4)
self.chbox_red_channel.setGeometry(QtCore.QRect(10, 170, 131, 21))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.chbox_red_channel.setFont(font)
self.chbox_red_channel.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.chbox_red_channel.setObjectName("chbox_red_channel")
self.chbox_red_channel.setChecked(True)
self.chbox_green_channel = QtWidgets.QCheckBox(parent=self.tab_4)
self.chbox_green_channel.setGeometry(QtCore.QRect(160, 170, 131, 21))
self.chbox_green_channel.setChecked(True)
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.chbox_green_channel.setFont(font)
self.chbox_green_channel.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.chbox_green_channel.setObjectName("chbox_green_channel")
self.chbox_blue_channel = QtWidgets.QCheckBox(parent=self.tab_4)
self.chbox_blue_channel.setGeometry(QtCore.QRect(310, 170, 131, 21))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.chbox_blue_channel.setFont(font)
self.chbox_blue_channel.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.chbox_blue_channel.setChecked(True)
self.chbox_blue_channel.setObjectName("chbox_blue_channel")
self.chbox_alpha_channel = QtWidgets.QCheckBox(parent=self.tab_4)
self.chbox_alpha_channel.setGeometry(QtCore.QRect(460, 170, 131, 21))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.chbox_alpha_channel.setFont(font)
self.chbox_alpha_channel.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.chbox_alpha_channel.setObjectName("chbox_alpha_channel")
self.tabs_functions.addTab(self.tab_4, "")
#### atlas and engine remapper tab
self.tab_5 = QtWidgets.QWidget()
self.tab_5.setObjectName("tab_5")
self.cb_from_maps = QtWidgets.QComboBox(parent=self.tab_5)
self.cb_from_maps.setGeometry(QtCore.QRect(20, 250, 151, 21))
self.cb_from_maps.setStyleSheet("background-color: rgb(60, 60, 60);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.cb_from_maps.addItems(game_engine_formats)
self.cb_from_maps.setCurrentIndex(1)
self.cb_from_maps.setObjectName("cb_from_maps")
self.cb_for_maps = QtWidgets.QComboBox(parent=self.tab_5)
self.cb_for_maps.setGeometry(QtCore.QRect(210, 250, 151, 21))
self.cb_for_maps.setStyleSheet("background-color: rgb(80, 80, 80);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.cb_for_maps.addItems(game_engine_formats)
self.cb_for_maps.setCurrentIndex(0)
self.cb_for_maps.setObjectName("cb_for_maps")
self.label_5 = QtWidgets.QLabel(parent=self.tab_5)
self.label_5.setGeometry(QtCore.QRect(20, 231, 121, 20))
self.label_5.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_5.setObjectName("label_5")
self.label_6 = QtWidgets.QLabel(parent=self.tab_5)
self.label_6.setGeometry(QtCore.QRect(210, 231, 121, 20))
self.label_6.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_6.setObjectName("label_6")
self.button_load_ambient_occlusion = QtWidgets.QPushButton(parent=self.tab_5)
self.button_load_ambient_occlusion.setGeometry(QtCore.QRect(400, 190, 171, 31))
self.button_load_ambient_occlusion.setStyleSheet("background-color: rgb(99, 99, 99);\n"
"color:white;\n"
"")
self.button_load_ambient_occlusion.setObjectName("button_load_ambient_occlusion")
self.button_load_ambient_occlusion.clicked.connect(lambda: self.just_load_engine_maps(map_type="AO"))
self.frame_7 = QtWidgets.QFrame(parent=self.tab_5)
self.frame_7.setGeometry(QtCore.QRect(210, 10, 171, 171))
self.frame_7.setStyleSheet("background-color: rgb(87, 87, 87)")
self.frame_7.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_7.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_7.setObjectName("frame_7")
self.image_normal_map = QtWidgets.QLabel(parent=self.frame_7)
self.image_normal_map.setGeometry(QtCore.QRect(10, 10, 151, 151))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.image_normal_map.setFont(font)
self.image_normal_map.setAutoFillBackground(False)
self.image_normal_map.setText("")
self.image_normal_map.setPixmap(QtGui.QPixmap(default_picture))
self.image_normal_map.setScaledContents(True)
self.image_normal_map.setObjectName("image_normal_map")
self.button_load_packed = QtWidgets.QPushButton(parent=self.tab_5)
self.button_load_packed.setGeometry(QtCore.QRect(20, 190, 171, 31))
self.button_load_packed.setStyleSheet("background-color: rgb(99, 99, 99);\n"
"color:white;\n"
"")
self.button_load_packed.setObjectName("button_load_packed")
self.button_load_packed.clicked.connect(lambda: self.just_load_engine_maps(map_type="Channel Packed"))
self.button_load_normals = QtWidgets.QPushButton(parent=self.tab_5)
self.button_load_normals.setGeometry(QtCore.QRect(210, 190, 171, 31))
self.button_load_normals.setStyleSheet("background-color: rgb(99, 99, 99);\n"
"color:white;\n"
"")
self.button_load_normals.setObjectName("button_load_normals")
self.button_load_normals.clicked.connect(lambda: self.just_load_engine_maps(map_type="Normals"))
self.frame_14 = QtWidgets.QFrame(parent=self.tab_5)
self.frame_14.setGeometry(QtCore.QRect(20, 10, 171, 171))
self.frame_14.setStyleSheet("background-color: rgb(87, 87, 87)")
self.frame_14.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_14.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_14.setObjectName("frame_14")
self.image_packed_map = QtWidgets.QLabel(parent=self.frame_14)
self.image_packed_map.setGeometry(QtCore.QRect(10, 10, 151, 151))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.image_packed_map.setFont(font)
self.image_packed_map.setAutoFillBackground(False)
self.image_packed_map.setText("")
self.image_packed_map.setPixmap(QtGui.QPixmap(default_picture))
self.image_packed_map.setScaledContents(True)
self.image_packed_map.setObjectName("image_packed_map")
self.frame_15 = QtWidgets.QFrame(parent=self.tab_5)
self.frame_15.setGeometry(QtCore.QRect(400, 10, 171, 171))
self.frame_15.setStyleSheet("background-color: rgb(87, 87, 87)")
self.frame_15.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_15.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_15.setObjectName("frame_15")
self.image_ambient_occlusion = QtWidgets.QLabel(parent=self.frame_15)
self.image_ambient_occlusion.setGeometry(QtCore.QRect(10, 10, 151, 151))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.image_ambient_occlusion.setFont(font)
self.image_ambient_occlusion.setAutoFillBackground(False)
self.image_ambient_occlusion.setText("")
self.image_ambient_occlusion.setPixmap(QtGui.QPixmap(default_picture))
self.image_ambient_occlusion.setScaledContents(True)
self.image_ambient_occlusion.setObjectName("image_ambient_occlusion")
self.button_convert_engine_maps = QtWidgets.QPushButton(parent=self.tab_5)
self.button_convert_engine_maps.setGeometry(QtCore.QRect(390, 230, 191, 51))
font = QtGui.QFont()
font.setPointSize(13)
font.setBold(True)
font.setUnderline(False)
self.button_convert_engine_maps.setFont(font)
self.button_convert_engine_maps.setStyleSheet("background-color:rgb(51, 101, 167);\n"
"color:white;")
self.button_convert_engine_maps.setObjectName("button_convert_engine_maps")
self.button_convert_engine_maps.clicked.connect(lambda: self.convert_engine_files())
self.tabs_functions.addTab(self.tab_5, "")
self.tab_6 = QtWidgets.QWidget()
self.tab_6.setObjectName("tab_6")
self.frame_16 = QtWidgets.QFrame(parent=self.tab_6)
self.frame_16.setGeometry(QtCore.QRect(300, 0, 151, 151))
self.frame_16.setStyleSheet("background-color: rgb(0, 148, 240)")
self.frame_16.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_16.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_16.setObjectName("frame_16")
self.ch_atlas_image_3 = QtWidgets.QLabel(parent=self.frame_16)
self.ch_atlas_image_3.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.ch_atlas_image_3.setFont(font)
self.ch_atlas_image_3.setAutoFillBackground(False)
self.ch_atlas_image_3.setText("")
self.ch_atlas_image_3.setPixmap(QtGui.QPixmap(default_picture))
self.ch_atlas_image_3.setScaledContents(True)
self.ch_atlas_image_3.setObjectName("ch_atlas_image_3")
self.frame_17 = QtWidgets.QFrame(parent=self.tab_6)
self.frame_17.setGeometry(QtCore.QRect(0, 0, 151, 151))
self.frame_17.setStyleSheet("background-color: rgb(255, 0, 4);")
self.frame_17.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_17.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_17.setObjectName("frame_17")
self.ch_atlas_image_1 = QtWidgets.QLabel(parent=self.frame_17)
self.ch_atlas_image_1.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.ch_atlas_image_1.setFont(font)
self.ch_atlas_image_1.setAutoFillBackground(False)
self.ch_atlas_image_1.setText("")
self.ch_atlas_image_1.setPixmap(QtGui.QPixmap(default_picture))
self.ch_atlas_image_1.setScaledContents(True)
self.ch_atlas_image_1.setObjectName("ch_atlas_image_1")
self.frame_18 = QtWidgets.QFrame(parent=self.tab_6)
self.frame_18.setGeometry(QtCore.QRect(450, 0, 151, 151))
self.frame_18.setStyleSheet("background-color: rgb(60, 60, 60)")
self.frame_18.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_18.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_18.setObjectName("frame_18")
self.ch_atlas_image_4 = QtWidgets.QLabel(parent=self.frame_18)
self.ch_atlas_image_4.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.ch_atlas_image_4.setFont(font)
self.ch_atlas_image_4.setAutoFillBackground(False)
self.ch_atlas_image_4.setText("")
self.ch_atlas_image_4.setPixmap(QtGui.QPixmap(default_picture))
self.ch_atlas_image_4.setScaledContents(True)
self.ch_atlas_image_4.setObjectName("ch_atlas_image_4")
self.frame_19 = QtWidgets.QFrame(parent=self.tab_6)
self.frame_19.setGeometry(QtCore.QRect(150, 0, 151, 151))
self.frame_19.setStyleSheet("background-color: rgb(0, 168, 53)")
self.frame_19.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_19.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_19.setObjectName("frame_19")
self.ch_atlas_image_2 = QtWidgets.QLabel(parent=self.frame_19)
self.ch_atlas_image_2.setGeometry(QtCore.QRect(10, 10, 131, 131))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.ch_atlas_image_2.setFont(font)
self.ch_atlas_image_2.setAutoFillBackground(False)
self.ch_atlas_image_2.setText("")
self.ch_atlas_image_2.setPixmap(QtGui.QPixmap(default_picture))
self.ch_atlas_image_2.setScaledContents(True)
self.ch_atlas_image_2.setObjectName("ch_atlas_image_2")
self.frame_20 = QtWidgets.QFrame(parent=self.tab_6)
self.frame_20.setGeometry(QtCore.QRect(10, 200, 31, 31))
self.frame_20.setStyleSheet("background-color: rgb(255, 0, 4);")
self.frame_20.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_20.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_20.setObjectName("frame_20")
self.frame_21 = QtWidgets.QFrame(parent=self.tab_6)
self.frame_21.setGeometry(QtCore.QRect(50, 200, 31, 31))
self.frame_21.setStyleSheet("background-color: rgb(0, 168, 53);")
self.frame_21.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_21.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_21.setObjectName("frame_21")
self.label_8 = QtWidgets.QLabel(parent=self.frame_21)
self.label_8.setGeometry(QtCore.QRect(0, 0, 31, 31))
self.label_8.setStyleSheet("font: 600 9pt \"Segoe UI\";\n"
"color: white;\n"
"background-color:none;")
self.label_8.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_8.setObjectName("label_8")
self.frame_22 = QtWidgets.QFrame(parent=self.tab_6)
self.frame_22.setGeometry(QtCore.QRect(10, 240, 31, 31))
self.frame_22.setStyleSheet("background-color: rgb(0, 148, 240)")
self.frame_22.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_22.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_22.setObjectName("frame_22")
self.label_13 = QtWidgets.QLabel(parent=self.frame_22)
self.label_13.setGeometry(QtCore.QRect(0, 0, 31, 31))
self.label_13.setStyleSheet("font: 600 9pt \"Segoe UI\";\n"
"color: white;\n"
"background-color:none;")
self.label_13.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_13.setObjectName("label_13")
self.frame_23 = QtWidgets.QFrame(parent=self.tab_6)
self.frame_23.setGeometry(QtCore.QRect(50, 240, 31, 31))
self.frame_23.setStyleSheet("background-color: rgb(60, 60, 60);")
self.frame_23.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_23.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_23.setObjectName("frame_23")
self.label_14 = QtWidgets.QLabel(parent=self.frame_23)
self.label_14.setGeometry(QtCore.QRect(0, 0, 31, 31))
self.label_14.setStyleSheet("font: 600 9pt \"Segoe UI\";\n"
"color: white;\n"
"background-color:none;")
self.label_14.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_14.setObjectName("label_14")
self.button_load_atlas_1 = QtWidgets.QPushButton(parent=self.tab_6)
self.button_load_atlas_1.setGeometry(QtCore.QRect(10, 160, 131, 21))
self.button_load_atlas_1.setStyleSheet("background-color: rgb(99, 99, 99);\n"
"color:white;\n"
"")
self.button_load_atlas_1.setObjectName("button_load_atlas_1")
self.button_load_atlas_1.clicked.connect(lambda: self.atlas_packer(operation_mode="Thumbnail",thumb_channel="Red"))
self.button_load_atlas_2 = QtWidgets.QPushButton(parent=self.tab_6)
self.button_load_atlas_2.setGeometry(QtCore.QRect(160, 160, 131, 21))
self.button_load_atlas_2.setStyleSheet("background-color: rgb(70, 70, 70);\n"
"color:white;\n"
"")
self.button_load_atlas_2.setObjectName("button_load_atlas_2")
self.button_load_atlas_2.clicked.connect(lambda: self.atlas_packer(operation_mode="Thumbnail",thumb_channel="Green"))
self.button_load_atlas_3 = QtWidgets.QPushButton(parent=self.tab_6)
self.button_load_atlas_3.setGeometry(QtCore.QRect(310, 160, 131, 21))
self.button_load_atlas_3.setStyleSheet("background-color: rgb(99, 99, 99);\n"
"color:white;\n"
"")
self.button_load_atlas_3.setObjectName("button_load_atlas_3")
self.button_load_atlas_4 = QtWidgets.QPushButton(parent=self.tab_6)
self.button_load_atlas_4.setGeometry(QtCore.QRect(460, 160, 131, 21))
self.button_load_atlas_3.clicked.connect(lambda: self.atlas_packer(operation_mode="Thumbnail",thumb_channel="Blue"))
self.button_load_atlas_4.setStyleSheet("background-color: rgb(70, 70, 70);\n"
"color:white;\n"
"")
self.button_load_atlas_4.setObjectName("button_load_atlas_4")
self.button_load_atlas_4.clicked.connect(lambda: self.atlas_packer(operation_mode="Thumbnail",thumb_channel="Alpha"))
self.label_7 = QtWidgets.QLabel(parent=self.tab_6)
self.label_7.setGeometry(QtCore.QRect(10, 200, 31, 31))
self.label_7.setStyleSheet("font: 600 9pt \"Segoe UI\";\n"
"color: white;\n"
"background-color:none;")
self.label_7.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_7.setObjectName("label_7")
self.button_create_texture_atlas = QtWidgets.QPushButton(parent=self.tab_6)
self.button_create_texture_atlas.setGeometry(QtCore.QRect(290, 200, 291, 71))
font = QtGui.QFont()
font.setPointSize(13)
font.setBold(True)
font.setUnderline(False)
self.button_create_texture_atlas.setFont(font)
self.button_create_texture_atlas.clicked.connect(lambda: self.atlas_packer(operation_mode="Atlasing",thumb_channel="All"))
self.button_create_texture_atlas.setStyleSheet("background-color:rgb(51, 101, 167);\n"
"color:white;")
self.button_create_texture_atlas.setObjectName("button_create_texture_atlas")
self.spin_export_atlas_y = QtWidgets.QSpinBox(parent=self.tab_6)
self.spin_export_atlas_y.setGeometry(QtCore.QRect(190, 250, 71, 22))
self.spin_export_atlas_y.setStyleSheet("background-color: rgb(71, 71, 71);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.spin_export_atlas_y.setMinimum(512)
self.spin_export_atlas_y.setMaximum(2000000000)
self.spin_export_atlas_y.setProperty("value", 1024)
self.spin_export_atlas_y.setObjectName("spin_export_atlas_y")
self.label_expor_size_splitter_2 = QtWidgets.QLabel(parent=self.tab_6)
self.label_expor_size_splitter_2.setGeometry(QtCore.QRect(100, 230, 161, 16))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.label_expor_size_splitter_2.setFont(font)
self.label_expor_size_splitter_2.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_expor_size_splitter_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_expor_size_splitter_2.setObjectName("label_expor_size_splitter_2")
self.spin_export_atlas_x = QtWidgets.QSpinBox(parent=self.tab_6)
self.spin_export_atlas_x.setGeometry(QtCore.QRect(110, 250, 71, 22))
self.spin_export_atlas_x.setStyleSheet("background-color: rgb(71, 71, 71);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.spin_export_atlas_x.setMinimum(512)
self.spin_export_atlas_x.setMaximum(2000000000)
self.spin_export_atlas_x.setProperty("value", 1024)
self.spin_export_atlas_x.setObjectName("spin_export_atlas_x")
self.tabs_functions.addTab(self.tab_6, "")
self.label_atlas_save_format = QtWidgets.QLabel(parent=self.tab_6)
self.label_atlas_save_format.setGeometry(QtCore.QRect(100, 200, 91, 21))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.label_atlas_save_format.setFont(font)
self.label_atlas_save_format.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.label_atlas_save_format.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.label_atlas_save_format.setObjectName("label_atlas_save_format")
self.cb_save_format_atlas = QtWidgets.QComboBox(parent=self.tab_6)
self.cb_save_format_atlas.setGeometry(QtCore.QRect(200, 200, 81, 22))
self.cb_save_format_atlas.setStyleSheet("background-color: rgb(71, 71, 71);\n"
"color: rgb(255, 255, 255);\n"
"border-color: rgb(77, 77, 77);\n"
"border:1px solid;")
self.cb_save_format_atlas.setObjectName("cb_save_format_atlas")
self.cb_save_format_atlas.addItems(dropdown_options)
self.cb_save_format_atlas.setCurrentIndex(2)
self.l_Title = QtWidgets.QLabel(parent=self.centralwidget)
self.l_Title.setGeometry(QtCore.QRect(0, 0, 821, 41))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(23)
font.setBold(True)
font.setItalic(False)
self.l_Title.setFont(font)
self.l_Title.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight)
self.l_Title.setStyleSheet("color: rgb(241, 241, 241);\n"
"background-color: rgb(83, 83, 83);\n"
"font: 700 23pt \"Segoe UI\";")
self.l_Title.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.l_Title.setObjectName("l_Title")
self.frame_2 = QtWidgets.QFrame(parent=self.centralwidget)
self.frame_2.setGeometry(QtCore.QRect(0, -20, 821, 461))
self.frame_2.setStyleSheet("background-color:rgb(67, 67, 67)")
self.frame_2.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame_2.setObjectName("frame_2")
self.label_save_loc_show_combiner_2 = QtWidgets.QLabel(parent=self.frame_2)
self.label_save_loc_show_combiner_2.setGeometry(QtCore.QRect(250, 410, 361, 31))
self.label_save_loc_show_combiner_2.setStyleSheet("background-color: rgb(36, 36, 36);\n"
"color:grey;")
self.label_save_loc_show_combiner_2.setFrameShape(QtWidgets.QFrame.Shape.Box)
self.label_save_loc_show_combiner_2.setObjectName("label_save_loc_show_combiner_2")
self.button_set_save_location = QtWidgets.QPushButton(parent=self.frame_2)
self.button_set_save_location.setGeometry(QtCore.QRect(10, 410, 141, 31))
font = QtGui.QFont()
font.setBold(True)
font.setItalic(False)
font.setUnderline(False)
self.button_set_save_location.setFont(font)
self.button_set_save_location.setStyleSheet("background-color:rgb(60, 60, 60);\n"
"color:white;\n"
"")
self.button_set_save_location.setObjectName("button_set_save_location")
self.button_set_save_location.clicked.connect(self.setting_save_loc_both)
self.box_optimise_2 = QtWidgets.QCheckBox(parent=self.frame_2)
self.box_optimise_2.setGeometry(QtCore.QRect(620, 410, 191, 31))
font = QtGui.QFont()
font.setBold(True)
self.box_optimise_2.setFont(font)
self.box_optimise_2.setStyleSheet("color:white;")
self.box_optimise_2.setChecked(True)
self.box_optimise_2.setTristate(False)
self.box_optimise_2.setObjectName("box_optimise_2")
self.frame = QtWidgets.QFrame(parent=self.frame_2)
self.frame.setGeometry(QtCore.QRect(610, 60, 211, 341))
self.frame.setStyleSheet("background-color: rgb(36, 36, 36);")
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame.setObjectName("frame")
self.label_Thumbnail_Preview = QtWidgets.QLabel(parent=self.frame)
self.label_Thumbnail_Preview.setGeometry(QtCore.QRect(30, 60, 161, 161))
font = QtGui.QFont()
font.setPointSize(1)
font.setBold(False)
self.label_Thumbnail_Preview.setFont(font)
self.label_Thumbnail_Preview.setAutoFillBackground(False)
self.label_Thumbnail_Preview.setStyleSheet("border:2px solid grey;")
self.label_Thumbnail_Preview.setText("")
self.label_Thumbnail_Preview.setPixmap(QtGui.QPixmap(default_picture))
self.label_Thumbnail_Preview.setScaledContents(True)
self.label_Thumbnail_Preview.setObjectName("label_Thumbnail_Preview")
self.button_thumb_right = QtWidgets.QPushButton(parent=self.frame)
self.button_thumb_right.setGeometry(QtCore.QRect(170, 230, 41, 24))
self.button_thumb_right.setStyleSheet("background-color:rgb(77, 77, 77);\n"
"color:white;\n"
"")
self.button_thumb_right.setObjectName("button_thumb_right")
self.button_thumb_left = QtWidgets.QPushButton(parent=self.frame)
self.button_thumb_left.setGeometry(QtCore.QRect(10, 230, 41, 24))
self.button_thumb_left.setStyleSheet("background-color:rgb(77, 77, 77);\n"
"color:white;\n"
"")
self.button_thumb_left.setObjectName("button_thumb_left")
self.button_thumb_left.clicked.connect(lambda: self.setting_thumbnail(direction="decrease"))
self.button_thumb_right.clicked.connect(lambda: self.setting_thumbnail(direction="increase"))
self.lbl_thumb_counter = QtWidgets.QLabel(parent=self.frame)
self.lbl_thumb_counter.setGeometry(QtCore.QRect(60, 230, 101, 21))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
self.lbl_thumb_counter.setFont(font)
self.lbl_thumb_counter.setStyleSheet("font: 200 9pt \"Segoe UI\";\n"
"color: white;")
self.lbl_thumb_counter.setFrameShape(QtWidgets.QFrame.Shape.Box)
self.lbl_thumb_counter.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.lbl_thumb_counter.setObjectName("lbl_thumb_counter")
self.button_select_images = QtWidgets.QPushButton(parent=self.frame)
self.button_select_images.setGeometry(QtCore.QRect(10, 260, 201, 31))
font = QtGui.QFont()
font.setBold(True)
self.button_select_images.setFont(font)
self.button_select_images.setStyleSheet("background-color:rgb(80, 80, 80);\n"
"color:white;")
self.button_select_images.setObjectName("button_select_images")
self.button_select_images.clicked.connect(self.searching_file)
self.button_clear_images = QtWidgets.QPushButton(parent=self.frame)
self.button_clear_images.setGeometry(QtCore.QRect(10, 300, 201, 31))
font = QtGui.QFont()
font.setBold(True)
self.button_clear_images.setFont(font)
self.button_clear_images.setStyleSheet("background-color:rgb(50, 50, 50);\n"
"color:white;")
self.button_clear_images.setObjectName("button_clear_images")
self.button_clear_images.clicked.connect(self.clear_old_files)##self.config_load_icons
self.l_Output_Log_3 = QtWidgets.QLabel(parent=self.frame)
self.l_Output_Log_3.setGeometry(QtCore.QRect(0, 0, 211, 51))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(15)
font.setBold(True)
font.setItalic(False)
self.l_Output_Log_3.setFont(font)
self.l_Output_Log_3.setStyleSheet("color: rgb(241, 241, 241);\n"
"background-color:rgb(56, 56, 56);\n"
"font: 700 15pt \"Segoe UI\";")
self.l_Output_Log_3.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.l_Output_Log_3.setObjectName("l_Output_Log_3")
self.bn_open_save_path = QtWidgets.QPushButton(parent=self.frame_2)
self.bn_open_save_path.setGeometry(QtCore.QRect(160, 410, 81, 31))
font = QtGui.QFont()
font.setBold(True)
font.setItalic(False)
font.setUnderline(False)
self.bn_open_save_path.setFont(font)
self.bn_open_save_path.setStyleSheet("background-color:rgb(50, 50, 50);\n"
"color:white;\n"
"")
self.bn_open_save_path.setObjectName("bn_open_save_path")
self.bn_open_save_path.clicked.connect(self.open_path_set)
self.frame.raise_()
self.label_save_loc_show_combiner_2.raise_()
self.button_set_save_location.raise_()
self.box_optimise_2.raise_()
self.bn_open_save_path.raise_()
self.frame_2.raise_()
self.tabs_functions.raise_()
self.l_Title.raise_()
DaisyWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(parent=DaisyWindow)
self.statusbar.setObjectName("statusbar")
DaisyWindow.setStatusBar(self.statusbar)
self.retranslateUi(DaisyWindow)
self.tabs_functions.setCurrentIndex(0)
self.tabs_rescale_function.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(DaisyWindow)
###fnction for fixing all 16 bit files
def fix_16_bit(self,image_file):
numpy_array = np.array(image_file, dtype=np.uint16)
numpy_array = (numpy_array / 257).astype(np.uint8)
return_image = Image.fromarray(numpy_array, "L")
return return_image
#########function to load maps for converting from unity to ue
def just_load_engine_maps(self,map_type):
print("just loading for now")
if self.cb_from_maps.currentIndex()==self.cb_for_maps.currentIndex():
print("same indexs! will not proceed")
elif self.cb_from_maps.currentIndex()!=self.cb_for_maps.currentIndex():
global stored_engine_image_files
global stored_engine_full_paths
file_dialog = QFileDialog(DaisyWindow)
file_dialog.setWindowTitle("Open File")
file_dialog.setFileMode(QFileDialog.FileMode.ExistingFile)
file_dialog.setViewMode(QFileDialog.ViewMode.Detail)
file_dialog.setNameFilters(["Images (*.png *.webp *.jpeg *.heic *.gif *.tga *.jpg *.tiff)"])
if file_dialog.exec():
image_loading = file_dialog.selectedFiles()[0]
stored_engine_full_paths[0]=image_loading
folder_of_file = os.path.dirname(image_loading)
with PIL.Image.open(image_loading) as image_remap:
if image_remap.mode=="I;16":
print("its a 16 bitter")
image_remap = self.fix_16_bit(image_remap)
temp_save_location=file_path_to_script+"/combiner_thumbnail_"+"1"+".png" #[:-6]
image_remap.save(temp_save_location,'PNG')
if map_type=="Channel Packed":
print("dealing with channel packed map")
stored_engine_image_files[0]=image_remap
#make temp png just to force it to load thumbnail
thumb_temp_save=save_file_path_split_comb+"/temp_thumb.png"
image_remap.save(thumb_temp_save,"PNG")
self.image_packed_map.setPixmap(QtGui.QPixmap(thumb_temp_save))
os.remove(thumb_temp_save)
elif map_type=="Normals":
print("dealing with normal map")
stored_engine_image_files[1]=image_remap
stored_engine_full_paths[1]=image_loading
thumb_temp_save=save_file_path_split_comb+"/temp_thumb.png"
image_remap.save(thumb_temp_save,"PNG")
self.image_normal_map.setPixmap(QtGui.QPixmap(thumb_temp_save))
os.remove(thumb_temp_save)
elif map_type=="AO":
print("dealing with ambient occlusion")
stored_engine_image_files[2]=image_remap
stored_engine_full_paths[2]=image_loading
thumb_temp_save=save_file_path_split_comb+"/temp_thumb.png"
image_remap.save(thumb_temp_save,"PNG")
self.image_ambient_occlusion.setPixmap(QtGui.QPixmap(thumb_temp_save))
os.remove(thumb_temp_save)
###if exec is not there then empty
else:
print("now resetting thumbnail values")
if map_type=="Channel Packed":
print("no channel packed")
stored_engine_image_files[0]=0
self.image_packed_map.setPixmap(QtGui.QPixmap(default_picture))
elif map_type=="Normals":
print("missing normal map")
stored_engine_image_files[1]=0
self.image_normal_map.setPixmap(QtGui.QPixmap(default_picture))
elif map_type=="AO":
print("missing ambient occlusion")
stored_engine_image_files[2]=0
self.image_ambient_occlusion.setPixmap(QtGui.QPixmap(default_picture))
####actually export out the channel fixed files
#this is ran after
def convert_engine_files (self):
if self.cb_from_maps.currentIndex()==self.cb_for_maps.currentIndex():
print("same indexs! will not proceed")
caution=self.message_confirmation(message_type="Ok",file_amount="loaded",action_detail=" remap files to same engine type! Ignoring")
elif self.cb_from_maps.currentIndex()!=self.cb_for_maps.currentIndex():
if stored_engine_image_files==[0,0,0]:
print("empty will not proceed!")
caution=self.message_confirmation(message_type="Ok",file_amount="more",action_detail=" remap as nothing has been added please add")
else:
print("not empty one of them")
#with PIL.Image.open(image_loading) as image_remap:
#just_file_name=os.path.basename(image_remap)
#chosen_prefix=".png"
try:
if self.cb_from_maps.currentIndex()==0:
file_message="multiple files from Unreal Packed to Unity URP"
elif self.cb_from_maps.currentIndex()==1:
file_message="multiple files from Unity URP to Unreal Engine Packed"
message_confirm=self.message_confirmation(message_type="Warning to Proceed",file_amount=file_message,action_detail=" convert")
if message_confirm=="Yes":
if stored_engine_image_files[0]!=0:
#check if to actually convert!
print("asking if to convert")
if self.cb_from_maps.currentIndex()==1:#0 is from unreal 1 is from unity this whole bit is to UNREAL ONLY!!
#this also relies on ambient map to be loaded! if it can
chosen_prefix="."+str(stored_engine_image_files[0].format)
#converting image files
image_remap=stored_engine_image_files[0]
just_file_name=os.path.basename(stored_engine_full_paths[0])[:-4]
size_map=image_remap.size
size_of_map=[size_map[0],size_map[1]]
print("done")
new_channel_map=[0,0,0]
#ao map
if stored_engine_image_files[2]==0:
print("no ao map detected")
ao_map=Image.new(mode='L',size=size_of_map,color=255)
else:
print("detected ao map")
#loaded_ao_map=PIL.Image.open(stored_engine_image_files[2])
#loaded_ao_map.load()
ao_map=stored_engine_image_files[2].convert('L')
new_channel_map[0]=ao_map
#roughness map
#so first invert it so its correct
try:
roughness_all=image_remap.getchannel("A")
except:
roughness_all=Image.new(mode='L',size=size_of_map,color=255)
roughness_inverted=PIL.ImageChops.invert(roughness_all)
##now replace white with 122 flat grey
pixels = list(roughness_inverted.getdata(band=0))
message_confirm_resample=self.message_confirmation(message_type="Warning to Proceed",file_amount="roughness? This can cause artifacts on extremely rough surfaces",action_detail=" resample")
if message_confirm_resample=="Yes":
new_color = 122 #133 is old then invert
new_pixel_list=[]
for pixel in pixels:
pixel_write=pixel
if pixel_write==255:
#print("found black pixel!")
pixel_write=122
new_pixel_list.append(pixel_write)
new_roughness = Image.new("L", size_of_map)
new_roughness.putdata(new_pixel_list)
else:
new_roughness=roughness_inverted
new_channel_map[1]=new_roughness
##metalness map
#AORM IS 012 RGB
metalness=image_remap.getchannel("R")
new_channel_map[2]=metalness
#COMBINING INTO ONE AGAIN
new_aorm_map=Image.merge("RGB",(new_channel_map[0],new_channel_map[1],new_channel_map[2]))
new_filename_final=save_file_path_split_comb+"/"+just_file_name+"_AORM_UE"+str(chosen_prefix)
new_aorm_map.save(new_filename_final)
##########
elif self.cb_from_maps.currentIndex()==0:
print("converting from unreal INTO UNITY o lord")
chosen_prefix="."+str(stored_engine_image_files[0].format)
image_remap=stored_engine_image_files[0]
just_file_name=os.path.basename(stored_engine_full_paths[0])[:-4]
size_map=image_remap.size
size_of_map=[size_map[0],size_map[1]]
new_channel_map=[0,0,0,0]
#ao map
ao_map_UE=image_remap.getchannel("R")
ao_map_export=save_file_path_split_comb+"/"+just_file_name+"_AO_Unity"+str(chosen_prefix)
ao_map_UE.save(ao_map_export)
#roughness map
#so first invert it so its correct
roughness_all=image_remap.getchannel("G")
#roughness_inverted=PIL.ImageChops.invert(roughness_all)
##now replace white with 122 flat grey
message_confirm_resample=self.message_confirmation(message_type="Warning to Proceed",file_amount="roughness? This can cause artifacts on extremely rough surfaces",action_detail=" resample")
if message_confirm_resample=="Yes":
pixels = list(roughness_all.getdata())
new_pixel_list=[]
for pixel in pixels:
pixel_write=pixel
if pixel_write==122:
#print("found white pixel!")
pixel_write=255
new_pixel_list.append(pixel_write)
new_roughness = Image.new("L", size_of_map)
new_roughness.putdata(new_pixel_list)
else:
new_roughness=roughness_all
roughness_inverted=PIL.ImageChops.invert(new_roughness)
new_channel_map[3]=roughness_inverted
##metalness map
#AORM IS 012 RGB
metalness=image_remap.getchannel("B")
new_channel_map[0]=metalness
new_channel_map[1]=metalness
new_channel_map[2]=metalness
#COMBINING INTO ONE AGAIN
if chosen_prefix=="jpeg" or chosen_prefix=="jpg":
chosen_prefix="PNG"
new_metalness_smoothness=Image.merge("RGBA",(new_channel_map[0],new_channel_map[1],new_channel_map[2],new_channel_map[3]))
new_filename_final=save_file_path_split_comb+"/"+just_file_name+"_Metalness_Smooth_Unity"+str(chosen_prefix)
new_metalness_smoothness.save(new_filename_final)
if stored_engine_image_files[1]!=0:
print("normal map!")
image_remap=stored_engine_image_files[1]
just_file_name=os.path.basename(stored_engine_full_paths[1])[:-4]
chosen_prefix="."+str(stored_engine_image_files[1].format)
normal_bands= tuple(image_remap.split())
green_channel=image_remap.getchannel("G")
inverted_green=PIL.ImageChops.invert(green_channel)
new_normal_map=Image.merge("RGB",(normal_bands[0],inverted_green,normal_bands[2]))
if self.cb_from_maps.currentIndex()==1:#save normal for unreal
new_filename_final=save_file_path_split_comb+"/"+just_file_name+"_N_UREAL"+str(chosen_prefix)
elif self.cb_from_maps.currentIndex()==0: # save for unity
new_filename_final=save_file_path_split_comb+"/"+just_file_name+"_N_UNITY"+str(chosen_prefix)
print(new_filename_final)
new_normal_map.save(new_filename_final)
if self.cb_from_maps.currentIndex()==0:
file_message="multiple files from Unreal Packed to Unity URP"
elif self.cb_from_maps.currentIndex()==1:
file_message="multiple files from Unity URP to Unreal Engine Packed"
success=self.message_confirmation(message_type="Success",file_amount=file_message,action_detail=" converted")
except:
print("something happened o no")
caution=self.message_confirmation(message_type="Ok",file_amount="loaded",action_detail=" something has happened! Quitting")
#########function to load in config file for location of icons or else theyre blank
def config_load_icons(self):
print("seeking ui config")
global default_picture
global daisy_icon
global file_path_to_script
local_loc=str(os.path.dirname(os.path.abspath(__file__)))
default_picture=local_loc+"/uv_empty.png"
daisy_icon=local_loc+"/daisy_icon.png"
file_path_to_script=local_loc
print("i've added it")
######rescale stuff
def fill_scale_info(self):
if len(stored_images)!=0:
global thumbnail_current_loaded
loaded_index=thumbnail_current_loaded-1
print("loading index"+str(loaded_index))
thumbnail_loaded_picture=stored_images[loaded_index]
with PIL.Image.open(thumbnail_loaded_picture) as image_thumb:
size_of_picture=image_thumb.size
self.spin_width_custom.setValue(int(size_of_picture[0]))
self.spin_height_custom.setValue(int(size_of_picture[1]))
def rescale_func(self):
#if it isnt empty
numb_files=len(stored_images)
if numb_files==0:
message_confirm=self.message_confirmation(message_type="Ok",file_amount=0,action_detail=" rescale")
elif len(stored_images)!=0:
try:
global thumbnail_current_loaded
loaded_index=thumbnail_current_loaded-1
if self.checkBox_only_scale_loaded.isChecked()==True:
numb_files=1
message_confirm=self.message_confirmation(message_type="Warning to Proceed",file_amount=numb_files,action_detail=" rescale")
if message_confirm=="Yes":
files_toprocess=[]
if self.checkBox_only_scale_loaded.isChecked()==True:
print("check is true!")
files_toprocess=[stored_images[loaded_index]]
elif self.checkBox_only_scale_loaded.isChecked()==False:
files_toprocess=stored_images
for image_file in files_toprocess:
with PIL.Image.open(image_file) as im:
im.load()
operation_rescale_mod=self.tabs_rescale_function.tabText(self.tabs_rescale_function.currentIndex())
rescale_width=0
rescale_heighth=0
####################### scales based on set resolution value ###############
if operation_rescale_mod=="Set Scale":
print("set scaling now")
scale_picked=self.combo_resolution_dropdown.currentIndex()
scale_from_arr=dropdown_resolutions_pick[scale_picked]
rescale_width=scale_from_arr
rescale_heighth=scale_from_arr
####################### scales based on percentage ###############
elif operation_rescale_mod=="Percent":
print("percentage mode now")
size_of_picture=im.size
rescale_width=size_of_picture[0]
rescale_heighth=size_of_picture[1]
percentage_val=self.spinBox_rescale_percentage.value()
scale_val_final=1
if self.combo_scale_up_or_down.currentIndex()==0:
scale_val_final=(percentage_val/100)+1
elif self.combo_scale_up_or_down.currentIndex()==1:
scale_val_final=1-(percentage_val/100)
if self.checkBox_apply_to_width.isChecked():
print("its checked ey for width")
rescale_width=rescale_width*scale_val_final
rescale_width=round(rescale_width)
print("new width is "+str(rescale_width))
if self.checkBox_apply_to_height.isChecked():
print("its checked ey for height")
print("before its "+str(rescale_heighth))
rescale_heighth=rescale_heighth*scale_val_final
rescale_heighth=round(rescale_heighth)
print("new height is "+str(rescale_heighth))
####################### scales based on the inputted custom ###############
elif operation_rescale_mod=="Custom":
rescale_width=self.spin_width_custom.value()
rescale_heighth=self.spin_height_custom.value()
####################### scales based on the currently loaded thumb picture ###############
elif operation_rescale_mod=="Reuse Scale":
thumbnail_loaded_picture=stored_images[loaded_index]
with PIL.Image.open(thumbnail_loaded_picture) as image_thumb:
size_of_picture=image_thumb.size
rescale_width=size_of_picture[0]
rescale_heighth=size_of_picture[1]
#solo open(stored_images[loaded_index])
#preventing error of 0
if int(rescale_width)<=int(0):
rescale_width=1
if int(rescale_heighth)<=0:
rescale_heighth=1
#finding out what the input image is type wise
just_suffix=image_file[image_file.rfind('.'):]
path_name_new=image_file[:image_file.rfind('.')]
suffix_cleanup=just_suffix[1:].upper()
print(path_name_new)
if suffix_cleanup=="JPG":
suffix_cleanup="JPEG"
#making file name and using set directory for exporting
##fixing the issue where it wont save if its got alpha channel due to jpegs
just_file_name=os.path.basename(image_file)
new_filename_final=save_file_path_split_comb+"/"+just_file_name+"_"+str(rescale_width)+"_"+str(rescale_heighth)+just_suffix
print(new_filename_final)
if self.box_optimise_2.isChecked()==True:
print("overwrite check is on!")
new_filename_final=path_name_new+"_"+str(rescale_width)+"_"+str(rescale_heighth)+just_suffix
new_path_name=new_filename_final#path_name_new+"_"+str(rescale_width)+"_"+str(rescale_heighth)+just_suffix
#set to scaling it now
#resizes image
if im.mode=="I;16":
print("converting")
numpy_array = np.array(im, dtype=np.uint16)
numpy_array = (numpy_array / 257).astype(np.uint8)
im2 = Image.fromarray(numpy_array, "L")
im=im2
else:
print("not 16 bit ignoring")
im_resized = im.resize(size=[int(rescale_width),int(rescale_heighth)])
###saving check
if self.checkBox_overwrite_rescale.isChecked()==True:
print("checked overwrite ono")
im_resized.save(image_file,suffix_cleanup)
elif self.checkBox_overwrite_rescale.isChecked()==False:
print("overwrite off")
im_resized.save(new_path_name,suffix_cleanup)
message_confirm=self.message_confirmation(message_type="Success",file_amount=numb_files,action_detail=" rescaled")
except:
print("something happened o no")
caution=self.message_confirmation(message_type="Ok",file_amount="",action_detail=" complete processing files as something went wrong. Quitting")
#########setting save file location
def setting_save_loc_both(self):
global save_file_path_split_comb
print("setting file save location")
file_dialog = QFileDialog(DaisyWindow)
file_dialog.setWindowTitle("Set Save Folder")
file_dialog.setFileMode(QFileDialog.FileMode.Directory)
file_dialog.setViewMode(QFileDialog.ViewMode.Detail)
#file_dialog.setNameFilters(["Images (*.png *.webp *.jpeg *.heic *.gif *.tga *.jpg *.tiff)"])
if file_dialog.exec():
file_dir_from_prompt = file_dialog.selectedFiles()[0] #selectedFiles
print("set save directory")
save_file_path_split_comb=str(file_dir_from_prompt)
self.label_save_loc_show_combiner_2.setText(save_file_path_split_comb)
else:
print("failed to set save directory defaulting")
save_file_path_split_comb=str(Path.home() / "Downloads")
self.label_save_loc_show_combiner_2.setText('../../User/Downloads/')
######### clears thumnails for splitter
def clear_thumbnails(self,clear_mode):
if clear_mode=="All":
self.channel_thumb_splitter_red.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_splitter_green.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_splitter_blue.setPixmap(QtGui.QPixmap(default_picture))
self.channel_thumb_splitter_alpha.setPixmap(QtGui.QPixmap(default_picture))
elif clear_mode=="Red":
self.channel_thumb_splitter_red.setPixmap(QtGui.QPixmap(default_picture))
elif clear_mode=="Green":
self.channel_thumb_splitter_green.setPixmap(QtGui.QPixmap(default_picture))
elif clear_mode=="Blue":
self.channel_thumb_splitter_blue.setPixmap(QtGui.QPixmap(default_picture))
elif clear_mode=="Alpha":
self.channel_thumb_splitter_alpha.setPixmap(QtGui.QPixmap(default_picture))
#thumbnails setting for splitter
def load_splitter(self,inp_file_location):
with PIL.Image.open(inp_file_location) as thumb_temp:
if thumb_temp.mode=="RGBA" or thumb_temp.mode=="RGB":
thumb_temp=PIL.ImageChops.convert("L")
temp_save_location=file_path_to_script+"/splitter_thumbnail_thumb.png"
thumb_temp.save(temp_save_location,'PNG')
return str(temp_save_location)
####messagebox for confirming loading images or any sort of task y/n
#
def message_confirmation(self,message_type,file_amount,action_detail):
if message_type=="Warning to Proceed":
message_header="You are about to"+action_detail+" "+str(file_amount)+" files, do you want to proceed?"
dlg = QtWidgets.QMessageBox()
dlg.setWindowTitle("Caution")
dlg.setText(message_header)
dlg.setStandardButtons(
QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No
)
dlg.setIcon(QtWidgets.QMessageBox.Icon.Question)
button = dlg.exec()
if button == QtWidgets.QMessageBox.StandardButton.Yes:
return "Yes"
else:
return "No"
elif message_type=="Ok":
message_header="Cannot"+action_detail+" "+str(file_amount)+" file(s)"
dlg = QtWidgets.QMessageBox()
dlg.setWindowTitle("Reminder")
dlg.setText(message_header)
dlg.setStandardButtons(
QtWidgets.QMessageBox.StandardButton.Ok)
dlg.setIcon(QtWidgets.QMessageBox.Icon.Question)
button = dlg.exec()
elif message_type=="Success":
message_header="Succesfully"+action_detail+" "+str(file_amount)+" file(s)"
dlg = QtWidgets.QMessageBox()
dlg.setWindowTitle("Message")
dlg.setText(message_header)
dlg.setStandardButtons(
QtWidgets.QMessageBox.StandardButton.Ok)
dlg.setIcon(QtWidgets.QMessageBox.Icon.Information)
button = dlg.exec()
#####get the splitting logic
def splitting_maps(self,delete_stat):
print("splitting up maps from inputted picture")
#refresh thumbs
if len(stored_images)==0:
self.clear_thumbnails(clear_mode="All")
print("made it here")
message_confirm=self.message_confirmation(message_type="Ok",file_amount="images as none are loaded",action_detail=" split")
if len(stored_images)!=0:
global thumbnail_current_loaded
message_confirm=self.message_confirmation(message_type="Warning to Proceed",file_amount="the currently loaded image",action_detail=" split")
if message_confirm=="Yes":
try:
loaded_index=thumbnail_current_loaded-1
print("not empty splitting")
split_channels=[]
if self.chbox_red_channel.isChecked()==True:
split_channels.append(0)
print("now splitting red")
if self.chbox_green_channel.isChecked()==True:
split_channels.append(1)
print("now splitting green")
if self.chbox_blue_channel.isChecked()==True:
split_channels.append(2)
print("now splitting blue")
if self.chbox_alpha_channel.isChecked()==True:
split_channels.append(3)
print("now splitting alpha")
if len(split_channels)!=0:
print("not empty, now exporting")
image_to_load=PIL.Image.open(stored_images[loaded_index])
image_to_load.load()
if image_to_load.mode=="I;16":
print("converting")
numpy_array = np.array(image_to_load, dtype=np.uint16)
numpy_array = (numpy_array / 257).astype(np.uint8)
image_to_load = Image.fromarray(numpy_array, "L")
resolution_set=[int(self.spin_combiner_export_width.value()),int(self.spin_combiner_export_height.value())]
if delete_stat==False:
print("resizing")
selected_load=image_to_load.resize(size=resolution_set)
else:
selected_load=image_to_load
##if the file is not wide enough for preview get tallest then pad it
thumbnail_scale=selected_load.size
if thumbnail_scale[0]!=thumbnail_scale[1]:
temp_image=selected_load
if thumbnail_scale[0]>thumbnail_scale[1]:
print("thumbnail is wider than tall")
selected_load = PIL.ImageOps.pad(image=temp_image, size=(thumbnail_scale[0],thumbnail_scale[0]))
if thumbnail_scale[0]<thumbnail_scale[1]:
print("thumbnail is taller than wide")
selected_load = PIL.ImageOps.pad(image=temp_image, size=(thumbnail_scale[1],thumbnail_scale[1]))
split_channels_image=selected_load.split()
print(split_channels_image)
#make the export name
name_of_file=os.path.basename(str(stored_images[loaded_index]))
keep_first_name=name_of_file[:name_of_file.rfind('.')]
channel_count=0
for channel in split_channels:
if channel<len(split_channels_image):
channel_count+=1
print("now exporting"+str(channel))
channel_image=split_channels_image[channel]
export_upper=dropdown_endings[self.combobox_save_files_combiner.currentIndex()].upper()
export_type=export_upper[1:]
filename=str(stored_images[loaded_index])
strip_filename=filename[:filename.rfind('.')]
#making file name and using set directory for exporting
new_filename=strip_filename+str(channel_count)+str(export_upper)
file_save_pref=export_upper.removeprefix('.')
print("SAVING AS "+str(file_save_pref))
##fixing the issue where it wont save if its got alpha channel due to jpegs
just_file_name=os.path.basename(strip_filename)
combined_final_name=save_file_path_split_comb+"/"+just_file_name+str(channel_count)+str(export_upper)
#print(new_filename_final)
if self.box_optimise_2.isChecked()==True:
print("overwrite check is on!")
combined_final_name=new_filename
print("final name is "+str(combined_final_name))
#IF OVERWRITE IS ON
#if self.box_optimise_2.isChecked()==True:
# save_file_path_split_comb=str(os.path.dirname(stored_images[loaded_index]))
# print(save_file_path_split_comb)
#combined_final_name=save_file_path_split_comb+"/"+keep_first_name+"_"+str(channel)+dropdown_endings[self.combobox_save_files_combiner.currentIndex()]
channel_image = channel_image.convert("L")
channel_image.save(combined_final_name,export_type)
##now set preview thumbnails
#####
#get file if exists, make thumb then replace image
#file_path_channel=save_file_path_split_comb+"/"
#file_path_channel=#save_file_path_split_comb+"/"+keep_first_name+"_"+str(channel)+dropdown_endings[self.combobox_save_files_combiner.currentIndex()]
check_existance=True#os.path.isfile(combined_final_name)#file_path_channel
file_path_channel=combined_final_name
print(str(file_path_channel))
if check_existance:
print("exists makin thumb")
load_path=self.load_splitter(inp_file_location=file_path_channel)
if channel==0:
self.channel_thumb_splitter_red.setPixmap(QtGui.QPixmap(load_path))
elif channel==1:
self.channel_thumb_splitter_green.setPixmap(QtGui.QPixmap(load_path))
elif channel==2:
self.channel_thumb_splitter_blue.setPixmap(QtGui.QPixmap(load_path))
elif channel==3:
self.channel_thumb_splitter_alpha.setPixmap(QtGui.QPixmap(load_path))
if delete_stat==True:
print("deleting too!")
os.remove(file_path_channel)
else:
if channel==0:
self.channel_thumb_splitter_red.setPixmap(QtGui.QPixmap(default_picture))
elif channel==1:
self.channel_thumb_splitter_green.setPixmap(QtGui.QPixmap(default_picture))
elif channel==2:
self.channel_thumb_splitter_blue.setPixmap(QtGui.QPixmap(default_picture))
elif channel==3:
self.channel_thumb_splitter_alpha.setPixmap(QtGui.QPixmap(default_picture))
message_confirm=self.message_confirmation(message_type="Success",file_amount="one image file into multiple",action_detail=" split")
except:
print("something happened o no")
caution=self.message_confirmation(message_type="Ok",file_amount="",action_detail=" complete processing files as something went wrong. Quitting")
##########atlas packer logic
def atlas_packer(self,operation_mode,thumb_channel):
print("atlas packing")
sub_operation_mode=""
if operation_mode=="Thumbnail":
print("just adding thumbnails")
file_dialog = QFileDialog(DaisyWindow)
file_dialog.setWindowTitle("Open File")
file_dialog.setFileMode(QFileDialog.FileMode.ExistingFile)
file_dialog.setViewMode(QFileDialog.ViewMode.Detail)
file_dialog.setNameFilters(["Images (*.png *.webp *.jpeg *.heic *.gif *.tga *.jpg *.tiff)"])
if file_dialog.exec():
sel_file_combiner = file_dialog.selectedFiles()[0] #selectedFiles
with PIL.Image.open(sel_file_combiner) as thumb_temp:
if thumb_temp.mode=="I;16":
print("its a 16 bitter")
thumb_temp = self.fix_16_bit(thumb_temp)
elif thumb_temp.mode!="I;16":
thumb_temp.convert("RGB")
temp_save_location=file_path_to_script+"/combiner_thumbnail_"+"color_saver"+".PNG" #[:-6]
thumb_temp.save(temp_save_location,'PNG')
sub_operation_mode="Load"
else:
sub_operation_mode="Clear"
if sub_operation_mode=="Clear":
print("clearing data")
if thumb_channel=="Red":
self.ch_atlas_image_1.setPixmap(QtGui.QPixmap(default_picture))
atlas_image_store[0]=0
elif thumb_channel=="Green":
self.ch_atlas_image_2.setPixmap(QtGui.QPixmap(default_picture))
atlas_image_store[1]=0
elif thumb_channel=="Blue":
self.ch_atlas_image_3.setPixmap(QtGui.QPixmap(default_picture))
atlas_image_store[2]=0
elif thumb_channel=="Alpha":
self.ch_atlas_image_4.setPixmap(QtGui.QPixmap(default_picture))
atlas_image_store[3]=0
elif sub_operation_mode=="Load":
print("loading data")
if thumb_channel=="Red":
self.ch_atlas_image_1.setPixmap(QtGui.QPixmap(sel_file_combiner))
atlas_image_store[0]=sel_file_combiner
elif thumb_channel=="Green":
self.ch_atlas_image_2.setPixmap(QtGui.QPixmap(sel_file_combiner))
atlas_image_store[1]=sel_file_combiner
elif thumb_channel=="Blue":
self.ch_atlas_image_3.setPixmap(QtGui.QPixmap(sel_file_combiner))
atlas_image_store[2]=sel_file_combiner
elif thumb_channel=="Alpha":
self.ch_atlas_image_4.setPixmap(QtGui.QPixmap(sel_file_combiner))
atlas_image_store[3]=sel_file_combiner
elif operation_mode=="Atlasing":
if atlas_image_store==[0,0,0,0]:
caution=self.message_confirmation(message_type="Ok",file_amount="more",action_detail=" atlas as nothing has been added please add")
elif atlas_image_store!=[0,0,0,0]:
print("trying to atlas all to one sheet")
file_message="multiple files to one atlas sheet"
message_confirm=self.message_confirmation(message_type="Warning to Proceed",file_amount=file_message,action_detail=" stitch")
if message_confirm=="Yes":
try:
square_size_x=int(self.spin_export_atlas_x.value()/2)
square_size_y=int(self.spin_export_atlas_y.value()/2)
print("size is "+str(square_size_x)+"x plus "+str(square_size_y)+"y")
#if its too small can break
if square_size_x<100:
square_size_x=100
elif square_size_y<100:
square_size_y=100
###getting first corner 0,0
print("size is "+str(square_size_x)+"x plus "+str(square_size_y)+"y")
flat_color=(20,20,20,255)
atlas_sheet=PIL.Image.new(mode="RGBA",size=(self.spin_export_atlas_x.value(),self.spin_export_atlas_y.value()),color=(255,255,255,255)) #255,255,255,255
#red
if atlas_image_store[0]!=0:
try:
image_load = PIL.Image.open(atlas_image_store[0])
if image_load.mode=="I;16":
print("its a 16 bitter")
image_load = self.fix_16_bit(image_load)
elif image_load.mode!="I;16":
print("not 18 bit")
atlas_quad_1=PIL.ImageOps.pad(image=image_load,size=(square_size_x,square_size_y))
except:
atlas_quad_1=PIL.Image.new(mode="RGBA",size=(square_size_x,square_size_y),color=(flat_color))#red is (255,0,0,255))
elif atlas_image_store[0]==0:
atlas_quad_1=PIL.Image.new(mode="RGBA",size=(square_size_x,square_size_y),color=(flat_color))#red is (255,0,0,255))
#blue
if atlas_image_store[1]!=0:
try:
image_load = PIL.Image.open(atlas_image_store[1])
if image_load.mode=="I;16":
print("its a 16 bitter")
image_load = self.fix_16_bit(image_load)
elif image_load.mode!="I;16":
print("not 18 bit")
atlas_quad_2=PIL.ImageOps.pad(image=image_load,size=(square_size_x,square_size_y))
except:
atlas_quad_2=PIL.Image.new(mode="RGBA",size=(square_size_x,square_size_y),color=(flat_color))#red is (255,0,0,255))
elif atlas_image_store[1]==0:
atlas_quad_2=PIL.Image.new(mode="RGBA",size=(square_size_x,square_size_y),color=(flat_color))#red is (255,0,0,255))
#green
if atlas_image_store[2]!=0:
try:
image_load = PIL.Image.open(atlas_image_store[2])
if image_load.mode=="I;16":
print("its a 16 bitter")
image_load = self.fix_16_bit(image_load)
elif image_load.mode!="I;16":
print("not 18 bit")
atlas_quad_3=PIL.ImageOps.pad(image=image_load,size=(square_size_x,square_size_y))
except:
atlas_quad_3=PIL.Image.new(mode="RGBA",size=(square_size_x,square_size_y),color=(flat_color))#red is (255,0,0,255))
elif atlas_image_store[2]==0:
atlas_quad_3=PIL.Image.new(mode="RGBA",size=(square_size_x,square_size_y),color=(flat_color))#green is (0,255,255,255))
#alpha
if atlas_image_store[3]!=0:
try:
image_load = PIL.Image.open(atlas_image_store[3])
if image_load.mode=="I;16":
print("its a 16 bitter")
image_load = self.fix_16_bit(image_load)
elif image_load.mode!="I;16":
print("not 18 bit")
atlas_quad_4=PIL.ImageOps.pad(image=image_load,size=(square_size_x,square_size_y))
except:
atlas_quad_4=PIL.Image.new(mode="RGBA",size=(square_size_x,square_size_y),color=(flat_color))#red is (255,0,0,255))
elif atlas_image_store[3]==0:
atlas_quad_4=PIL.Image.new(mode="RGBA",size=(square_size_x,square_size_y),color=(flat_color))#green is (0,255,255,255))
#now combine final atlas
atlas_sheet.paste(im=atlas_quad_1,box=(0,0))
atlas_sheet.paste(im=atlas_quad_2,box=(square_size_x,0))
atlas_sheet.paste(im=atlas_quad_3,box=(0,square_size_y))
atlas_sheet.paste(im=atlas_quad_4,box=(square_size_x,square_size_y))
##SAVING ATLAS
file_format=['tga','webp','png','jpeg','jpg']
selected_exp=str(file_format[self.cb_save_format_atlas.currentIndex()]).upper()
#if jpeg fix
if self.cb_save_format_atlas.currentIndex()==3:
atlas_sheet=atlas_sheet.convert("RGB")
atlas_save_loc=save_file_path_split_comb+"/"+"Atlas_Sheet"+"."+selected_exp
atlas_sheet.save(atlas_save_loc,selected_exp)
message_confirm=self.message_confirmation(message_type="Success",file_amount="multiple files into one ",action_detail=" stitched")
except:
caution=self.message_confirmation(message_type="Ok",file_amount="",action_detail=" complete processing files as something went wrong. Quitting")
########################## get the combining logic
########actually combine them into one final file
def final_file_combiner(self):
global stored_combiner_files
if stored_combiner_files==[0,0,0,0]:
message_confirm=self.message_confirmation(message_type="Ok",file_amount=0,action_detail=" combine")
elif stored_combiner_files!=[0,0,0,0]:
try:
#print(stored_combiner_files)
message_confirm=self.message_confirmation(message_type="Warning to Proceed",file_amount="multiple",action_detail=" combine")
if message_confirm=="Yes":
#print("not empty lets start combining")
###find the resolution
resolution_set=[int(self.spin_combiner_export_width.value()),int(self.spin_combiner_export_height.value())]
global file_path_to_script
file_path_old=file_path_to_script+"/debug.png"
####save_location_here
keep_first_name="Empty"
for file_check in stored_combiner_files:
name_of_file=os.path.basename(str(file_check))
keep_first_name=name_of_file[:name_of_file.rfind('.')]
if keep_first_name=="":
keep_first_name="Combined_File"
if file_check!=str(0):
break
final_combined_store=[]
##add blacks for empty data
for image in stored_combiner_files:
if str(image)=="0":
#print("no data found adding black")
create_black=Image.new(mode='L',size=resolution_set,color=0)
final_combined_store.append(create_black)
if str(image)!="0":
new_image_open=PIL.Image.open(image)
if new_image_open.mode=="RGBA" or new_image_open.mode=="RGB":
#print("rgb image so converting")
new_image_open = new_image_open.convert("L")
#convert 16 bits over to 8 bit so it doesnt break the entire goddamn program
elif new_image_open.mode=="I;16":
numpy_array = np.array(new_image_open, dtype=np.uint16)
numpy_array = (numpy_array / 257).astype(np.uint8)
new_image_open = Image.fromarray(numpy_array, "L")
#print("now rescaling and putting to arr")
new_image_rescaled=new_image_open.resize(resolution_set)
final_combined_store.append(new_image_rescaled)
#make the export name
combined_final_name=save_file_path_split_comb+"/"+keep_first_name+dropdown_endings[self.combobox_save_files_combiner.currentIndex()]
#print(combined_final_name)
export_upper=dropdown_endings[self.combobox_save_files_combiner.currentIndex()].upper()
export_type=export_upper[1:]
#print(str(export_type))
#now finally save itt
#if there is no alpha
if str(stored_combiner_files[3])=="0" or export_type=="JPEG":
#print("now saving as jepg")
new_combined = Image.merge("RGB",(final_combined_store[0],final_combined_store[1],final_combined_store[2]))
new_combined.save(combined_final_name,export_type)
#print("its a jpeg")
else:
new_combined = Image.merge("RGBA",(final_combined_store[0],final_combined_store[1],final_combined_store[2],final_combined_store[3]))
new_combined.save(combined_final_name,export_type)
message_confirm=self.message_confirmation(message_type="Success",file_amount="multiple files into one",action_detail=" combined")
except:
#print("something happened oh no")
caution=self.message_confirmation(message_type="Ok",file_amount="",action_detail=" complete processing files as something went wrong. Quitting")
##file prompt to load in for combine slot thumbnail
def load_combiner(self,color_saver):
file_dialog = QFileDialog(DaisyWindow)
file_dialog.setWindowTitle("Open File")
file_dialog.setFileMode(QFileDialog.FileMode.ExistingFile)
file_dialog.setViewMode(QFileDialog.ViewMode.Detail)
file_dialog.setNameFilters(["Images (*.png *.webp *.jpeg *.heic *.gif *.tga *.jpg *.tiff)"])
if file_dialog.exec():
sel_file_combiner = file_dialog.selectedFiles()[0] #selectedFiles
with PIL.Image.open(sel_file_combiner) as thumb_temp: #.convert('L')
##if the file is not wide enough for preview get tallest then pad it
print("the image mode is"+str(thumb_temp.mode))
if thumb_temp.mode=="RGBA" or thumb_temp.mode=="RGB":
thumb_temp = thumb_temp.convert("L")
thumbnail_scale=thumb_temp.size
#thumb_temp = PIL.ImageOps.autocontrast(thumb_temp)
#thumb_temp = thumb_temp.convert("RGB")
#thumb_temp = thumb_temp.convert("L")
#thumbnail_red=thumb_temp.getchannel("R")
#thumb_temp=thumbnail_red
if thumbnail_scale[0]!=thumbnail_scale[1]:
temp_image=thumb_temp
if thumbnail_scale[0]>thumbnail_scale[1]:
print("thumbnail is wider than tall")
thumb_temp = PIL.ImageOps.pad(image=temp_image, size=(thumbnail_scale[0],thumbnail_scale[0]))
if thumbnail_scale[0]<thumbnail_scale[1]:
print("thumbnail is wider than tall")
thumb_temp = PIL.ImageOps.pad(image=temp_image, size=(thumbnail_scale[1],thumbnail_scale[1]))
temp_save_location=file_path_to_script+"/combiner_thumbnail_"+"color_saver"+".PNG" #[:-6]
thumb_temp.save(temp_save_location,'PNG')
return sel_file_combiner,temp_save_location
else:
sel_file_combiner=0
temp_save_location=0
return sel_file_combiner,temp_save_location
###load thumb for combinin slots
def combine_load_images(self,color_image,clear_mode):
if clear_mode=="Clear":
print("clearing data")
if color_image=="Red":
self.channel_thumb_combiner_red.setPixmap(QtGui.QPixmap(default_picture))
stored_combiner_files[0]=0
elif color_image=="Green":
self.channel_thumb_combiner_green.setPixmap(QtGui.QPixmap(default_picture))
stored_combiner_files[1]=0
elif color_image=="Blue":
self.channel_thumb_combiner_blue.setPixmap(QtGui.QPixmap(default_picture))
stored_combiner_files[2]=0
elif color_image=="Alpha":
self.channel_thumb_combiner_alpha.setPixmap(QtGui.QPixmap(default_picture))
stored_combiner_files[3]=0
print(stored_combiner_files)
elif clear_mode=="Load":
print("loading data")
if color_image=="Red":
loaded_picture=self.load_combiner(color_saver="Red")
if loaded_picture[0]==0:
print("nothing found")
self.channel_thumb_combiner_red.setPixmap(QtGui.QPixmap(default_picture))
stored_combiner_files[0]=0
else:
self.channel_thumb_combiner_red.setPixmap(QtGui.QPixmap(loaded_picture[1]))
stored_combiner_files[0]=loaded_picture[0]
elif color_image=="Green":
loaded_picture=self.load_combiner(color_saver="Green")
if loaded_picture[0]==0:
print("nothing found")
self.channel_thumb_combiner_green.setPixmap(QtGui.QPixmap(default_picture))
stored_combiner_files[1]=0
else:
self.channel_thumb_combiner_green.setPixmap(QtGui.QPixmap(loaded_picture[1]))
stored_combiner_files[1]=loaded_picture[0]
elif color_image=="Blue":
loaded_picture=self.load_combiner(color_saver="Blue")
if loaded_picture[0]==0:
print("nothing found")
self.channel_thumb_combiner_blue.setPixmap(QtGui.QPixmap(default_picture))
stored_combiner_files[2]=0
else:
self.channel_thumb_combiner_blue.setPixmap(QtGui.QPixmap(loaded_picture[1]))
stored_combiner_files[2]=loaded_picture[0]
elif color_image=="Alpha":
loaded_picture=self.load_combiner(color_saver="Alpha")
if loaded_picture[0]==0:
print("nothing found")
self.channel_thumb_combiner_alpha.setPixmap(QtGui.QPixmap(default_picture))
stored_combiner_files[3]=0
#os.remove(default_picture)
else:
self.channel_thumb_combiner_alpha.setPixmap(QtGui.QPixmap(loaded_picture[1]))
stored_combiner_files[3]=loaded_picture[0]
print(stored_combiner_files)
else:
print("not work")
#####all the functions for doing stuff for converting
def file_size_getter(self):
#size multi
#positions are tga, webp, png, jpeg then the scaler type corresponds what its converting FROM into
print("null")
def resetting_size_of_thumb (self):
##rescale text setting
##default is All Loaded Images will be rescaled to 0 by 0
loaded_index=thumbnail_current_loaded-1
with PIL.Image.open(stored_images[loaded_index]) as image_thumb:
size_of_picture=image_thumb.size
rescale_width=size_of_picture[0]
rescale_heighth=size_of_picture[1]
rescale_x=str(size_of_picture[0])
rescale_y=str(size_of_picture[1])
rescale_text="All Loaded Images will be rescaled to "+rescale_x+" by "+rescale_y
self.label_reuse_scale_option_text.setText(rescale_text)
####################### sets thumbnail on the left and controls which one is active in batchmode ###############
def setting_thumbnail(self,direction):
print("setting ui thumb image")
global thumbnail_current_loaded
global thumbnail_counter
if len(stored_images)!=0:
print("not empty working")
thumbnail_counter=len(stored_images)
if direction=="increase":
print("increasing number")
thumbnail_current_loaded+=1
if thumbnail_current_loaded>thumbnail_counter:
thumbnail_current_loaded=1
elif direction=="decrease":
print("decrease number")
thumbnail_current_loaded-=1
if thumbnail_current_loaded<=0:
thumbnail_current_loaded=thumbnail_counter
#sets the text correctly
#now to set image you can see
filename=stored_images[(thumbnail_current_loaded-1)]
im = PIL.Image.open(filename)
#im=Image.convert(im,"RGBA")
##if the file is not wide enough for preview get tallest then pad it
thumbnail_scale=im.size
if thumbnail_scale[0]!=thumbnail_scale[1]:
temp_image=im
if thumbnail_scale[0]>thumbnail_scale[1]:
print("thumbnail is wider than tall")
im = PIL.ImageOps.pad(image=temp_image, size=(thumbnail_scale[0],thumbnail_scale[0]))
if thumbnail_scale[0]<thumbnail_scale[1]:
print("thumbnail is wider than tall")
im = PIL.ImageOps.pad(image=temp_image, size=(thumbnail_scale[1],thumbnail_scale[1]))
thumb_file_loc=os.getcwd()+"thumb.PNG"
im.save(thumb_file_loc, "PNG")
#im.show()
print("made thumbnail now loadin")
self.label_Thumbnail_Preview.setPixmap(QtGui.QPixmap(thumb_file_loc))
#self.message_confirmation()
self.resetting_size_of_thumb()
print("moved")
else:
print("defaulting")
self.label_Thumbnail_Preview.setPixmap(QtGui.QPixmap(default_picture))
counter_text=str(thumbnail_current_loaded)+"/"+str(thumbnail_counter)
self.lbl_thumb_counter.setText(counter_text)
self.file_size_getter()
####################### searches for file to load into master ui for rescale and file convert ###############
def searching_file(self):
##selecting image file
stored_images.clear()
file_dialog = QFileDialog(DaisyWindow)
file_dialog.setWindowTitle("Open File")
file_dialog.setFileMode(QFileDialog.FileMode.ExistingFiles)
file_dialog.setViewMode(QFileDialog.ViewMode.Detail)
file_dialog.setNameFilters(["Images (*.png *.webp *.jpeg *.heic *.gif *.tga *.jpg *.tiff)"])
if file_dialog.exec():
selected_files = file_dialog.selectedFiles()
numb_files=len(selected_files)
message_confirm=self.message_confirmation(message_type="Warning to Proceed",file_amount=numb_files,action_detail=" load")
if message_confirm=="Yes":
global thumbnail_counter
global thumbnail_current_loaded
for image_file in selected_files:
#count em
numb_files=len(selected_files)
if numb_files>1:
#message_multi="Total number of "+str(numb_files)+" files have been loaded!"
#self.label_name_current_file.setText(message_multi)
self.label_Thumbnail_Preview.setPixmap(QtGui.QPixmap(default_picture))
else:
shorter_name=str(selected_files[0])[-15:]
#message_multi="Loaded /../.."+shorter_name
#self.label_name_current_file.setText(message_multi)
self.label_Thumbnail_Preview.setPixmap(QtGui.QPixmap(selected_files[0]))
print('name of it is '+str(image_file))
stored_images.append(image_file)
#self.label_file_counter.setText("You have selected "+str(numb_files)+" files for converting.")
thumbnail_counter=numb_files
thumbnail_current_loaded=1
self.setting_thumbnail(direction="none")
##rescale text setting
##default is All Loaded Images will be rescaled to 0 by 0
loaded_index=thumbnail_current_loaded-1
with PIL.Image.open(stored_images[loaded_index]) as image_thumb:
size_of_picture=image_thumb.size
rescale_width=size_of_picture[0]
rescale_heighth=size_of_picture[1]
rescale_x=str(size_of_picture[0])
rescale_y=str(size_of_picture[1])
rescale_text="All Loaded Images will be rescaled to "+rescale_x+" by "+rescale_y
self.label_reuse_scale_option_text.setText(rescale_text)
else:
self.label_Thumbnail_Preview.setPixmap(QtGui.QPixmap(default_picture))
#self.label_name_current_file.setText('No files are loaded for converting!')
#self.label_file_counter.setText("You have selected 0 files for converting.")
thumbnail_counter=0
#check the array
print(stored_images)
self.file_size_getter()
####################### convert files to different prefix and predict how much it will take memory wise ###############
def convert_files(self):
numb_files=len(stored_images)
if numb_files==0:
message_confirm=self.message_confirmation(message_type="Ok",file_amount=0,action_detail=" convert")
elif numb_files!=0:
message_confirm=self.message_confirmation(message_type="Warning to Proceed",file_amount=numb_files,action_detail=" convert")
if message_confirm=="Yes":
try:
for filename in stored_images:
prefix_index=self.combo_file_types.currentIndex()
#chosen_prefix=str(dropdown_endings[prefix_index])
#print("chosen prefix rn is "+chosen_prefix)
#chosen_prefix=str(conv_to[cb.current()])
#stops jpegs making more of itself
check_if_same_1=False
check_if_same_2=False
if prefix_index==3:
print("detected jpeg now checking")
chosen_prefix=str(dropdown_endings[prefix_index])
check_if_same_1=filename.endswith(chosen_prefix)
chosen_prefix=str(dropdown_endings[prefix_index+1])
check_if_same_2=filename.endswith(chosen_prefix)
chosen_prefix=str(dropdown_endings[prefix_index])
else:
print("not jpeg")
chosen_prefix=str(dropdown_endings[prefix_index])
check_if_same_1=filename.endswith(chosen_prefix)
#fails if same does not waste convert
if check_if_same_1 or check_if_same_2:
print("same file end skipping")
else:
print("not same file end converting woohoo")
strip_filename=filename[:filename.rfind('.')]
#making file name and using set directory for exporting
new_filename=strip_filename+str(chosen_prefix)
file_save_pref=chosen_prefix.removeprefix('.')
print("SAVING AS "+str(file_save_pref))
##fixing the issue where it wont save if its got alpha channel due to jpegs
just_file_name=os.path.basename(strip_filename)
new_filename_final=save_file_path_split_comb+"/"+just_file_name+str(chosen_prefix)
print(new_filename_final)
if self.box_optimise_2.isChecked()==True:
print("overwrite check is on!")
new_filename_final=new_filename
im = PIL.Image.open(filename)
if im.mode=="I;16":
numpy_array = np.array(im, dtype=np.uint16)
numpy_array = (numpy_array / 257).astype(np.uint8)
im = Image.fromarray(numpy_array, "L")
if file_save_pref=="jpeg" or file_save_pref=="jpg":
checking_mode=str(im.mode)
if checking_mode=="RGBA":
print("its got rgba so converting")
im = PIL.Image.open(filename).convert("RGB")
#rest of chekables applied here and quality
print("the optimise checkbox is "+str(self.box_optimise.isChecked()))
print("the quality setting is set to "+str(self.spn_save_quality.value()))
#FIXING TGA SAVE ISSUE
if file_save_pref=="tga":
im = PIL.Image.open(filename).convert("RGBA")
im.save(new_filename_final, "tga") #quality=int(self.spn_save_quality.value())
elif file_save_pref!="tga":
im.save(new_filename_final, file_save_pref,optimize=self.box_optimise.isChecked(),quality=int(self.spn_save_quality.value())) #quality=int(self.spn_save_quality.value())
print("succeeded in converting " +str(filename))
if check_if_same_1 or check_if_same_2:
print("same file end skipping")
message_confirm=self.message_confirmation(message_type="Ok",file_amount="skipping",action_detail=" convert as same file type")
else:
message_confirm=self.message_confirmation(message_type="Success",file_amount=numb_files,action_detail=" converted")
except:
caution=self.message_confirmation(message_type="Ok",file_amount="",action_detail=" complete processing files as something went wrong. Quitting")
####################### clears ui thumbnails and data if button pressed ###############
def clear_old_files(self):
global thumbnail_counter
global thumbnail_current_loaded
if thumbnail_current_loaded!=0:
message_confirm=self.message_confirmation(message_type="Warning to Proceed",file_amount=thumbnail_counter,action_detail=" clear ")
if message_confirm=="Yes":
thumbnail_counter=0
thumbnail_current_loaded=0
clear_counter=len(stored_images)
stored_images.clear()
self.label_Thumbnail_Preview.setPixmap(QtGui.QPixmap(default_picture))
print("clearing from data about "+str(clear_counter)+" entries")
#self.label_name_current_file.setText('No files are loaded for converting!')
# #put window here
self.file_size_getter()
self.setting_thumbnail(direction="none")
else:
message_confirm=self.message_confirmation(message_type="Ok",file_amount=0,action_detail=" clear ")
########### open filepath ##############
def open_path_set(self):
print("opening file path")
os.startfile(save_file_path_split_comb)
####################### text for previously init ui elements above ###############
def retranslateUi(self, DaisyWindow):
_translate = QtCore.QCoreApplication.translate
DaisyWindow.setWindowTitle(_translate("DaisyWindow", "DaisyWindow"))
self.label_intro_convert_type.setText(_translate("DaisyWindow", "Convert To File Type:"))
self.combo_file_types.setPlaceholderText(_translate("DaisyWindow", "Debug placeholder text"))
self.spn_save_quality.setSuffix(_translate("DaisyWindow", "%"))
self.box_optimise.setText(_translate("DaisyWindow", "Apply Optimisation"))
self.button_convert_loaded.setText(_translate("DaisyWindow", "Convert to File Type"))
self.label_intro_convert_type_2.setText(_translate("DaisyWindow", "Percent to Keep:"))
self.label_intro_convert_type_5.setText(_translate("DaisyWindow", "Ensure files are loaded into the right before using this tool."))
self.label_intro_convert_type_6.setText(_translate("DaisyWindow", "Swap to different utility modes to adjust, fix or optimise textures files."))
self.label_intro_convert_type_7.setText(_translate("DaisyWindow", "Any bugs please report to Jesse"))
self.tabs_functions.setTabText(self.tabs_functions.indexOf(self.tab), _translate("DaisyWindow", "File Format Converter"))
self.checkBox_only_scale_loaded.setText(_translate("DaisyWindow", "Scale Loaded Thumbnail Only"))
self.label_current_resolution_rescaler.setText(_translate("DaisyWindow", ""))
self.label_4.setText(_translate("DaisyWindow", "Texture Resolutions:"))
self.tabs_rescale_function.setTabText(self.tabs_rescale_function.indexOf(self.set_scale_tab), _translate("DaisyWindow", "Set Scale"))
self.spinBox_rescale_percentage.setSuffix(_translate("DaisyWindow", "%"))
self.checkBox_apply_to_width.setText(_translate("DaisyWindow", "Image Width"))
self.checkBox_apply_to_height.setText(_translate("DaisyWindow", "Image Height"))
self.label.setText(_translate("DaisyWindow", "Percentage:"))
self.label_intro_convert_type_4.setText(_translate("DaisyWindow", "Apply Percentage Rescale To:"))
self.tabs_rescale_function.setTabText(self.tabs_rescale_function.indexOf(self.percent_tab), _translate("DaisyWindow", "Percent"))
self.label_reuse_scale_option_text.setText(_translate("DaisyWindow", "0 Images will be rescaled to 0 by 0"))
self.tabs_rescale_function.setTabText(self.tabs_rescale_function.indexOf(self.tab_3), _translate("DaisyWindow", "Reuse Scale"))
self.label_2.setText(_translate("DaisyWindow", "Width:"))
self.label_3.setText(_translate("DaisyWindow", "Height:"))
self.button_autofill_custom_data.setText(_translate("DaisyWindow", "Autofill from Preview"))
self.tabs_rescale_function.setTabText(self.tabs_rescale_function.indexOf(self.Custom_Tab), _translate("DaisyWindow", "Custom"))
self.checkBox_overwrite_rescale.setText(_translate("DaisyWindow", "Overwrite Original File"))
self.button_rescale_images.setText(_translate("DaisyWindow", "Rescale Using Chosen Mode"))
self.label_intro_convert_type_3.setText(_translate("DaisyWindow", "Rescaler Settings:"))
self.tabs_functions.setTabText(self.tabs_functions.indexOf(self.tab_2), _translate("DaisyWindow", "Size Rescaler"))
self.label_11.setText(_translate("DaisyWindow", "Save Format for Files:"))
self.button_combine_final.setText(_translate("DaisyWindow", "Combine"))
self.label_expor_size_combiner.setText(_translate("DaisyWindow", "Export Final File Size:"))
self.button_clear_red_channel.setText(_translate("DaisyWindow", "Clear Red Image"))
self.button_load_red_channel.setText(_translate("DaisyWindow", "Load Red Image"))
self.button_clear_green_channel.setText(_translate("DaisyWindow", "Clear Green Image"))
self.button_load_green_channel.setText(_translate("DaisyWindow", "Load Green Image"))
self.button_clear_blue_channel.setText(_translate("DaisyWindow", "Clear Blue Image"))
self.button_load_blue_channel.setText(_translate("DaisyWindow", "Load Blue Image"))
self.button_clear_alpha_channel.setText(_translate("DaisyWindow", "Clear Alpha Image"))
self.button_load_alpha_channel.setText(_translate("DaisyWindow", "Load Alpha Image"))
self.tabs_functions.setTabText(self.tabs_functions.indexOf(self.tab_splitter_combiner), _translate("DaisyWindow", "Combiner"))
self.button_split_channels.setText(_translate("DaisyWindow", "Split Preview Image to Maps"))
self.label_12.setText(_translate("DaisyWindow", "Save Format for Files:"))
self.button_clear_images_splitter.setText(_translate("DaisyWindow", "Export Split Maps"))
self.label_expor_size_splitter.setText(_translate("DaisyWindow", "Export Final File Size:"))
self.chbox_red_channel.setText(_translate("DaisyWindow", "Enable Red Channel"))
self.chbox_green_channel.setText(_translate("DaisyWindow", "Enable Green Channel"))
self.chbox_blue_channel.setText(_translate("DaisyWindow", "Enable Blue Channel"))
self.chbox_alpha_channel.setText(_translate("DaisyWindow", "Enable Alpha Channel"))
self.tabs_functions.setTabText(self.tabs_functions.indexOf(self.tab_4), _translate("DaisyWindow", "Splitter"))
self.label_5.setText(_translate("DaisyWindow", "Convert Maps FROM"))
self.label_6.setText(_translate("DaisyWindow", "Convert Maps FOR"))
self.button_load_ambient_occlusion.setText(_translate("DaisyWindow", "Load Ambient Occlusion Map"))
self.button_load_packed.setText(_translate("DaisyWindow", "Load Packed Map"))
self.button_load_normals.setText(_translate("DaisyWindow", "Load Normal Map"))
self.button_convert_engine_maps.setText(_translate("DaisyWindow", "Convert Maps"))
self.tabs_functions.setTabText(self.tabs_functions.indexOf(self.tab_5), _translate("DaisyWindow", "Remapper"))
self.label_8.setText(_translate("DaisyWindow", "0,1"))
self.label_13.setText(_translate("DaisyWindow", "1,0"))
self.label_14.setText(_translate("DaisyWindow", "1,1"))
self.button_load_atlas_1.setText(_translate("DaisyWindow", "Load Map 1"))
self.button_load_atlas_2.setText(_translate("DaisyWindow", "Load Map 2"))
self.button_load_atlas_3.setText(_translate("DaisyWindow", "Load Map 3"))
self.button_load_atlas_4.setText(_translate("DaisyWindow", "Load Map 4"))
self.label_7.setText(_translate("DaisyWindow", "0,0"))
self.button_create_texture_atlas.setText(_translate("DaisyWindow", "Combine to Texture Atlas Sheet"))
self.label_expor_size_splitter_2.setText(_translate("DaisyWindow", "Export Final Atlas Size:"))
self.tabs_functions.setTabText(self.tabs_functions.indexOf(self.tab_6), _translate("DaisyWindow", "Atlas Packer"))
self.l_Title.setText(_translate("DaisyWindow", "TEXTURE UTILITY TOOL"))
self.label_save_loc_show_combiner_2.setText(_translate("DaisyWindow", ".../.../User/Downloads/"))
self.button_set_save_location.setText(_translate("DaisyWindow", "Set Output Location"))
self.box_optimise_2.setText(_translate("DaisyWindow", "Output to Existing File Path"))
self.button_thumb_right.setText(_translate("DaisyWindow", ">"))
self.button_thumb_left.setText(_translate("DaisyWindow", "<"))
self.lbl_thumb_counter.setText(_translate("DaisyWindow", "0/0"))
self.button_select_images.setText(_translate("DaisyWindow", "Load Images"))
self.button_clear_images.setText(_translate("DaisyWindow", "Clear Images"))
self.l_Output_Log_3.setText(_translate("DaisyWindow", "PREVIEW"))
self.bn_open_save_path.setText(_translate("DaisyWindow", "Open Path"))
self.label_atlas_save_format.setText(_translate("DaisyWindow", "Save Format:"))
####################### starts the main exec script loop ###############
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
DaisyWindow = QtWidgets.QMainWindow()
DaisyWindow.setWindowIcon(QtGui.QIcon(daisy_icon))
app.setWindowIcon(QtGui.QIcon(daisy_icon))
ui = Ui_DaisyWindow()
ui.setupUi(DaisyWindow)
DaisyWindow.show()
sys.exit(app.exec())
Editor is loading...
Leave a Comment