mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
flame: small fixes
This commit is contained in:
parent
a24b43451d
commit
9913872a2a
2 changed files with 10 additions and 28 deletions
|
|
@ -27,13 +27,6 @@ log = Logger.get_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def install():
|
def install():
|
||||||
from .. import (
|
|
||||||
PUBLISH_PATH,
|
|
||||||
LOAD_PATH,
|
|
||||||
CREATE_PATH,
|
|
||||||
INVENTORY_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
# Disable all families except for the ones we explicitly want to see
|
# Disable all families except for the ones we explicitly want to see
|
||||||
family_states = [
|
family_states = [
|
||||||
"imagesequence",
|
"imagesequence",
|
||||||
|
|
@ -60,13 +53,6 @@ def install():
|
||||||
log.info("OpenPype Flame host installed ...")
|
log.info("OpenPype Flame host installed ...")
|
||||||
|
|
||||||
def uninstall():
|
def uninstall():
|
||||||
from .. import (
|
|
||||||
PUBLISH_PATH,
|
|
||||||
LOAD_PATH,
|
|
||||||
CREATE_PATH,
|
|
||||||
INVENTORY_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
pyblish.deregister_host("flame")
|
pyblish.deregister_host("flame")
|
||||||
|
|
||||||
log.info("Deregistering Flame plug-ins..")
|
log.info("Deregistering Flame plug-ins..")
|
||||||
|
|
@ -167,11 +153,11 @@ def imprint(segment, data=None):
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def maintained_selection():
|
def maintained_selection():
|
||||||
import flame
|
import flame
|
||||||
from .. import selection
|
from .lib import CTX
|
||||||
|
|
||||||
# check if segment is selected
|
# check if segment is selected
|
||||||
if isinstance(selection[0], flame.PySegment):
|
if isinstance(CTX.selection[0], flame.PySegment):
|
||||||
sequence = get_current_sequence(selection)
|
sequence = get_current_sequence(CTX.selection)
|
||||||
try:
|
try:
|
||||||
with maintained_segment_selection(sequence):
|
with maintained_segment_selection(sequence):
|
||||||
yield
|
yield
|
||||||
|
|
|
||||||
|
|
@ -19,20 +19,17 @@ class FlamePrelaunch(PreLaunchHook):
|
||||||
"""
|
"""
|
||||||
app_groups = ["flame"]
|
app_groups = ["flame"]
|
||||||
|
|
||||||
# todo: replace version number with avalon launch app version
|
|
||||||
flame_python_exe = os.getenv("OPENPYPE_FLAME_PYTHON_EXEC")
|
|
||||||
flame_pythonpath = os.getenv("OPENPYPE_FLAME_PYTHONPATH")
|
|
||||||
|
|
||||||
wtc_script_path = os.path.join(
|
wtc_script_path = os.path.join(
|
||||||
opflame.HOST_DIR, "api", "scripts", "wiretap_com.py")
|
opflame.HOST_DIR, "api", "scripts", "wiretap_com.py")
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
self._env = self.launch_context.env
|
||||||
|
self.flame_python_exe = self._env["OPENPYPE_FLAME_PYTHON_EXEC"]
|
||||||
|
self.flame_pythonpath = self._env["OPENPYPE_FLAME_PYTHONPATH"]
|
||||||
self.signature = "( {} )".format(self.__class__.__name__)
|
self.signature = "( {} )".format(self.__class__.__name__)
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
_env = self.launch_context.env
|
|
||||||
"""Hook entry method."""
|
"""Hook entry method."""
|
||||||
project_doc = self.data["project_doc"]
|
project_doc = self.data["project_doc"]
|
||||||
user_name = get_openpype_username()
|
user_name = get_openpype_username()
|
||||||
|
|
@ -60,9 +57,9 @@ class FlamePrelaunch(PreLaunchHook):
|
||||||
|
|
||||||
data_to_script = {
|
data_to_script = {
|
||||||
# from settings
|
# from settings
|
||||||
"host_name": _env.get("FLAME_WIRETAP_HOSTNAME") or hostname,
|
"host_name": self._env.get("FLAME_WIRETAP_HOSTNAME") or hostname,
|
||||||
"volume_name": _env.get("FLAME_WIRETAP_VOLUME"),
|
"volume_name": self._env.get("FLAME_WIRETAP_VOLUME"),
|
||||||
"group_name": _env.get("FLAME_WIRETAP_GROUP"),
|
"group_name": self._env.get("FLAME_WIRETAP_GROUP"),
|
||||||
"color_policy": "ACES 1.1",
|
"color_policy": "ACES 1.1",
|
||||||
|
|
||||||
# from project
|
# from project
|
||||||
|
|
@ -71,7 +68,7 @@ class FlamePrelaunch(PreLaunchHook):
|
||||||
"project_data": project_data
|
"project_data": project_data
|
||||||
}
|
}
|
||||||
|
|
||||||
self.log.info(pformat(dict(_env)))
|
self.log.info(pformat(dict(self._env)))
|
||||||
self.log.info(pformat(data_to_script))
|
self.log.info(pformat(data_to_script))
|
||||||
|
|
||||||
# add to python path from settings
|
# add to python path from settings
|
||||||
|
|
@ -92,7 +89,6 @@ class FlamePrelaunch(PreLaunchHook):
|
||||||
|
|
||||||
self.launch_context.env["PYTHONPATH"] = os.pathsep.join(new_pythonpath)
|
self.launch_context.env["PYTHONPATH"] = os.pathsep.join(new_pythonpath)
|
||||||
|
|
||||||
|
|
||||||
def _get_launch_arguments(self, script_data):
|
def _get_launch_arguments(self, script_data):
|
||||||
# Dump data to string
|
# Dump data to string
|
||||||
dumped_script_data = json.dumps(script_data)
|
dumped_script_data = json.dumps(script_data)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue