ayon-core/openpype/hosts/max/hooks/inject_python.py
Jakub Trllo c9cf6646f7
AYON: 3dsMax settings (#5401)
* create copy of 3dsmax settings instead of removing it

* keep '3dsmax' as 'adsk_3dsmax'
2023-08-03 15:08:19 +02:00

20 lines
665 B
Python

# -*- coding: utf-8 -*-
"""Pre-launch hook to inject python environment."""
import os
from openpype.lib.applications import PreLaunchHook, LaunchTypes
class InjectPythonPath(PreLaunchHook):
"""Inject OpenPype environment to 3dsmax.
Note that this works in combination whit 3dsmax startup script that
is translating it back to PYTHONPATH for cases when 3dsmax drops PYTHONPATH
environment.
Hook `GlobalHostDataHook` must be executed before this hook.
"""
app_groups = {"3dsmax", "adsk_3dsmax"}
launch_types = {LaunchTypes.local}
def execute(self):
self.launch_context.env["MAX_PYTHONPATH"] = os.environ["PYTHONPATH"]