modified prelaunch hook

This commit is contained in:
iLLiCiTiT 2021-11-26 16:10:11 +01:00
parent 37777f7877
commit a8e8f93fae
2 changed files with 15 additions and 7 deletions

View file

@ -1,3 +1,6 @@
import os
def add_implementation_envs(env, _app):
"""Modify environments to contain all required for implementation."""
defaults = {
@ -6,3 +9,12 @@ def add_implementation_envs(env, _app):
for key, value in defaults.items():
if not env.get(key):
env[key] = value
def get_launch_script_path():
current_dir = os.path.dirname(os.path.abspath(__file__))
return os.path.join(
current_dir,
"api",
"launch_script.py"
)

View file

@ -44,10 +44,6 @@ class TvpaintPrelaunchHook(PreLaunchHook):
self.launch_context.launch_args.extend(remainders)
def launch_script_path(self):
avalon_dir = os.path.dirname(os.path.abspath(avalon.__file__))
script_path = os.path.join(
avalon_dir,
"tvpaint",
"launch_script.py"
)
return script_path
from openpype.hosts.tvpaint import get_launch_script_path
return get_launch_script_path()