forked from ynput/OpenPype
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenpype_menu.py
More file actions
36 lines (25 loc) · 1005 Bytes
/
openpype_menu.py
File metadata and controls
36 lines (25 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
import sys
import openpype
from openpype.api import Logger
log = Logger().get_logger(__name__)
def main(env):
# This script working directory starts in Fusion application folder.
# However the contents of that folder can conflict with Qt library dlls
# so we make sure to move out of it to avoid DLL Load Failed errors.
os.chdir("..")
from openpype.hosts.fusion.api import menu
import avalon.fusion
# Registers pype's Global pyblish plugins
openpype.install()
# activate resolve from pype
avalon.api.install(avalon.fusion)
log.info(f"Avalon registered hosts: {avalon.api.registered_host()}")
menu.launch_openpype_menu()
# Initiate a QTimer to check if Fusion is still alive every X interval
# If Fusion is not found - kill itself
# todo(roy): Implement timer that ensures UI doesn't remain when e.g.
# Fusion closes down
if __name__ == "__main__":
result = main(os.environ)
sys.exit(not bool(result))