mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
explicit colorspace switch and item labeling
This commit is contained in:
parent
74ca6a3c44
commit
a10206c054
1 changed files with 13 additions and 10 deletions
|
|
@ -1,5 +1,8 @@
|
|||
import pyblish.api
|
||||
from openpype.pipeline import publish
|
||||
from openpype.pipeline import (
|
||||
publish,
|
||||
registered_host
|
||||
)
|
||||
from openpype.lib import EnumDef
|
||||
from openpype.pipeline import colorspace
|
||||
|
||||
|
|
@ -13,6 +16,7 @@ class CollectColorspace(pyblish.api.InstancePlugin,
|
|||
order = pyblish.api.CollectorOrder + 0.49
|
||||
hosts = ["traypublisher"]
|
||||
families = ["render", "plate", "reference", "image", "online"]
|
||||
enabled = False
|
||||
|
||||
colorspace_items = [
|
||||
(None, "Don't override")
|
||||
|
|
@ -37,7 +41,7 @@ class CollectColorspace(pyblish.api.InstancePlugin,
|
|||
|
||||
@classmethod
|
||||
def apply_settings(cls, project_settings):
|
||||
host = self.create_context.host
|
||||
host = registered_host()
|
||||
host_name = host.name
|
||||
project_name = host.get_current_project_name()
|
||||
config_data = colorspace.get_imageio_config(
|
||||
|
|
@ -46,6 +50,7 @@ class CollectColorspace(pyblish.api.InstancePlugin,
|
|||
)
|
||||
|
||||
if config_data:
|
||||
|
||||
filepath = config_data["path"]
|
||||
config_items = colorspace.get_ocio_config_colorspaces(filepath)
|
||||
aliases = set()
|
||||
|
|
@ -58,19 +63,18 @@ class CollectColorspace(pyblish.api.InstancePlugin,
|
|||
aliases.add(alias)
|
||||
|
||||
colorspaces = {
|
||||
name
|
||||
for name, data_ in config_items.items()
|
||||
if name not in aliases and data_.get("type") == "colorspace"
|
||||
name for name, data_ in config_items.items()
|
||||
if data_.get("type") == "colorspace"
|
||||
}
|
||||
|
||||
cls.colorspace_items.extend((
|
||||
(name, name) for name in colorspaces
|
||||
(name, f"{name} [colorspace]") for name in colorspaces
|
||||
))
|
||||
if aliases:
|
||||
cls.colorspace_items.extend((
|
||||
(name, name) for name in aliases
|
||||
(name, f"{name} [alias]") for name in aliases
|
||||
))
|
||||
cls.colorspace_attr_show = True
|
||||
cls.enabled = True
|
||||
|
||||
@classmethod
|
||||
def get_attribute_defs(cls):
|
||||
|
|
@ -79,7 +83,6 @@ class CollectColorspace(pyblish.api.InstancePlugin,
|
|||
"colorspace",
|
||||
cls.colorspace_items,
|
||||
default="Don't override",
|
||||
label="Override Colorspace",
|
||||
hidden=not cls.colorspace_attr_show
|
||||
label="Override Colorspace"
|
||||
)
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue