ID 587940 - The Catalog's Thumbnail job queue processes updates continuously which can lead to poor performance when the queue is inundated with updates.

Follow

Problem summary
The Catalog's Thumbnail job queue processes queued updates continuously, which can lead to poor performance when the queue is inundated with updates. In previous versions the processing of the queue was time gated, which meant there were fewer calls to update thumbnails.
 
Customer reported version
Katana 6.5v4
 
Customer reported platform
CentOs 7
 
Steps to reproduce
 
1) Launch Katana with 3Delight.

2) Navigate to the Help >  Example Projects > Other Technical Examples > Secondary Images (AOVs) and select Open Project > Open for 3Delight.

3) Switch to the Python tab, then paste and run the following Python Script:
 
def eventFilter(*args, **kwargs):     if(args[0] == "catalog_itemThumbnailUpdate"):         global i         i = i + 1         print(args, kwargs)         return True     return True i = 0 Utils.EventModule.RegisterEventFilter(eventFilter)
 
4) Switch to the Scene Graph tab, then right click the Render4 node and select Live Render
 
5) Inspect the terminal or within the Python tab run print(i) and notice the number of Catalog Thumbnail updates being processed.
 
6) Repeat the above steps in an older version of Katana, such as 6.0v4. 6.5v3 or 7.0v3 and notice the fewer number of updates that are processed.
 
Expected behaviour
Catalog Thumbnail updates are processed intermittently, greatly reducing the number of calls to process queued updates.
 
Actual behaviour
Catalog Thumbnail updates are processed as soon as they join the queue, which can cause UI performance issues throughout Katana as more calls to update are processed.
 
Workaround
The current workaround is to patch in an indirection for the RegenerateThumbnail() function to collect and eventually forward thumbnail updates in batches based on a timer. To use the following script either run the code in the Python tab, or create a .py file in the UIPlugins folder in one of your KATANA_RESOURCES directories and insert the following to automatically run the code when launching Katana.
 
import UI4import PyQt5.QtCore as QtCoreoriginalRegenerateThumbnail = UI4.Util.CatalogEventHandlers.RegenerateThumbnailg_catalogItems = {}g_timer = QtCore.QTimer()g_timer.setSingleShot(True)# Set batch update to run after specific interval delayg_timer.setInterval(500)def regeneratePending():    for catalogItem in g_catalogItems:        originalRegenerateThumbnail(catalogItem)    g_catalogItems.clear()g_timer.timeout.connect(regeneratePending)def newRegenerateThumbnail(catalogItem):    # Use dict to ensure deduplication while maintaining insertion order    g_catalogItems[catalogItem] = None    # If not started, start single shot timer to call regeneratePending() after 500ms    if g_timer.isActive() == False:        g_timer.start()UI4.Util.CatalogEventHandlers.RegenerateThumbnail = newRegenerateThumbnail

Reproduced by support
This bug has been reproduced in:
Katana 7.0v4 - Windows 10, Rocky 9
Katana 6.5v4 - Windows 10, CentOs 7
Katana 6.0v5 - Windows 10, CentOs 7
 
Unable to reproduce bug in:
Katana 7.0v3 - Windows 10, Rocky 9
Katana 6.5v3 - Windows 10, CentOs 7
Katana 6.0v4 - Windows 10, CentOs 7
 
Earliest version tested
Katana 6.0v4 - This issue doesn't appear in this version and has regressed 

    We're sorry to hear that

    Please tell us why