mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
add doc strings
This commit is contained in:
parent
d90d45c56d
commit
2bb11d956c
3 changed files with 55 additions and 3 deletions
|
|
@ -71,7 +71,7 @@ class ValidateReviewColorspace(pyblish.api.InstancePlugin):
|
|||
"""
|
||||
|
||||
import hou
|
||||
from openpype.pipeline.colorspace import get_display_view_colorspace_name
|
||||
from openpype.pipeline.colorspace import get_display_view_colorspace_name #noqa
|
||||
from openpype.hosts.houdini.api.lib import get_color_management_preferences #noqa
|
||||
|
||||
rop_node = hou.node(instance.data["instance_node"])
|
||||
|
|
|
|||
|
|
@ -591,6 +591,16 @@ def _get_imageio_settings(project_settings, host_name):
|
|||
return imageio_global, imageio_host
|
||||
|
||||
def get_display_view_colorspace_name(config_path, display, view):
|
||||
"""get view colorspace name for the given display and view.
|
||||
|
||||
Args:
|
||||
config_path (str): path string leading to config.ocio
|
||||
display (str): display name e.g. "ACES"
|
||||
view (str): view name e.g. "sRGB"
|
||||
|
||||
Returns:
|
||||
view color space name (str) e.g. "Output - sRGB"
|
||||
"""
|
||||
|
||||
if not compatibility_check():
|
||||
# python environment is not compatible with PyOpenColorIO
|
||||
|
|
@ -603,6 +613,18 @@ def get_display_view_colorspace_name(config_path, display, view):
|
|||
return _get_display_view_colorspace_name(config_path, display, view)
|
||||
|
||||
def get_display_view_colorspace_subprocess(config_path, display, view):
|
||||
"""get view colorspace name for the given display and view
|
||||
via subprocess.
|
||||
|
||||
Args:
|
||||
config_path (str): path string leading to config.ocio
|
||||
display (str): display name e.g. "ACES"
|
||||
view (str): view name e.g. "sRGB"
|
||||
|
||||
Returns:
|
||||
view color space name (str) e.g. "Output - sRGB"
|
||||
"""
|
||||
|
||||
with _make_temp_json_file() as tmp_json_path:
|
||||
# Prepare subprocess arguments
|
||||
args = [
|
||||
|
|
|
|||
|
|
@ -174,6 +174,21 @@ def _get_views_data(config_path):
|
|||
return data
|
||||
|
||||
def _get_display_view_colorspace_name(config_path, display, view):
|
||||
"""get view colorspace name for the given display and view.
|
||||
|
||||
Args:
|
||||
config_path (str): path string leading to config.ocio
|
||||
display (str): display name e.g. "ACES"
|
||||
view (str): view name e.g. "sRGB"
|
||||
|
||||
|
||||
Raises:
|
||||
IOError: Input config does not exist.
|
||||
|
||||
Returns:
|
||||
view color space name (str) e.g. "Output - sRGB"
|
||||
"""
|
||||
|
||||
config_path = Path(config_path)
|
||||
|
||||
if not config_path.is_file():
|
||||
|
|
@ -199,13 +214,28 @@ def _get_display_view_colorspace_name(config_path, display, view):
|
|||
help="path where to write output json file",
|
||||
type=click.Path())
|
||||
@click.option("--display", required=True,
|
||||
help="display",
|
||||
help="display name",
|
||||
type=click.STRING)
|
||||
@click.option("--view", required=True,
|
||||
help="view",
|
||||
help="view name",
|
||||
type=click.STRING)
|
||||
def get_display_view_colorspace_name(in_path, out_path,
|
||||
display, view):
|
||||
"""Aggregate view colorspace name to file.
|
||||
|
||||
Python 2 wrapped console command
|
||||
|
||||
Args:
|
||||
in_path (str): config file path string
|
||||
out_path (str): temp json file path string
|
||||
display (str): display name e.g. "ACES"
|
||||
view (str): view name e.g. "sRGB"
|
||||
|
||||
Example of use:
|
||||
> pyton.exe ./ocio_wrapper.py config \
|
||||
get_display_view_colorspace_name --in_path=<path> \
|
||||
--out_path=<path> --display=<display> --view=<view>
|
||||
"""
|
||||
|
||||
json_path = Path(out_path)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue