What to do when publish from ACES Nuke script fails with Error Invalid LUT selected : Gamma2.2

What can you do if you are working in an ACES color management project and when you use the default toolkit publishing it fails with an error Invalid LUT selected : Gamma2.2

1 Like

So the issue you are seeing is because there is an app that creates the quicktime that is a part of the toolkit publishing from Nuke called tk-multi-reviewsubmission, and by default it will create a QT that works with Nukes standard color model.

So since you are using ACES (I’m assuming the ICIO model), we just need to change the colorspace setting in the tk-multi-reviewsubmission app by taking over and adding it into the codec_settings.py hook.

I’m not sure what codec would work best for your usage, but I’m using the Output - sRGB Codec as an example, you may need to change based on your color workflow. So in the codec_settings.py hook add the setting settings["colorspace"] = "Output - sRGB" to where it makes sense for your setup. (I’ve just added it everywhere)

        settings = {}
        if sys.platform in ["darwin", "win32"]:
            settings["file_type"] = "mov"
            if nuke.NUKE_VERSION_MAJOR >= 9:
                # Nuke 9.0v1 changed the codec knob name to meta_codec and added an encoder knob
                # (which defaults to the new mov64 encoder/decoder).                  
                settings["meta_codec"] = "jpeg"
                settings["mov64_quality_max"] = "3"
                settings["colorspace"] = "Output - sRGB"
            else:
                settings["codec"] = "jpeg"
                settings["colorspace"] = "Output - sRGB"

        elif sys.platform == "linux2":
            if nuke.NUKE_VERSION_MAJOR >= 9:
                # Nuke 9.0v1 removed ffmpeg and replaced it with the mov64 writer
                # http://help.thefoundry.co.uk/nuke/9.0/#appendices/appendixc/supported_file_formats.html
                settings["file_type"] = "mov64"
                settings["mov64_codec"] = "jpeg"
                settings["mov64_quality_max"] = "3"
                settings["colorspace"] = "Output - sRGB"
            else:
                # the 'codec' knob name was changed to 'format' in Nuke 7.0
                settings["file_type"] = "ffmpeg"
                settings["format"] = "MOV format (mov)"
                settings["colorspace"] = "Output - sRGB"

        return settings

Now if you got all that right then when you publish in Nuke the QT will be made in an ACES compatible colorspace!

4 Likes

We had the same issue with tk-nuke-quickreview FYI. In that scenario we ended up taking over the settings.py hook to set the output colorspace of the write node to something more sensible. In our case, since we wanted the OCIO profile to determine the appropriate colorspace we had to query for it like this:

    monitorLut = nuke.Root().knob("monitorLut").value()
    colorManagement = nuke.Root().knob("colorManagement").value()
    if colorManagement == 'OCIO':
        # OCIO displays either come in the form of view/display or display with an implicit 'default' view
        displayView = monitorLut.split('/')
        view = displayView.pop()
        display = displayView and displayView[0] or 'default'
        colorspace = nuke.Root().getOCIOColorspaceFromViewTransform(display, view)
    else:
        colorspace = monitorLut
6 Likes

Hey chaps, I’m struggling to get this working.

I’ve taken over the hook and brought it into the config by adding this line in the tk-multi-reviewsubmission.yml:

render_media_hook: '{self}/render_media.py:{config}/tk-multi-publish2/tk-nuke/render_media.py'

then added settings["colorspace"] = "matte_paint" to the render_media.py as outlined above:

Nuke doesn’t seem to pick this up and still tries to render the QT with gamma2.2.

Any ideas on what could be going wrong?

thanks

Steve

Hi Steve,

Did you ever get this sorted?
I am having the same issue, tries to render in Gamma2.2 but fails.
Seems if I change the working colorspace to nuke-default it will work, but this means we cannot render in ACES so its not really a solution, just another cookie crumb to try and follow

Thanks
Eoin

Hey @steveprimary or @eoincoakley did you ever manage to get this working?

