You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.5 KiB
Python

import os
from pymxs import runtime as rt
def configure_plugin():
try:
print("=== CONFIGURANDO COMPONENTES INTERNOS VR4LIFE ===")
# 1. Define o caminho onde os scripts foram salvos (o diretório atual deste arquivo)
plugin_dir = os.path.dirname(os.path.realpath(__file__)).replace("\\", "/")
# 2. Adiciona a pasta do plugin ao PATH do Python do 3ds Max
# Isso permite que você dê 'import vr4life_engine' de qualquer lugar
import sys
if plugin_dir not in sys.path:
sys.path.append(plugin_dir)
print(f"Path adicionado ao Python: {plugin_dir}")
# 3. Se você precisar registrar algum atalho de teclado ou MacroScript, faça aqui.
# Exemplo: Registrar o comando que o botão do menu vai chamar
macro_script = f"""
macroScript VR4Life_Launcher
category:"VR4Life"
tooltip:"Abrir VR4Life"
(
python.executeFile @{plugin_dir}/run_vr4life.py@
)
"""
rt.execute(macro_script)
print("MacroScript VR4Life_Launcher registrado com sucesso.")
# 4. Forçar o 3ds Max a atualizar a interface para o menu aparecer
# (Opcional, às vezes o Max precisa reiniciar para ler o .mnx novo)
rt.menuMan.updateMenuBar()
print("=== PLUGIN VR4LIFE PRONTO PARA USO ===")
return True
except Exception as e:
print(f"Erro na configuração final: {str(e)}")
return False
if __name__ == "__main__":
configure_plugin()