Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Flame: bunch of bugs #2745

Merged
merged 17 commits into from
Feb 18, 2022
Merged
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
17 changes: 17 additions & 0 deletions openpype/hosts/flame/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,20 @@
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
38 changes: 29 additions & 9 deletions openpype/hosts/flame/hooks/pre_flame_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
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

Expand All @@ -33,15 +37,33 @@ def execute(self):

"""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"]
jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved

# 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))
self.log.info(pformat(project_doc))
_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"],
Expand All @@ -52,19 +74,19 @@ def execute(self):
"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 = {
# from settings
"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
}
Expand All @@ -77,8 +99,6 @@ def execute(self):

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):
Expand Down
49 changes: 27 additions & 22 deletions openpype/plugins/publish/validate_editorial_asset_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def process(self, context):
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(
Expand All @@ -43,17 +43,15 @@ def process(self, context):
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))
Expand All @@ -62,17 +60,24 @@ def process(self, context):
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:
jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
_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(
Expand Down Expand Up @@ -114,8 +119,8 @@ def get_parents(self, context):

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
19 changes: 19 additions & 0 deletions openpype/settings/defaults/project_anatomy/imageio.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
}
}
27 changes: 25 additions & 2 deletions openpype/settings/defaults/system_settings/applications.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
}
]
}
]
}
]
}