Houdini Toolkit GUI has unreadable colors

I just updated all my Toolkit components, and now the loader in Houdini looks like this, the entries in the list used to have pretty low contrast before as well, but now it’s almost unreadable with light gray on white.

It’s only happening in Houdini, so I’m assuming it picks up the color from Houdini somewhere, so is it something I can easily tweak? Or is it a more fundamental issue with the Houdini integration?

Thanks

You need to tweak your config a little and add this hook for Houdini Workfiles

Create a hook file:

hooks/tk-multi-workfiles2/basic/ui_config.py

# Copyright (c) 2023 Autodesk, Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights
# not expressly granted therein are reserved by Autodesk, Inc.

import sgtk
from sgtk.platform.qt import QtGui

HookClass = sgtk.get_hook_baseclass()


class HoudiniUIConfig(HookClass):
    """Hook to customize customize the main file view for Houdini."""

    def get_item_background_color(self, item):
        """
        Returns the brush to use to draw the background for this widget

        Top-level items will use the default brush (None is returned), and non-top level items
        will use the QPalette base brush to paint the background.

        :param item: The model item
        :type item: :class:`sgkt.platofrm.qt.QtGui.QStandardItem`

        :return: The QBrush.
        :rtype: :class:`sgtk.platform.qt.QtGui.QBrush`
        """

        parent = item.index().parent()
        if not parent.isValid():
            return

        return QtGui.QApplication.palette().base()

Tweak the config of the workfiles2 app for houdini and add this line:

ui_config_hook: '{self}/ui_config.py:{engine}/tk-multi-workfiles2/basic/ui_config.py'

Thanks! But no success yet. Can you be more specific about the second step, because I’m not sure I did it correctly. Are we talking about env/includes/settings/tk-multi-workfiles2.yml?

Like this (in every Houdini related workfiles config, so .asset_step, .shot_step etc.):

Thanks, that did work for the asset and shot steps once I’ve opened or saved a scene, but it’s still wrong when you’re not in a context yet, i.e. the “Project Environment”, for example when you just open the program from FPT Desktop and go “Open” from the FPT menu.

Seems like I don’t have any Houdini-specific settings for that in my yml. Is there a way to add this hook to the Project environment lever as well? I tried this by looking at other lines in there, but doesn’t seem to work, so maybe there’s another way to get to that Project env?

# Houdini project
settings.tk-multi-workfiles2.houdini.project:
  ui_config_hook: '{self}/ui_config.py:{engine}/tk-multi-workfiles2/basic/ui_config.py'

You are on the right track but you now need to reference that new environment setting in your Project step environment for Houdini.

I see, but that line you’ve underlined is already present, should I modify it?

Yes you need to point it to the name of your houdini project config.

tk-multi-workfiles2: "@settings.tk-multi-workfiles2.houdini.project"

I tried that, but the whole Desktop app breaks, so there must be more to it.

tank.errors.TankError: "location" key missing in the definition of "tk-multi-workfiles2" in file [...]\env\project.yml

What does your houdini env look like?
It seems like you are not adding the location key.

Does your env look like this?

The config I use have been kicking around for a while and may not be up to date, but it looks like this, seems the same to me except for the pythonconsole lines:

# project
settings.tk-houdini.project:
  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"
  menu_favourites:
  - {app_instance: tk-multi-workfiles2, name: File Open...}
  location: "@engines.tk-houdini.location"

Is it erroring like this?

Yes, if I change;

tk-multi-workfiles2: "@settings.tk-multi-workfiles2"

to

tk-multi-workfiles2: "@settings.tk-multi-workfiles2.houdini.project"

..then the whole things stops working with this error message:

tank.errors.TankError: "location" key missing in the definition of "tk-multi-workfiles2" in file [...]\env\project.yml

Perhaps I need to update my whole config or something. Or I’m misunderstanding where to edit this line.

Its a bit hard to help without seeing the rest of your config but the error you are seeing occurs because you are breaking the configuration/schema.

It’s worth looking at the examples of how apps and app configurations are declared for other apps.