mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merge pull request #2745 from pypeclub/bugfix/OP-1594_Flame-client_bugs_catches
This commit is contained in:
commit
be04bc8a02
15 changed files with 179 additions and 33 deletions
|
|
@ -3,3 +3,20 @@ import os
|
|||
HOST_DIR = os.path.dirname(
|
||||
os.path.abspath(__file__)
|
||||
)
|
||||
|
||||
|
||||
def add_implementation_envs(env, _app):
|
||||
# Add requirements to DL_PYTHON_HOOK_PATH
|
||||
pype_root = os.environ["OPENPYPE_REPOS_ROOT"]
|
||||
|
||||
env["DL_PYTHON_HOOK_PATH"] = os.path.join(
|
||||
pype_root, "openpype", "hosts", "flame", "startup")
|
||||
env.pop("QT_AUTO_SCREEN_SCALE_FACTOR", None)
|
||||
|
||||
# Set default values if are not already set via settings
|
||||
defaults = {
|
||||
"LOGLEVEL": "DEBUG"
|
||||
}
|
||||
for key, value in defaults.items():
|
||||
if not env.get(key):
|
||||
env[key] = value
|
||||
|
|
|
|||
|
|
@ -4,9 +4,13 @@ import tempfile
|
|||
import contextlib
|
||||
import socket
|
||||
from openpype.lib import (
|
||||
PreLaunchHook, get_openpype_username)
|
||||
PreLaunchHook,
|
||||
get_openpype_username
|
||||
)
|
||||
from openpype.lib.applications import (
|
||||
ApplicationLaunchFailed
|
||||
)
|
||||
from openpype.hosts import flame as opflame
|
||||
import openpype.hosts.flame.api as opfapi
|
||||
import openpype
|
||||
from pprint import pformat
|
||||
|
||||
|
|
@ -33,7 +37,25 @@ class FlamePrelaunch(PreLaunchHook):
|
|||
|
||||
"""Hook entry method."""
|
||||
project_doc = self.data["project_doc"]
|
||||
project_name = project_doc["name"]
|
||||
|
||||
# get image io
|
||||
project_anatomy = self.data["anatomy"]
|
||||
|
||||
# make sure anatomy settings are having flame key
|
||||
if not project_anatomy["imageio"].get("flame"):
|
||||
raise ApplicationLaunchFailed((
|
||||
"Anatomy project settings are missing `flame` key. "
|
||||
"Please make sure you remove project overides on "
|
||||
"Anatomy Image io")
|
||||
)
|
||||
|
||||
imageio_flame = project_anatomy["imageio"]["flame"]
|
||||
|
||||
# get user name and host name
|
||||
user_name = get_openpype_username()
|
||||
user_name = user_name.replace(".", "_")
|
||||
|
||||
hostname = socket.gethostname() # not returning wiretap host name
|
||||
|
||||
self.log.debug("Collected user \"{}\"".format(user_name))
|
||||
|
|
@ -41,7 +63,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"],
|
||||
|
|
@ -52,8 +74,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 = {
|
||||
|
|
@ -61,10 +83,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
|
||||
}
|
||||
|
|
@ -77,8 +99,6 @@ class FlamePrelaunch(PreLaunchHook):
|
|||
|
||||
app_arguments = self._get_launch_arguments(data_to_script)
|
||||
|
||||
opfapi.setup(self.launch_context.env)
|
||||
|
||||
self.launch_context.launch_args.extend(app_arguments)
|
||||
|
||||
def _add_pythonpath(self):
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class ValidateEditorialAssetName(pyblish.api.ContextPlugin):
|
|||
self.log.debug("__ db_assets: {}".format(db_assets))
|
||||
|
||||
asset_db_docs = {
|
||||
str(e["name"]): e["data"]["parents"]
|
||||
str(e["name"]): [str(p) for p in e["data"]["parents"]]
|
||||
for e in db_assets}
|
||||
|
||||
self.log.debug("__ project_entities: {}".format(
|
||||
|
|
@ -43,17 +43,15 @@ class ValidateEditorialAssetName(pyblish.api.ContextPlugin):
|
|||
for asset in asset_and_parents.keys():
|
||||
if asset not in asset_db_docs.keys():
|
||||
# add to some nonexistent list for next layer of check
|
||||
assets_missing_name.update({asset: asset_and_parents[asset]})
|
||||
assets_missing_name[asset] = asset_and_parents[asset]
|
||||
continue
|
||||
|
||||
if asset_and_parents[asset] != asset_db_docs[asset]:
|
||||
# add to some nonexistent list for next layer of check
|
||||
assets_wrong_parent.update({
|
||||
asset: {
|
||||
"required": asset_and_parents[asset],
|
||||
"already_in_db": asset_db_docs[asset]
|
||||
}
|
||||
})
|
||||
assets_wrong_parent[asset] = {
|
||||
"required": asset_and_parents[asset],
|
||||
"already_in_db": asset_db_docs[asset]
|
||||
}
|
||||
continue
|
||||
|
||||
self.log.info("correct asset: {}".format(asset))
|
||||
|
|
@ -62,17 +60,24 @@ class ValidateEditorialAssetName(pyblish.api.ContextPlugin):
|
|||
wrong_names = {}
|
||||
self.log.debug(
|
||||
">> assets_missing_name: {}".format(assets_missing_name))
|
||||
for asset in assets_missing_name.keys():
|
||||
|
||||
# This will create set asset names
|
||||
asset_names = {
|
||||
a.lower().replace("_", "") for a in asset_db_docs
|
||||
}
|
||||
|
||||
for asset in assets_missing_name:
|
||||
_asset = asset.lower().replace("_", "")
|
||||
if _asset in [a.lower().replace("_", "")
|
||||
for a in asset_db_docs.keys()]:
|
||||
wrong_names.update({
|
||||
"required_name": asset,
|
||||
"used_variants_in_db": [
|
||||
a for a in asset_db_docs.keys()
|
||||
if a.lower().replace("_", "") == _asset
|
||||
]
|
||||
})
|
||||
if _asset in asset_names:
|
||||
wrong_names[asset].update(
|
||||
{
|
||||
"required_name": asset,
|
||||
"used_variants_in_db": [
|
||||
a for a in asset_db_docs
|
||||
if a.lower().replace("_", "") == _asset
|
||||
]
|
||||
}
|
||||
)
|
||||
|
||||
if wrong_names:
|
||||
self.log.debug(
|
||||
|
|
@ -114,8 +119,8 @@ class ValidateEditorialAssetName(pyblish.api.ContextPlugin):
|
|||
|
||||
parents = instance.data["parents"]
|
||||
|
||||
return_dict.update({
|
||||
asset: [p["entity_name"] for p in parents
|
||||
if p["entity_type"].lower() != "project"]
|
||||
})
|
||||
return_dict[asset] = [
|
||||
str(p["entity_name"]) for p in parents
|
||||
if p["entity_type"].lower() != "project"
|
||||
]
|
||||
return return_dict
|
||||
|
|
|
|||
|
|
@ -186,5 +186,24 @@
|
|||
"renderSpace": "scene-linear Rec 709/sRGB",
|
||||
"viewTransform": "sRGB gamma"
|
||||
}
|
||||
},
|
||||
"flame": {
|
||||
"project": {
|
||||
"colourPolicy": "ACES 1.1",
|
||||
"frameDepth": "16-bit fp",
|
||||
"fieldDominance": "PROGRESSIVE"
|
||||
},
|
||||
"profilesMapping": {
|
||||
"inputs": [
|
||||
{
|
||||
"flameName": "ACEScg",
|
||||
"ocioName": "ACES - ACEScg"
|
||||
},
|
||||
{
|
||||
"flameName": "Rec.709 video",
|
||||
"ocioName": "Output - Rec.709"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@
|
|||
"/opt/Autodesk/flame_2021/bin/flame.app/Contents/MacOS/startApp"
|
||||
],
|
||||
"linux": [
|
||||
"/opt/Autodesk/flame_2021/bin/flame"
|
||||
"/opt/Autodesk/flame_2021/bin/startApplication"
|
||||
]
|
||||
},
|
||||
"arguments": {
|
||||
|
|
@ -135,8 +135,31 @@
|
|||
"OPENPYPE_WIRETAP_TOOLS": "/opt/Autodesk/wiretap/tools/2021"
|
||||
}
|
||||
},
|
||||
"2021.1": {
|
||||
"use_python_2": true,
|
||||
"executables": {
|
||||
"windows": [],
|
||||
"darwin": [
|
||||
"/opt/Autodesk/flame_2021.1/bin/flame.app/Contents/MacOS/startApp"
|
||||
],
|
||||
"linux": [
|
||||
"/opt/Autodesk/flame_2021.1/bin/startApplication"
|
||||
]
|
||||
},
|
||||
"arguments": {
|
||||
"windows": [],
|
||||
"darwin": [],
|
||||
"linux": []
|
||||
},
|
||||
"environment": {
|
||||
"OPENPYPE_FLAME_PYTHON_EXEC": "/opt/Autodesk/python/2021.1/bin/python2.7",
|
||||
"OPENPYPE_FLAME_PYTHONPATH": "/opt/Autodesk/flame_2021.1/python",
|
||||
"OPENPYPE_WIRETAP_TOOLS": "/opt/Autodesk/wiretap/tools/2021.1"
|
||||
}
|
||||
},
|
||||
"__dynamic_keys_labels__": {
|
||||
"2021": "2021 (Testing Only)"
|
||||
"2021": "2021",
|
||||
"2021.1": "2021.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -403,6 +403,68 @@
|
|||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "flame",
|
||||
"type": "dict",
|
||||
"label": "Flame/Flair",
|
||||
"children": [
|
||||
{
|
||||
"key": "project",
|
||||
"type": "dict",
|
||||
"label": "Project",
|
||||
"collapsible": false,
|
||||
"children": [
|
||||
{
|
||||
"type": "form",
|
||||
"children": [
|
||||
{
|
||||
"type": "text",
|
||||
"key": "colourPolicy",
|
||||
"label": "Colour Policy"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"key": "frameDepth",
|
||||
"label": "Image Depth"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"key": "fieldDominance",
|
||||
"label": "Field Dominance"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "profilesMapping",
|
||||
"type": "dict",
|
||||
"label": "Profile names mapping",
|
||||
"collapsible": true,
|
||||
"children": [
|
||||
{
|
||||
"type": "list",
|
||||
"key": "inputs",
|
||||
"object_type": {
|
||||
"type": "dict",
|
||||
"children": [
|
||||
{
|
||||
"type": "text",
|
||||
"key": "flameName",
|
||||
"label": "Flame name"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"key": "ocioName",
|
||||
"label": "OCIO name"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue