diff --git a/__pycache__/vr4life_engine.cpython-310.pyc b/__pycache__/vr4life_engine.cpython-310.pyc index bd82018..ac3d02b 100644 Binary files a/__pycache__/vr4life_engine.cpython-310.pyc and b/__pycache__/vr4life_engine.cpython-310.pyc differ diff --git a/__pycache__/vr4life_ui.cpython-310.pyc b/__pycache__/vr4life_ui.cpython-310.pyc index d7dda97..75d28bd 100644 Binary files a/__pycache__/vr4life_ui.cpython-310.pyc and b/__pycache__/vr4life_ui.cpython-310.pyc differ diff --git a/vr4_state.json b/vr4_state.json index 489f4c9..034fa49 100644 --- a/vr4_state.json +++ b/vr4_state.json @@ -1 +1 @@ -[{"name": "ETICHETTA", "status": "DONE V19", "polys": "5,966", "res": "256px", "id": "60.0"}, {"name": "Object003", "status": "DONE V19", "polys": "7,470", "res": "1024px", "id": "2394.0"}, {"name": "ETICHE_005", "status": "DONE V19", "polys": "2,977", "res": "256px", "id": "56.0"}, {"name": "IMBOTT_002", "status": "DONE V19", "polys": "6,628", "res": "1024px", "id": "2751.4"}, {"name": "Object005", "status": "DONE V19", "polys": "2,846", "res": "1024px", "id": "2456.7"}, {"name": "Object004", "status": "DONE V19", "polys": "2,962", "res": "1024px", "id": "1377.5"}, {"name": "Object006", "status": "DONE V19", "polys": "2,878", "res": "1024px", "id": "764.3"}, {"name": "CUCITURE", "status": "DONE V19", "polys": "936", "res": "256px", "id": "65.8"}] \ No newline at end of file +[{"name": "3d66-Editable_Poly-23107237-414", "status": "Pronto", "polys": "27,680", "res": "2048px", "id": "979.0"}, {"name": "3d66-Editable_Poly-23107237-415", "status": "Pronto", "polys": "15,776", "res": "2048px", "id": "797.2"}, {"name": "3d66diban-020", "status": "Pronto", "polys": "600", "res": "2048px", "id": "861.0"}] \ No newline at end of file diff --git a/vr4life_engine.py b/vr4life_engine.py index b7051c8..0ae9cdd 100644 --- a/vr4life_engine.py +++ b/vr4life_engine.py @@ -500,14 +500,8 @@ def process_bake_logic_v19(ui, auto_export=False): ) ------------------------------------------------------------------------- - -- 4. MATERIAL CREATION + -- 4. MATERIAL CREATION (MOVED TO EXPORT ENGINE P7) ------------------------------------------------------------------------- - local newMat = PhysicalMaterial() - newMat.name = (obj.name + "_Baked_Mat") - newMat.base_color = color 255 255 255 - newMat.roughness = 1.0 - newMat.emission = 0.0 - local fileFound = false local waitForFile = 0 while (waitForFile < 50) and (fileFound == false) do ( @@ -515,12 +509,7 @@ def process_bake_logic_v19(ui, auto_export=False): else ( sleep 0.1; waitForFile += 1 ) ) - if fileFound then ( - local bmpTex = BitmapTexture filename:be.filename - if {tgt_uv_state} == 2 then bmpTex.coords.mapChannel = 2 else bmpTex.coords.mapChannel = 1 - newMat.base_color_map = bmpTex - showTextureMap newMat newMat.base_color_map on - ) else ( + if not fileFound do ( print ("ERROR: Texture file not found: " + be.filename) return -2 ) @@ -529,13 +518,8 @@ def process_bake_logic_v19(ui, auto_export=False): -- 5. FINAL CLEANUP ------------------------------------------------------------------------- sleep 1.0 - obj.material = newMat - - if {tgt_uv_state} == 1 then ( - channelInfo.CopyChannel obj 3 2 - channelInfo.PasteChannel obj 3 1 - channelInfo.ClearChannel obj 2 - ) + -- Preserva o material original da tela e nao suja a viewport! + collapseStack obj return 1 ) catch ( @@ -592,6 +576,9 @@ def export_glb_v19(ui): mprint("Aviso: Nenhum item valido na lista para exportar.") return + p_bk = ui.edt_p_bake.text().replace("\\", "/") + if not p_bk.endswith("/"): p_bk += "/" + tgt_uv = 2 if ui.rdo_uv2.isChecked() else 1 if len(tgs) == 1: f_name = f"{tgs[0]['name']}_Export" @@ -618,7 +605,33 @@ def export_glb_v19(ui): c.name = orig.name + "_EXP" convertToPoly c -- Forca o colapso de toda a arvore antes de manipular a UV - -- APENAS CLONAR PARA EXPORTACAO, SEM MANIPULAR UV OU MATERIAIS + -- APLICA O NOVO MATERIAL E A NOVA UV APENAS NO CLONE QUE VAI SER EXPORTADO + local pBk = @"{p_bk}" + local fileExt = ".jpg" + local texPath = (pBk + orig.name + "_Baked" + fileExt) + + if doesFileExist texPath do ( + local newMat = PhysicalMaterial() + newMat.name = (orig.name + "_GLTF_Mat") + -- GLTF PBR Padrao: Textura limpa no Base Color sem frescuras + newMat.base_color = color 255 255 255 + newMat.roughness = 1.0 + newMat.emission = 0.0 + + local bmpTex = BitmapTexture filename:texPath + bmpTex.coords.mapChannel = 1 + newMat.base_color_map = bmpTex + + c.material = newMat + ) + + if {tgt_uv} == 2 do ( + try ( channelInfo.CopyChannel c 3 2 ) catch() + try ( channelInfo.PasteChannel c 3 1 ) catch() + try ( channelInfo.ClearChannel c 2 ) catch() + ) + + collapseStack c append clones c ) ) diff --git a/vr4life_ui.py b/vr4life_ui.py index f303e55..41a5045 100644 --- a/vr4life_ui.py +++ b/vr4life_ui.py @@ -21,7 +21,7 @@ def get_max_window_safe(): class AutoBakeManager(QtWidgets.QDialog): def __init__(self): super(AutoBakeManager, self).__init__(get_max_window_safe()) - self.setWindowTitle("VR4LIFE AUTO-BAKE V312 - MODULAR ENTERPRISE") + self.setWindowTitle("VR4LIFE AUTO-BAKE V313 - MODULAR ENTERPRISE") self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowMinimizeButtonHint | QtCore.Qt.WindowMaximizeButtonHint | QtCore.Qt.WindowCloseButtonHint) self.resize(570, 890); self.bake_items = []; self._is_cancelled = False p = self.palette(); p.setColor(QtGui.QPalette.Window, QtGui.QColor(43, 43, 43)); self.setPalette(p); self.setAutoFillBackground(True) @@ -31,7 +31,8 @@ class AutoBakeManager(QtWidgets.QDialog): def init_ui(self): layout = QtWidgets.QVBoxLayout(self) # --- TOP HEADER --- - lbl_t = QtWidgets.QLabel("VR4LIFE - V312 (Modular) ( ultima alteração 2:56 AM 11-03- 2026)"); lbl_t.setAlignment(QtCore.Qt.AlignCenter); lbl_t.setStyleSheet("font-size: 24px; font-weight: bold; color: #00FF00;") + # ultima alteração 2:56 AM 11-03- 2026 + lbl_t = QtWidgets.QLabel("VR4LIFE - V313 (Modular)"); lbl_t.setAlignment(QtCore.Qt.AlignCenter); lbl_t.setStyleSheet("font-size: 24px; font-weight: bold; color: #00FF00;") layout.addWidget(lbl_t) self.tabs = QtWidgets.QTabWidget()