Ben Toogoood
Ben Toogood Aardman
About Me
Connect
LOCATION
Not Specified
WEBSITE
Houdini Skills
Availability
Not Specified
Recent Forum Posts
Help with implementing custom 'BackgroundRenderer' March 14, 2025, 9:56 a.m.
Super - thanks for taking a look Rob. Great to hear a more sensible approach to this is on the to-do list.
Your note on the risk is very helpful, not sure we would have spotted that. We'll look at mitigating by copying the file somewhere first.
But, before that I'm still having now luck getting it to work even with your example. I'm running on Windows (11 specifically) here so wonder if that's possibly causing some complication?
I've attached a screen recording of what I see - the 'renderer' is registered and available in the drop down list, but summoning it doesn't pop up the 'selectFile' ui and I get no print output. Something does appear in the gallery, but it's a blank single pixel.
Do let us know if there's any more info that would help or any other tests we can do.
cheers
Your note on the risk is very helpful, not sure we would have spotted that. We'll look at mitigating by copying the file somewhere first.
But, before that I'm still having now luck getting it to work even with your example. I'm running on Windows (11 specifically) here so wonder if that's possibly causing some complication?
I've attached a screen recording of what I see - the 'renderer' is registered and available in the drop down list, but summoning it doesn't pop up the 'selectFile' ui and I get no print output. Something does appear in the gallery, but it's a blank single pixel.
Do let us know if there's any more info that would help or any other tests we can do.
cheers
Help with implementing custom 'BackgroundRenderer' March 13, 2025, 1:33 p.m.
And if anyone knows of a much more sensible way to load existing images into he RenderGallery to share that too! Feels like we might be missing something - would be super helpful to know if there's a built in way.
Help with implementing custom 'BackgroundRenderer' March 13, 2025, 1:30 p.m.
Hi - we're attempting to hijack the Rendergallery BackgroundRender plugin [www.sidefx.com] mechanism to be able to load existing images from disk into the snapshot history (so that we can do A/B comparisons).
So far we've managed to register a(very simple) plugin and trigger a dialog to select the image from disk, but no luck with actually getting it to load and the system doesn't seem to ever reach either the startBackgroundRender() or isRenderFinished() methods. I feel like I must be approaching something obviously wrong, but haven't been able to find any examples out there to work from other than the docs.
Is there anyone from Sidefx that is able to advise, or anyone in the community that's had success with these?
Example we're testing with:
So far we've managed to register a(very simple) plugin and trigger a dialog to select the image from disk, but no luck with actually getting it to load and the system doesn't seem to ever reach either the startBackgroundRender() or isRenderFinished() methods. I feel like I must be approaching something obviously wrong, but haven't been able to find any examples out there to work from other than the docs.
Is there anyone from Sidefx that is able to advise, or anyone in the community that's had success with these?
Example we're testing with:
from husd.backgroundrenderer import BackgroundRenderer import hou # Your render class should subclass husd.backgroundrenderer.BackgroundRenderer. # You probably want to name your class based on the type of render it implements, # for example CloudServiceRenderer. class LoadImageToGallery(BackgroundRenderer): # The default __init__ implementation sets up some useful instance variables: # self._lopnet_path: # (str) The node path of the LOP network, for example "/stage" # self._item_id: # (str) A unique ID string for this render. You can use this to construct # names or identifiers, for example a job name for a render farm manager. # You can call the following helper functions: # # self.updateImagePath(image_path) # Update the snapshot to use the image at the given path. # # self.updateMetadata(metadata) # Update the snapshot's metadata using the given dict. The keys are mostly # arbitrary, but a few are used by Houdini's UI: # "totalClockTime": # (float) current elapsed time in seconds, the render gallery viewer # displays this in the render stats. # "percentDone": # (float) Percent complete (0-100), also displayed in the render stats. # "peakMemory": # (int) Maximum memory usage of the def pollFrequency(self): # How often (every this number of (floating poitn) seconds) the system # should ask call the methods on this object to get updates. return 0.1 def getConfigOptions(self, old_options): # This method is intended to launch a configuration interface, get # option values from the user, and then return the option key/values # as a dict. The argument is a dict containing what this method # returned the last time it was called, so you can fill in the # previous values in the options UI for the user. # This method is only called if the user chooses the render plugin # from the menu. If the user just clicks the Background button, # the system will call startBackgroundRender() with the previous # values directly instead of calling this method to show the config # UI first. print("CONFIG") self._inputpath = hou.ui.selectFile() print("RESULT") print(self._inputpath) return {} def startBackgroundRender(self, usd_filepath, options): # This method should start the background renderer. # usd_filepath: the file path of the USD file to render. # The options argument is a dict where: # - options["plugin"] is the user options dict returned by # getConfigOptions(). # - options["viewport"]["rendersettings_path"] is the scene graph path # of the RenderSettings prim for the snapshot. # - options["viewport"]["camera_path"] is the scene graph path to the # camera prim for the snapshot. # - options["viewport"]["res_x"] is the pixel width of the snapshot # render product. # - options["viewport"]["res_y"] is the pixel height of the snapshot # render product. print("START") return def isRenderFinished(self): # The system will call this method periodically. It should return # True if the render started by this object has finished. # # This is where you can call self.updateImagePath(image_path) # and/or self.updateMetadata(metadata_dict) to send feedback about # your render's progress. print("PRE-FINISH") self.updateImagePath("C:/localapps/sidefx/Houdini-20.5.522/houdini/pic/lookdev/colorchecker_ACEScg.exr") print("FINISHED") print(self._inputpath) return True def mouseClick(self, x, y): # Called when the user clicks in a render preview window. # x and y are normalized coordinates, so for example x=0.0 means # the left edge, x=0.5 means the center, and x=1.0 means the # right edge. # The usual behavior for mouse clicks is to concentrate rendering # in the part of the image where the user clicked. pass def stopBackgroundRender(self): # Called if the user right-clicks the live snapshot and chooses # Stop Rendering. This method should not return until the render # is stopped. pass # You must include the registration function: this is what Houdini looks for # when it loads your plugin file def registerBackgroundRenderers(manager): # The first argument is a human-readable label for the render type, # the second argument is your background render class manager.registerBackgroundRenderer('Load an image', LoadImageToGallery)