flame: connecting imageio settings to project hook creation

This commit is contained in:
Jakub Jezek 2022-02-16 16:55:25 +01:00
parent 3214fb9118
commit 65d23644e5
No known key found for this signature in database
GPG key ID: D8548FBF690B100A

View file

@ -7,6 +7,7 @@ from openpype.lib import (
PreLaunchHook,
get_openpype_username
)
from openpype.api import get_anatomy_settings
from openpype.hosts import flame as opflame
import openpype.hosts.flame.api as opfapi
import openpype
@ -35,6 +36,13 @@ class FlamePrelaunch(PreLaunchHook):
"""Hook entry method."""
project_doc = self.data["project_doc"]
project_name = project_doc["name"]
# get image io
project_anatomy = get_anatomy_settings(project_name)
imageio_flame = project_anatomy["imageio"]["flame"]
# get user name and host name
user_name = get_openpype_username()
hostname = socket.gethostname() # not returning wiretap host name
@ -43,7 +51,7 @@ class FlamePrelaunch(PreLaunchHook):
_db_p_data = project_doc["data"]
width = _db_p_data["resolutionWidth"]
height = _db_p_data["resolutionHeight"]
fps = int(_db_p_data["fps"])
fps = float(_db_p_data["fps"])
project_data = {
"Name": project_doc["name"],
@ -54,8 +62,8 @@ class FlamePrelaunch(PreLaunchHook):
"FrameHeight": int(height),
"AspectRatio": float((width / height) * _db_p_data["pixelAspect"]),
"FrameRate": "{} fps".format(fps),
"FrameDepth": "16-bit fp",
"FieldDominance": "PROGRESSIVE"
"FrameDepth": str(imageio_flame["project"]["frameDepth"]),
"FieldDominance": str(imageio_flame["project"]["fieldDominance"])
}
data_to_script = {
@ -63,10 +71,10 @@ class FlamePrelaunch(PreLaunchHook):
"host_name": _env.get("FLAME_WIRETAP_HOSTNAME") or hostname,
"volume_name": _env.get("FLAME_WIRETAP_VOLUME"),
"group_name": _env.get("FLAME_WIRETAP_GROUP"),
"color_policy": "ACES 1.1",
"color_policy": str(imageio_flame["project"]["colourPolicy"]),
# from project
"project_name": project_doc["name"],
"project_name": project_name,
"user_name": user_name,
"project_data": project_data
}