globa: update colorspace data exctractor

This commit is contained in:
Jakub Jezek 2022-12-23 21:55:23 +01:00
parent d1ec0299a0
commit 39c55f4bda
No known key found for this signature in database
GPG key ID: 730D7C02726179A7

View file

@ -20,14 +20,15 @@ class ExtractColorspaceData(publish.Extractor):
representation[data] = {
"colorspaceData": {
"colorspace": "linear",
"configPath": "/path/to/config.ocio"
"configPath": "{project[root]}/path/to/config.ocio"
"configPathFormated": "/abs/path/to/config.ocio"
}
}
TODO:
- rootify config path so it can be single path for usecases
where windows submit to farm and farm on linux do
oiio conversions.
- Keep templated config path and format it just before the use with anatomy data and envs.
- also check if colorspaceData are already added from host exctractors
- colorspace data has to be added before Exctract review for OIIO conversion
"""
label = "Extract Colorspace data"
order = pyblish.api.ExtractorOrder + 0.49
@ -55,18 +56,25 @@ class ExtractColorspaceData(publish.Extractor):
for representation in representations:
# check extension
ext = representation["ext"]
self.log.debug("__ ext: `{}`".format(ext))
if ext.lower() not in self.allowed_ext:
continue
# get one filename
filename = representation["files"]
if isinstance(filename, list):
filename = filename.pop()
self.log.debug("__ filename: `{}`".format(
filename))
# get matching colorspace from rules
colorspace = get_imagio_colorspace_from_filepath(
filename, config_path=config_path, file_rules=file_rules
)
self.log.debug("__ colorspace: `{}`".format(
colorspace))
# infuse data to representation
if colorspace: