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

Settings: Move imageio from project anatomy to project settings #3909

Closed
wants to merge 5 commits into from
Closed
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
13 changes: 6 additions & 7 deletions openpype/hosts/flame/hooks/pre_flame_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,16 @@ def execute(self):
volume_name = _env.get("FLAME_WIRETAP_VOLUME")

# get image io
project_anatomy = self.data["anatomy"]
project_settings = self.data["project_settings"]

# 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")
if not project_settings["flame"].get("imageio"):
raise ApplicationLaunchFailed(
"Project settings are missing `flame/imageio` key. "
"Please make sure to update project settings."
)

imageio_flame = project_anatomy["imageio"]["flame"]
imageio_flame = project_settings["flame"]["imageio"]

# get user name and host name
user_name = get_openpype_username()
Expand Down
7 changes: 3 additions & 4 deletions openpype/hosts/fusion/hooks/pre_fusion_ocio_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ def execute(self):
# make sure anatomy settings are having flame key
imageio_fusion = project_settings.get("fusion", {}).get("imageio")
if not imageio_fusion:
raise ApplicationLaunchFailed((
"Anatomy project settings are missing `fusion` key. "
"Please make sure you remove project overrides on "
"Anatomy ImageIO")
raise ApplicationLaunchFailed(
"Project settings are missing `fusion/imageio` key. "
"Please make sure you update your project settings. "
)

ocio = imageio_fusion.get("ocio")
Expand Down
8 changes: 3 additions & 5 deletions openpype/hosts/hiero/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from Qt import QtWidgets

from openpype.client import get_project
from openpype.settings import get_anatomy_settings
from openpype.settings import get_project_settings
from openpype.pipeline import legacy_io, Anatomy
from openpype.pipeline.load import filter_containers
from openpype.lib import Logger
Expand Down Expand Up @@ -878,8 +878,7 @@ def apply_colorspace_project():
project.close()

# get presets for hiero
imageio = get_anatomy_settings(
project_name)["imageio"].get("hiero", None)
imageio = get_project_settings(project_name)["hiero"]["imageio"]
presets = imageio.get("workfile")

# save the workfile as subversion "comment:_colorspaceChange"
Expand Down Expand Up @@ -932,8 +931,7 @@ def apply_colorspace_clips():
clips = project.clips()

# get presets for hiero
imageio = get_anatomy_settings(
project_name)["imageio"].get("hiero", None)
imageio = get_project_settings(project_name)["hiero"]["imageio"]
from pprint import pprint

presets = imageio.get("regexInputs", {}).get("inputs", {})
Expand Down
4 changes: 2 additions & 2 deletions openpype/hosts/maya/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
get_last_versions,
get_representation_by_name
)
from openpype.api import get_anatomy_settings
from openpype.api import get_project_settings
from openpype.pipeline import (
legacy_io,
discover_loader_plugins,
Expand Down Expand Up @@ -3159,7 +3159,7 @@ def set_colorspace():
"""Set Colorspace from project configuration
"""
project_name = os.getenv("AVALON_PROJECT")
imageio = get_anatomy_settings(project_name)["imageio"]["maya"]
imageio = get_project_settings(project_name)["maya"]["imageio"]

# Maya 2022+ introduces new OCIO v2 color management settings that
# can override the old color managenement preferences. OpenPype has
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/nuke/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def get_node_path(path, padding=4):


def get_nuke_imageio_settings():
return get_anatomy_settings(Context.project_name)["imageio"]["nuke"]
return get_project_settings(Context.project_name)["nuke"]["imageio"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there should be some backward compatibility check. Some clients might have Anatomy ImageIO set from 3.9 and they didn't change __legacy__ type yet. We would need to go trough all projects and do this manually (impossible).
For those projects it doesnt even make sense to copy paste it from Anatomy to ./nuke/imageio.

I will do the changes in separate PR. Please could you return the ___legacy__ check (#3909 (comment))



def get_created_node_imageio_setting_legacy(nodeclass, creator, subset):
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/nuke/plugins/load/load_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def _set_colorspace(self, node, version_data, repre_data, path=None):
colorspace = repre_data.get("colorspace")
colorspace = colorspace or version_data.get("colorspace")

# colorspace from `project_anatomy/imageio/nuke/regexInputs`
# colorspace from `project_settings/nuke/imageio/regexInputs`
iio_colorspace = get_imageio_input_colorspace(path)

# Set colorspace defined in version data
Expand Down
19 changes: 19 additions & 0 deletions openpype/settings/defaults/project_settings/flame.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
{
"imageio": {
"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"
}
]
}
},
"create": {
"CreateShotClip": {
"hierarchy": "{folder}/{sequence}",
Expand Down
25 changes: 25 additions & 0 deletions openpype/settings/defaults/project_settings/hiero.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
{
"imageio": {
"workfile": {
"ocioConfigName": "nuke-default",
"ocioconfigpath": {
"windows": [],
"darwin": [],
"linux": []
},
"workingSpace": "linear",
"sixteenBitLut": "sRGB",
"eightBitLut": "sRGB",
"floatLut": "linear",
"logLut": "Cineon",
"viewerLut": "sRGB",
"thumbnailLut": "sRGB"
},
"regexInputs": {
"inputs": [
{
"regex": "[^-a-zA-Z0-9](plateRef).*(?=mp4)",
"colorspace": "sRGB"
}
]
}
},
"create": {
"CreateShotClip": {
"hierarchy": "{folder}/{sequence}",
Expand Down
22 changes: 22 additions & 0 deletions openpype/settings/defaults/project_settings/maya.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
{
"imageio": {
"colorManagementPreference_v2": {
"enabled": true,
"configFilePath": {
"windows": [],
"darwin": [],
"linux": []
},
"renderSpace": "ACEScg",
"displayName": "sRGB",
"viewName": "ACES 1.0 SDR-video"
},
"colorManagementPreference": {
"configFilePath": {
"windows": [],
"darwin": [],
"linux": []
},
"renderSpace": "scene-linear Rec 709/sRGB",
"viewTransform": "sRGB gamma"
}
},
"mel_workspace": "workspace -fr \"shaders\" \"renderData/shaders\";\nworkspace -fr \"images\" \"renders\";\nworkspace -fr \"particles\" \"particles\";\nworkspace -fr \"mayaAscii\" \"\";\nworkspace -fr \"mayaBinary\" \"\";\nworkspace -fr \"scene\" \"\";\nworkspace -fr \"alembicCache\" \"cache/alembic\";\nworkspace -fr \"renderData\" \"renderData\";\nworkspace -fr \"sourceImages\" \"sourceimages\";\nworkspace -fr \"fileCache\" \"cache/nCache\";\n",
"ext_mapping": {
"model": "ma",
Expand Down
190 changes: 190 additions & 0 deletions openpype/settings/defaults/project_settings/nuke.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,196 @@
"build_workfile": "ctrl+alt+b"
}
},
"imageio": {
"viewer": {
"viewerProcess": "sRGB"
},
"baking": {
"viewerProcess": "rec709"
},
"workfile": {
"colorManagement": "Nuke",
"OCIO_config": "nuke-default",
"customOCIOConfigPath": {
"windows": [],
"darwin": [],
"linux": []
},
"workingSpaceLUT": "linear",
"monitorLut": "sRGB",
"int8Lut": "sRGB",
"int16Lut": "sRGB",
"logLut": "Cineon",
"floatLut": "linear"
},
"nodes": {
"requiredNodes": [
{
"plugins": [
"CreateWriteRender"
],
"nukeNodeClass": "Write",
"knobs": [
{
"type": "text",
"name": "file_type",
"value": "exr"
},
{
"type": "text",
"name": "datatype",
"value": "16 bit half"
},
{
"type": "text",
"name": "compression",
"value": "Zip (1 scanline)"
},
{
"type": "bool",
"name": "autocrop",
"value": true
},
{
"type": "color_gui",
"name": "tile_color",
"value": [
186,
35,
35,
255
]
},
{
"type": "text",
"name": "channels",
"value": "rgb"
},
{
"type": "text",
"name": "colorspace",
"value": "linear"
},
{
"type": "bool",
"name": "create_directories",
"value": true
}
]
},
{
"plugins": [
"CreateWritePrerender"
],
"nukeNodeClass": "Write",
"knobs": [
{
"type": "text",
"name": "file_type",
"value": "exr"
},
{
"type": "text",
"name": "datatype",
"value": "16 bit half"
},
{
"type": "text",
"name": "compression",
"value": "Zip (1 scanline)"
},
{
"type": "bool",
"name": "autocrop",
"value": true
},
{
"type": "color_gui",
"name": "tile_color",
"value": [
171,
171,
10,
255
]
},
{
"type": "text",
"name": "channels",
"value": "rgb"
},
{
"type": "text",
"name": "colorspace",
"value": "linear"
},
{
"type": "bool",
"name": "create_directories",
"value": true
}
]
},
{
"plugins": [
"CreateWriteStill"
],
"nukeNodeClass": "Write",
"knobs": [
{
"type": "text",
"name": "file_type",
"value": "tiff"
},
{
"type": "text",
"name": "datatype",
"value": "16 bit"
},
{
"type": "text",
"name": "compression",
"value": "Deflate"
},
{
"type": "color_gui",
"name": "tile_color",
"value": [
56,
162,
7,
255
]
},
{
"type": "text",
"name": "channels",
"value": "rgb"
},
{
"type": "text",
"name": "colorspace",
"value": "sRGB"
},
{
"type": "bool",
"name": "create_directories",
"value": true
}
]
}
],
"overrideNodes": []
},
"regexInputs": {
"inputs": [
{
"regex": "(beauty).*(?=.exr)",
"colorspace": "linear"
}
]
}
},
"nuke-dirmap": {
"enabled": false,
"paths": {
Expand Down
Loading