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

Enhancement: Color management for Houdini workfiles #5858

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c2f2fdb
add workfile colorspace to Houdini settings
MustafaJafar Nov 2, 2023
bf32236
add Houdini workfile colorspace to Ayon settings
MustafaJafar Nov 2, 2023
fca6abd
add Houdini SetDefaultDislayView prelaunch hook
MustafaJafar Nov 2, 2023
10cf562
resolve hound
MustafaJafar Nov 2, 2023
537d1ac
BigRoy's comments - Better logging & remove unnecessary logic
MustafaJafar Nov 2, 2023
3ffbf73
resolve hound
MustafaJafar Nov 2, 2023
1a1e48e
BigRoy's comment - update variable name
MustafaJafar Nov 2, 2023
7d80da8
BigRoy's Comment - fix typo
MustafaJafar Nov 2, 2023
cd4d8bd
BigRoy's comment - better doc string
MustafaJafar Nov 3, 2023
b7336e1
Merge branch 'develop' into enhancement/OP-1017_houdini-colorspaces
MustafaJafar Nov 3, 2023
5a269ab
Merge branch 'enhancement/OP-1017_houdini-colorspaces' of https://git…
MustafaJafar Nov 3, 2023
0a8e293
bump patch version
MustafaJafar Nov 3, 2023
a32f0a6
use 'review color space' setting in review creator
MustafaJafar Nov 6, 2023
0eacab2
update houdini workfile color settings
MustafaJafar Nov 6, 2023
c4cd10c
use houdini color settings while review creation and validation
MustafaJafar Nov 6, 2023
1eb82e1
Merge branch 'develop' into enhancement/OP-1017_houdini-colorspaces
MustafaJafar Nov 6, 2023
2caac26
Resolve Hound
MustafaJafar Nov 6, 2023
8de9dcc
update doc string
MustafaJafar Nov 6, 2023
9684978
bump Houdini addon patch version
MustafaJafar Nov 6, 2023
dadddfb
Minkiu comment - remove unnecessary variable
MustafaJafar Nov 7, 2023
a1d1c49
fabia's comment - Better conditional
MustafaJafar Nov 7, 2023
83089da
update set_review_color_space() and get_houdini_color_settings() logic
MustafaJafar Nov 7, 2023
f349df0
undo adding unnecessary setting
MustafaJafar Nov 7, 2023
fd64850
add colorspace data to houdini review extractor
MustafaJafar Nov 8, 2023
205c064
BigRoy's comment - use a conditional
MustafaJafar Nov 8, 2023
7a62d5d
add colorspace data to houdini image sequence extractor
MustafaJafar Nov 9, 2023
251291a
append existent view and display env vars
MustafaJafar Nov 12, 2023
38bf9c1
resolve hound
MustafaJafar Nov 12, 2023
87dc8ca
fix a typo
MustafaJafar Nov 13, 2023
a7e2267
BigRoy's comment - Cleaner env var values
MustafaJafar Nov 13, 2023
a823676
update houdini workfile colorsettings help
MustafaJafar Nov 13, 2023
cb9e22e
resolve hound
MustafaJafar Nov 13, 2023
ebc3d95
BigRoy's suggestion - Better help text
MustafaJafar Nov 13, 2023
1fadecf
Merge branch 'develop' into enhancement/OP-1017_houdini-colorspaces
MustafaJafar Nov 13, 2023
be6d015
BigRoy's suggestion - Better help text, Ayon settings
MustafaJafar Nov 13, 2023
d3362eb
bump houdini addon version
MustafaJafar Nov 13, 2023
cc70c7b
Merge branch 'develop' into enhancement/OP-1017_houdini-colorspaces
MustafaJafar Nov 17, 2023
0c3ff0f
Fabia's Comments
MustafaJafar Nov 17, 2023
b328812
Merge branch 'develop' into enhancement/OP-1017_houdini-colorspaces
MustafaJafar Nov 23, 2023
e45df04
Jeza Comment - Better Labels
MustafaJafar Nov 23, 2023
ab04429
BigRoy's comment - add settings tip
MustafaJafar Nov 24, 2023
ba10409
Merge branch 'develop' into enhancement/OP-1017_houdini-colorspaces
MustafaJafar Dec 11, 2023
1bdbf35
Merge branch 'develop' into enhancement/OP-1017_houdini-colorspaces
MustafaJafar Dec 14, 2023
c40b713
bump houdini addon version
MustafaJafar Dec 14, 2023
fccfb22
Merge branch 'develop' into enhancement/OP-1017_houdini-colorspaces
MustafaJafar Jan 3, 2024
b8f89e1
♻️ Minkiu Comment - refactor repeated code into a method
MustafaJafar Jan 3, 2024
71fe47d
🦴 Resolve Hound
MustafaJafar Jan 3, 2024
ec6a8b2
➖ Remove unnecessary function
MustafaJafar Jan 5, 2024
10cdd11
🐾 Resolve Hound
MustafaJafar Jan 5, 2024
eb123e1
🐾 Resolve Hound
MustafaJafar Jan 5, 2024
05948a9
🐾 Resolve Hound
MustafaJafar Jan 5, 2024
9245fd9
Merge branch 'develop' into enhancement/OP-1017_houdini-colorspaces
MustafaJafar Jan 16, 2024
75b6dfe
bump Houdini addon version
MustafaJafar Jan 16, 2024
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
53 changes: 53 additions & 0 deletions openpype/hosts/houdini/hooks/set_default_display_and_view.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from openpype.lib.applications import PreLaunchHook, LaunchTypes
from openpype.settings import get_project_settings


