|
|
|
|
@ -8,8 +8,8 @@ def carregar_menu_mnx():
|
|
|
|
|
print("="*50)
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
# 1. Definir caminhos
|
|
|
|
|
pasta_macros = rt.pathConfig.getDir(rt.name("userMacros"))
|
|
|
|
|
# 1. Definir caminhos (Usando barras normais / para evitar conflitos)
|
|
|
|
|
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("\\", "/")
|
|
|
|
|
plugin_dir = os.path.dirname(os.path.realpath(__file__)).replace("\\", "/")
|
|
|
|
|
@ -19,36 +19,40 @@ def carregar_menu_mnx():
|
|
|
|
|
print(f"[*] Caminho do MNX: {caminho_mnx}")
|
|
|
|
|
|
|
|
|
|
# 2. Registrar MacroScript
|
|
|
|
|
print("[*] Registrando MacroScript VR4Life_Launcher...")
|
|
|
|
|
macro_cmd = f'macroScript VR4Life_Launcher category:"Immerse Games" tooltip:"Abrir VR4Life" (on execute do python.executeFile "{run_script}")'
|
|
|
|
|
macro_cmd = (
|
|
|
|
|
'macroScript VR4Life_Launcher\n'
|
|
|
|
|
'category:"Immerse Games"\n'
|
|
|
|
|
'tooltip:"Abrir VR4Life"\n'
|
|
|
|
|
'(\n'
|
|
|
|
|
f' on execute do python.executeFile "{run_script}"\n'
|
|
|
|
|
')'
|
|
|
|
|
)
|
|
|
|
|
rt.execute(macro_cmd)
|
|
|
|
|
|
|
|
|
|
# 3. Carregar MNX
|
|
|
|
|
# 3. Carregar MNX (Corrigido para evitar o erro de sintaxe @C)
|
|
|
|
|
if os.path.exists(caminho_mnx):
|
|
|
|
|
print(f"[!] Arquivo MNX encontrado. Solicitando carregamento ao 3ds Max...")
|
|
|
|
|
|
|
|
|
|
# Comando com verificação interna do MaxScript
|
|
|
|
|
cmd_load = f"""
|
|
|
|
|
(
|
|
|
|
|
if menuMan != undefined then (
|
|
|
|
|
local result = menuMan.loadMenuFile @{caminho_mnx}@
|
|
|
|
|
menuMan.updateMenuBar()
|
|
|
|
|
format ">> MaxScript: loadMenuFile result: %\\n" result
|
|
|
|
|
) else (
|
|
|
|
|
format ">> MaxScript Erro: menuMan ainda e undefined\\n"
|
|
|
|
|
)
|
|
|
|
|
print(f"[!] Arquivo MNX encontrado. Solicitando carregamento...")
|
|
|
|
|
|
|
|
|
|
# Aqui usamos aspas duplas e formatamos o caminho para o MaxScript
|
|
|
|
|
cmd_load = (
|
|
|
|
|
'(\n'
|
|
|
|
|
' if menuMan != undefined then (\n'
|
|
|
|
|
f' local result = menuMan.loadMenuFile "{caminho_mnx}"\n'
|
|
|
|
|
' menuMan.updateMenuBar()\n'
|
|
|
|
|
' format ">> MaxScript: loadMenuFile result: %\\n" result\n'
|
|
|
|
|
' ) else (\n'
|
|
|
|
|
' format ">> MaxScript Erro: menuMan ainda e undefined\\n"\n'
|
|
|
|
|
' )\n'
|
|
|
|
|
')'
|
|
|
|
|
)
|
|
|
|
|
"""
|
|
|
|
|
rt.execute(cmd_load)
|
|
|
|
|
else:
|
|
|
|
|
print(f"[X] ERRO: Arquivo {caminho_mnx} NAO existe no disco.")
|
|
|
|
|
|
|
|
|
|
print("="*50)
|
|
|
|
|
print("FIM DO LOG DE INSTALAÇÃO")
|
|
|
|
|
print("="*50 + "\n")
|
|
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print(f"\n[EXCEPTION] Ocorreu uma falha grave:\n{str(e)}")
|
|
|
|
|
print(f"\n[EXCEPTION] Falha grave:\n{str(e)}")
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
carregar_menu_mnx()
|