Fix for UI in breakdown2 in Houdini

Hi,

We had an issue in Houdini 20 (windows), using tk-houdini v1.8.7 and tk-multi-breakdown2 v0.2.9 (tk-core v0.20.32)

The color of the items was very bright, making it almost unreadable

What fixed it for us :

1/ Add a custom hook for breakdown2 in your config. I named it tk-houdini_ui_config_advanced.py

contents of that hook :

import sgtk
from sgtk.platform.qt import QtGui
HookClass = sgtk.get_hook_baseclass()

class HoudiniUIConfig(HookClass):

    def get_item_background_color(self, item):
        return QtGui.QApplication.palette().base()

In the config yml of tk-multi-breakdown2 add this hook :

settings.tk-multi-breakdown2.houdini:
  hook_scene_operations: "{config}/tk-multi-breakdown2/hou_scene_operations.py"
  panel_mode: False
  published_file_filters: []
  hook_ui_config_advanced: "{self}/ui_config_advanced.py:{config}/tk-multi-breakdown2/tk-houdini_ui_config_advanced.py"
  location: "@apps.tk-multi-breakdown2.location"

The result looks like this :

I hope this helps someone :wink:

Cheers

2 Likes

Thank you for this, it is also present in workfiles.
So it was a missing default hook?
Also thanks for sharing on GitHub. I’ll shoot a PR with the fix this week

1 Like

@mmoshev In the case of multi-workfiles2 it was a missing hook in the configuration.

It seems to me that when updating using the tank update command, the process can detect that new config settings are necessary for a new app to function correctly and autofill the config with default values. For some reason this didn’t happen for us when we updated the workfiles2 app.

For the scene breakdown, I’m not sure about my fix, I just tried applying an analogue fix.

Regards

This can probably be a default hook in one of the tk qt frameworks. I guess it won’t hurt on other programs, anyway - it is just some qt widget initialization. But my knowledge of the subject is insufficient.