Compare commits

..

No commits in common. '00a789c410ac3800279c7b5e1efedfc859103239' and '681b5b2fe3347110af014bb14c6b617f4ef810d5' have entirely different histories.

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