Skip to main content
Photo Taco Podcast
Known Participant
June 22, 2023
Question

Wait for UI to update after LrSelection.nextPhoto()

  • June 22, 2023
  • 1 reply
  • 277 views

Goal: Have my plugin wait for the UI to fully catch up after calling LrSelection.nextPhoto() in the Develop Module before making another call to LrSelection.nextPhoto().

 

The last UI element to update seems to be the Auto button in the basic panel.  That happens much faster for some raw file types than it does for others (horribly slow for Fuji XT-3 raw types).  I want to wait for that to happen before taking other actions, like moving to the next photo again.

 

I have done my best to search through the latest SDK documentation and this forum but haven't yet found a way to accomplish my goal. Here are some of the things I have tried:

  1.  Incrementing Exposure by 1 and waiting for getDevelopSettings() to reflect the update before doing anything else. The expsoure increment seems to work just fine, gets applied to all of the photos as I go throug them one by one, but does not give sufficient time for the UI to update before moving on to the next photo.
  2.  Registered an addAdjustmentChangeObserver and wait for all of the adjustments to change before moving to the next photo. In testing this it seemed there were almost always 6 adjustmentChange events with every nextPhoto() call, but not always. Even after waiting for there to be no more adjustmentChange events for 100ms this didn't allow for the UI to update (Auto button lit).
  3.  Registered the undocumented addActivePhotoChangeObserver, which does reliably say that the active photo changed once per nextPhoto() call, but the event happens much faster than the UI updating.
  4.  Make an external call out to openCV to watch the area where the Auto button is and watch for it to go unlit, then lit.

 

Number 4 works perfectly, but it is both extremely brittle and would reqauire openCV be installed on any computer that uses my plugin. Is there a better way to know that the UI has fully updated after calling LrSelection.nextPhoto().  I would be fine with polling some table for a value that would tell me it is done, but I can't figure out what I would poll.

This topic has been closed for replies.

1 reply

johnrellis
Legend
June 23, 2023

I don't know of any SDK method (documented or not) to wait for the UI to finish painting fully.

 

Note that the Auto button is usually slowest to update because it will be enabled (not greyed out) only if the current develop settings are different from the settings that Auto would apply.  To determine that, LR runs the fairly slow Auto algorithm in background each time the current photo in Develop changes.  So relying on Auto to enable won't be reliable -- it may never enable if the user has already clicked Auto.

Photo Taco Podcast
Known Participant
June 23, 2023

Thanks so much for the response John. I reset all the photos before doing this so I know that Auto will be available. If waiting for Auto isn't the best way to go through the photos as fast as possible but still let LrC do all of the work it would do when scrolling through each image, what do you think is the best indicator in the Develop Module?

johnrellis
Legend
June 23, 2023

I don't know -- what's the higher goal of waiting for LR to finish painting the UI?