I have to say, I like the fact that there are help docs for this stuff but I kind of don’t like how none of them say “change this is in this file like this” and instead assume you know where everything is meant to go.

Hey Matteo,

Toolkit administration and customisation is very much a Pipeline Developers job or someone who is experienced in Python.

The out of the Box Experience only works a certain way and is an example of how things can work.
To change it you will have to “take it over” and make modifications to the toolkit app settings and potentially some runtime hook code for Nuke.

Otherwise you can engage a pipeline developer or pipeline consulting company (like mine) to do this for you or to provide you with their own tools and apps on top of the base toolkit that may provide extra features.

But in the basis, you may have to alter this hook (but in the correct way to override hooks in toolkit, don’t change the app code):

1 Like

This video may help with Toolkit Admin:

Hey @Ricardo_Musch

Thanks for sending these over, I managed to work it out after posting but it’s nice to have my actions confirmed with the GH link and YT link you provided.

I think the main thing for me was that (as with Steve and Eoin above) I knew which py hook file to override but I couldn’t work out how to override it.

Turns out it was as simple as adding (somehow it didn’t already exist) the render_media_hook tag to config > env > includes > settings > tk-multi-reviewsubmission.yml as such:

################################################################################

includes:
- ../app_locations.yml

################################################################################

# ---- Nuke

# asset
settings.tk-multi-reviewsubmission.nuke.asset:
  render_media_hook: '{self}/render_media.py:{config}/tk-multi-reviewsubmission/tk-nuke/render_media.py'
  movie_path_template: nuke_asset_render_movie
  slate_logo: icons/review_submit_logo.png
  location: "@apps.tk-multi-reviewsubmission.location"

# shot
settings.tk-multi-reviewsubmission.nuke.shot:
  render_media_hook: '{self}/render_media.py:{config}/tk-multi-reviewsubmission/tk-nuke/render_media.py'
  movie_path_template: nuke_shot_render_movie
  slate_logo: icons/review_submit_logo.png
  location: "@apps.tk-multi-reviewsubmission.location"

Then making sure it pointed to the new render_media.py file that I copied from tk-multi-reviewsubmission > tk-nuke > render_media.py.

I’m sure the how is somewhere in the help docs but not where it needs to be, at least in this case. The YouTube video you shared is actually great but I would love if even half of the info in that is ported to searchable docs

@nico.vandenbosch for the quick review override, I don’t see an existing yaml in the Settings folder. I do see some reference to quick review in the tk-nuke.yml file but I’m not sure if I’m to make a new yml settings file which will then point to the settings.py override or if I need to edit the tk-nuke.yml file to point to it?

Okay I worked it out, for anyone else reading in the future, you need to edit:
config > env > includes > settings > tk-nuke.yml

Wherever you see “tk-nuke-quickreview” add this line:
settings_hook: '{self}/settings.py:{config}/tk-nuke-quickreview/settings.py'

e.g. here’s the first instance in the tk-nuke.yml file you’ll need to change:

# Nuke

# asset
settings.tk-nuke.asset:
  apps:
    tk-multi-about:
      location: "@apps.tk-multi-about.location"
    tk-multi-screeningroom: "@settings.tk-multi-screeningroom.rv"
    tk-multi-shotgunpanel: "@settings.tk-multi-shotgunpanel"
    tk-multi-workfiles2: "@settings.tk-multi-workfiles2"
    tk-nuke-quickreview:
      location: "@apps.tk-nuke-quickreview.location"
      settings_hook: '{self}/settings.py:{config}/tk-nuke-quickreview/settings.py'
  menu_favourites:
  - {app_instance: tk-multi-workfiles2, name: File Open...}
  location: "@engines.tk-nuke.location"

Change “/tk-nuke-quickreview/settings.py” to wherever you have saved the new settings.py override file, for example mine is here:


NOTE: You don’t need to make the pycache folders, those are created when SG Toolkit first loads (and caches) whatever code you put in that parent folder e.g. settings.py

1 Like