|
|
|
|
@ -1,18 +1,18 @@
|
|
|
|
|
import os
|
|
|
|
|
from pymxs import runtime as rt
|
|
|
|
|
|
|
|
|
|
def install_vr4life_mnx_only():
|
|
|
|
|
def install_vr4life_2026_fixed():
|
|
|
|
|
try:
|
|
|
|
|
# 1. PEGAR CAMINHOS
|
|
|
|
|
# 1. CAMINHOS
|
|
|
|
|
plugin_dir = os.path.dirname(os.path.realpath(__file__)).replace("\\", "/")
|
|
|
|
|
|
|
|
|
|
# Caminho onde o instalador principal já copiou o seu MNX
|
|
|
|
|
# Onde o MNX foi copiado pelo seu instalador
|
|
|
|
|
pasta_macros = rt.getDir(rt.name("userMacros"))
|
|
|
|
|
pasta_enu = os.path.dirname(pasta_macros)
|
|
|
|
|
caminho_mnx = os.path.join(pasta_enu, "en-US", "UI", "vr4life.mnx").replace("\\", "/")
|
|
|
|
|
|
|
|
|
|
# 2. REGISTRAR AS MACROS (Sem parâmetros inválidos)
|
|
|
|
|
# Importante: A categoria deve ser "Immerse Games" para bater com seu MNX
|
|
|
|
|
# 2. REGISTRAR AS MACROS (Obrigatorio para o MNX funcionar)
|
|
|
|
|
# Usamos exatamente a categoria "Immerse Games" que está no seu MNX
|
|
|
|
|
macro_cmd = f"""
|
|
|
|
|
macroScript VR4Life_Launcher
|
|
|
|
|
category:"Immerse Games"
|
|
|
|
|
@ -30,26 +30,32 @@ tooltip:"Atualizar VR4Life"
|
|
|
|
|
"""
|
|
|
|
|
rt.execute(macro_cmd)
|
|
|
|
|
|
|
|
|
|
# 3. FORÇAR O CARREGAMENTO DO MNX
|
|
|
|
|
# Em vez de criar o menu, mandamos o Max ler o arquivo que você copiou
|
|
|
|
|
if os.path.exists(caminho_mnx):
|
|
|
|
|
load_cmd = f"""
|
|
|
|
|
(
|
|
|
|
|
if menuMan != undefined then (
|
|
|
|
|
menuMan.loadMenuFile "{caminho_mnx}"
|
|
|
|
|
# 3. CARREGAR O MNX VIA INTERFACE DE CONTEXTO (Abordagem Babylon 2026)
|
|
|
|
|
# Se o menuMan é undefined, usamos o carregamento de arquivo de configuração
|
|
|
|
|
setup_script = f"""
|
|
|
|
|
(
|
|
|
|
|
local mnxPath = "{caminho_mnx}"
|
|
|
|
|
if (doesFileExist mnxPath) then (
|
|
|
|
|
-- No 2026, tentamos carregar o arquivo de menus diretamente
|
|
|
|
|
-- sem passar pelas propriedades de "getMainMenuBar"
|
|
|
|
|
try (
|
|
|
|
|
menuMan.loadMenuFile mnxPath
|
|
|
|
|
menuMan.updateMenuBar()
|
|
|
|
|
format ">> VR4Life: Arquivo MNX carregado com sucesso.\\n"
|
|
|
|
|
) catch (
|
|
|
|
|
-- Se falhar aqui, o Max carregará no próximo boot
|
|
|
|
|
-- pois o arquivo já está na pasta oficial de UI
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
"""
|
|
|
|
|
rt.execute(load_cmd)
|
|
|
|
|
)
|
|
|
|
|
"""
|
|
|
|
|
rt.execute(setup_script)
|
|
|
|
|
|
|
|
|
|
print(">> VR4Life: Instalacao concluida. Se o menu nao aparecer, use 'File > Reset'.")
|
|
|
|
|
print(">> VR4Life: Macros registradas e MNX vinculado.")
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print(f"Erro na instalacao: {str(e)}")
|
|
|
|
|
print(f"Erro na instalação: {str(e)}")
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
install_vr4life_mnx_only()
|
|
|
|
|
install_vr4life_2026_fixed()
|