class SetDefaultDislayView(PreLaunchHook):
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
"""Set default view and default display for houdini host that use OpenColorIO.
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved

Houdini's defaultDisplay and defaultView are set by
setting 'OCIO_ACTIVE_DISPLAYS' and 'OCIO_ACTIVE_VIEWS'
environment variables respectively.

More info: https://www.sidefx.com/docs/houdini/io/ocio.html#set-up
"""

app_groups = {"houdini"}
launch_types = {LaunchTypes.local}

def execute(self):

OCIO = self.launch_context.env.get("OCIO")

# This is a cheap way to skip this hook if either
# global color management or houdini color management was disabled.
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
if not OCIO:
return

project_settings = get_project_settings(
project_name=self.data["project_name"]
)
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved

houdini_color_Settings = \
project_settings["houdini"]["imageio"]["workfile"]

if not houdini_color_Settings["enabled"]:
self.log.info(
"Houdini's workefile color settings are disabled."
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
)
return

default_display = houdini_color_Settings["default_display"]
default_view = houdini_color_Settings["default_view"]

MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
self.log.info(
"Setting OCIO_ACTIVE_DISPLAYS environment to : {}"
.format(default_display)
)
self.launch_context.env["OCIO_ACTIVE_DISPLAYS"] = default_display

self.log.info(
"Setting OCIO_ACTIVE_VIEWS environment to config path: {}"
.format(default_view)
)
self.launch_context.env["OCIO_ACTIVE_VIEWS"] = default_view
6 changes: 6 additions & 0 deletions openpype/settings/defaults/project_settings/houdini.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
"file_rules": {
"activate_host_rules": false,
"rules": {}
},
"workfile":{
"enabled": false,
"default_display": "ACES",
"default_view": "sRGB",
"review_color_space": "Output - sRGB"
}
},
"shelves": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,40 @@
{
"type": "template",
"name": "template_host_color_management_ocio"
},
{
"key": "workfile",
"type": "dict",
"label": "Workfile",
"collapsible": true,
"checkbox_key": "enabled",
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
},
{
"type": "label",
"label": "Render space in Houdini is always set to 'scene_linear' Role."
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
},
{
"type": "text",
"key": "default_display",
"label": "Display"
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
},
{
"type": "text",
"key": "default_view",
"label": "View"
MustafaJafar marked this conversation as resolved.
Show resolved Hide resolved
},
{
"type": "text",
"key": "review_color_space",
"label": "Review colorspace"
}

]
}
]
},
Expand Down
34 changes: 33 additions & 1 deletion server_addon/houdini/server/settings/imageio.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,18 @@ def validate_unique_outputs(cls, value):
return value


class WorkfileImageIOModel(BaseSettingsModel):
"""Render space in Houdini is always set to 'scene_linear' Role."""

enabled: bool = Field(False, title="Enabled")
default_display: str = Field(title="Display")
default_view: str = Field(title="View")
review_color_space: str = Field(title="Review colorspace")


class HoudiniImageIOModel(BaseSettingsModel):
activate_host_color_management: bool = Field(
True, title="Enable Color Management"
False, title="Enable Color Management"
)
ocio_config: ImageIOConfigModel = Field(
default_factory=ImageIOConfigModel,
Expand All @@ -46,3 +55,26 @@ class HoudiniImageIOModel(BaseSettingsModel):
default_factory=ImageIOFileRulesModel,
title="File Rules"
)
workfile: WorkfileImageIOModel = Field(
default_factory=WorkfileImageIOModel,
title="Workfile"
)


DEFAULT_IMAGEIO_SETTINGS = {
"activate_host_color_management": False,
"ocio_config": {
"override_global_config": False,
"filepath": []
},
"file_rules": {
"activate_host_rules": False,
"rules": []
},
"workfile": {
"enabled": False,
"default_display": "ACES",
"default_view": "sRGB",
"review_color_space": "Output - sRGB"
}
}
6 changes: 5 additions & 1 deletion server_addon/houdini/server/settings/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
GeneralSettingsModel,
DEFAULT_GENERAL_SETTINGS
)
from .imageio import HoudiniImageIOModel
from .imageio import (
HoudiniImageIOModel,
DEFAULT_IMAGEIO_SETTINGS
)
from .shelves import ShelvesModel
from .create import (
CreatePluginsModel,
Expand Down Expand Up @@ -41,6 +44,7 @@ class HoudiniSettings(BaseSettingsModel):

DEFAULT_VALUES = {
"general": DEFAULT_GENERAL_SETTINGS,
"imageio": DEFAULT_IMAGEIO_SETTINGS,
"shelves": [],
"create": DEFAULT_HOUDINI_CREATE_SETTINGS,
"publish": DEFAULT_HOUDINI_PUBLISH_SETTINGS
Expand Down
2 changes: 1 addition & 1 deletion server_addon/houdini/server/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.6"
__version__ = "0.2.7"