Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose function to locate workdir #20

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion client/ayon_harmony/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
find_node_by_name,
signature,
select_nodes,
get_scene_data
get_scene_data,
get_workdir
)

from .workio import (
Expand Down Expand Up @@ -78,6 +79,7 @@
"signature",
"select_nodes",
"get_scene_data",
"get_workdir",

# Workfiles API
"open_file",
Expand Down
9 changes: 7 additions & 2 deletions client/ayon_harmony/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ def launch(application_path, *args):

"""
from ayon_core.pipeline import install_host
from ayon_harmony import api as harmony
from ayon_harmony.api import HarmonyHost

install_host(harmony)
install_host(HarmonyHost())

ProcessContext.port = random.randrange(49152, 65535)
os.environ["AYON_HARMONY_PORT"] = str(ProcessContext.port)
Expand Down Expand Up @@ -401,6 +401,8 @@ def show(tool_name):
kwargs = {}
if tool_name == "loader":
kwargs["use_context"] = True
elif tool_name == "publisher":
kwargs["tab"] = "publish"
Comment on lines +404 to +405
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be in this PR.


ProcessContext.execute_in_main_thread(
lambda: host_tools.show_tool_by_name(tool_name, **kwargs)
Expand Down Expand Up @@ -636,3 +638,6 @@ def find_node_by_name(name, node_type):
return node

return None

def get_workdir():
return ProcessContext.workfile_path
Comment on lines +642 to +643
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isnt' the workfile path always kept "live" in AYON regardless, by using AYON_WORKDIR since it updates on task change?

So couldn't we technically just rely on AYON_WORKDIR?

Loading