Skip to content

Commit

Permalink
Merge pull request #60 from JoseCovaOS/bufix/59-colorspace_is_not_bei…
Browse files Browse the repository at this point in the history
…ng_applied_to_loaded_clips

Fix returned colorspace list in `get_colorspace_list` - AY-7415
  • Loading branch information
jakubjezek001 authored Jan 30, 2025
2 parents 539425b + 940ab25 commit 03f0528
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions client/ayon_nuke/api/colorspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ def get_display_and_view_colorspaces(root_node):
return _DISPLAY_AND_VIEW_COLORSPACES_CACHE[script_name]


def get_colorspace_list(colorspace_knob, node=None):
def get_colorspace_list(colorspace_knob, node=None, consider_aliases=True):
"""Get available colorspace profile names
Args:
colorspace_knob (nuke.Knob): nuke knob object
node (Optional[nuke.Node]): nuke node for caching differentiation
consider_aliases (Optional[bool]): optional flag to indicate if
colorspace aliases should be added to results list
Returns:
list: list of strings names of profiles
Expand All @@ -65,13 +67,13 @@ def get_colorspace_list(colorspace_knob, node=None):
# colorspace is the string before the indentation, so we'll need to
# convert the values to match with value returned from the knob,
# ei. knob.value().
pattern = r".*\t.* \(.*\)"
pattern = r"[\t,]+"
for colorspace in nuke.getColorspaceList(colorspace_knob):
match = re.search(pattern, colorspace)
if match:
results.append(colorspace.split("\t", 1)[0])
colorspace_and_aliases = re.split(pattern, colorspace)
if consider_aliases:
results.extend(colorspace_and_aliases)
else:
results.append(colorspace)
results.append(colorspace_and_aliases[0])

_COLORSPACES_CACHE[identifier_key] = results

Expand Down

0 comments on commit 03f0528

Please sign in to comment.