Skip to main content
johnrellis
Legend
February 16, 2022
Open for Voting

P: SDK: LrDevelopController.getValue() returns nil for crop settings Select Sky/Subject

  • February 16, 2022
  • 1 reply
  • 1670 views

LrDevelopController.getValue (key) returns nil for all the crop settings (CropLeft, CropRight, CropTop, CropBottom) immediately after a user clicks Select Subject or Sky.  To reproduce:

 

1. Save the following script in the Scripts folder.

 

2. Run the script, which starts a background task calling LrDevelopController.getValue().

 

3. Edit a photo in Develop, open the Masking tool, and click Select Sky.

 

4. Observe this message displayed:

 

Tested on LR 11.2 / Mac OS 11.6.2.

 

 

 

local LrTasks = import "LrTasks"

local catalog = import "LrApplication".activeCatalog ()
local getCurrentModuleName = import "LrApplicationView".getCurrentModuleName
local getValue = import "LrDevelopController".getValue
local showBezel = import "LrDialogs".showBezel

LrTasks.startAsyncTask (function ()
    while true do
        local photo = catalog:getTargetPhoto ()
        if photo ~= nil and getCurrentModuleName () == "develop" then
            local CropLeft, CropRight, CropTop, CropBottom = 
                getValue ("CropLeft"), getValue ("CropRight"),
                getValue ("CropTop"), getValue ("CropBottom")
            if CropLeft == nil then 
                showBezel (string.format (
                    "CropLeft = %s\nCropRight = %s\nCropTop = %s\n" ..
                    "CropBottom = %s\n", CropLeft, CropRight, CropTop, 
                    CropBottom), 10)
                end
            end
        LrTasks.sleep (0.2)
        end
    end)

 

 

 

1 reply

Rikk Flohr_Photography
Community Manager
February 18, 2022

Bug logged.

Engineering has reported this as-designed: 

Comments from an engineer: 

"When a Select Subject or Select Sky detection is running, we don't want user to interact with any develop settings. So during that time most of the LrDevelopController APIs will not work as expected."

Rikk Flohr: Adobe Photography Org
johnrellis
Legend
March 19, 2022

Thanks, can you please convert this to a request to update the SDK API documentation:

 

While the user is executing Select Subject or Sky, LrDevelopController.getValue () will return nil and LrDevelopController.setValue () will be ignored [Is the latter correct?]

 

Thanks.