I am making a small lookdev HDA just for myself and I like to switch between Karma and Redshift quite a lot to try both renderers. My idea was making a switch node with a Karma branch and a Redshift branch with the render settings.
I can make this manual with an index selection exposed on the HDA, which works.
But I was wondering if there was a way to automate this by simply switching the renderer in the viewport and driving the switch node by this selection.
Gemini had me try some python but it led me pretty much nowhere and I am stuck. I don't even know if this is possible. This is not very important but would be nice. But maybe there is a much simpler way I am missing.
For reference, Gemini made me do a Python script in the HDA type properties
import hou def get_render_delegate_index(): scene_viewer = hou.ui.paneTabOfType(hou.paneTabType.SceneViewer) if not scene_viewer: return 0 delegate_name = scene_viewer.curViewport().settings().renderDelegateName() if "Redshift" in delegate_name: return 1 elif "karma" in delegate_name.lower(): return 0 return 0
then an expression in the switch node
hou.node('..').hdaModule().get_render_delegate_index()
Cheers