Skip to main content
Participant
April 3, 2023
Question

Applying auto settings with a lua script

  • April 3, 2023
  • 1 reply
  • 4571 views

The documentation for applyDevelopSettings implies that there is a way to request auto settings, but it does not say what that is. 

 

I tried passing an empty table for settings, and also a table of

 

            {
                ['AutoBrightness'] = true,
                ['AutoContrast'] = true,
                ['AutoExposure'] = true,
                ['AutoHighlight'] = true,
                ['AutoShadows'] = true,
            }

 

for convenience, here is the documentation:

photo:applyDevelopSettings
( settings, optHistoryName, optFlattenAutoNow )

apply develop settings to an image.

Parameters

1. settings (table) table of settings to be applied.

2. optHistoryName (optional, string) name of the history step.

3. optFlattenAutoNow (optional, boolean) True to resolve Auto settings synchronously within the context of this API call.

 

This topic has been closed for replies.

1 reply

johnrellis
Legend
April 4, 2023

Those Auto* settings are legacies from old process versions. 

 

The only way I've discovered is to call photo:applyDevelopPreset() with an LrDevelopPreset that was defined with "Auto Settings" checked.

 

There's a built-in preset Classic - General > Auto Settings that is exactly that. But beware there is an elementary programming bug in the SDK in which enumerating through all installed presets to find a particular preset takes O(n^2) time for the number of presets n. For users with thousands of presets (there are many such users), it could take tens of seconds to minutes to enumerate the presets to find "Auto Settings".  Adobe has never made it a priority to fix this, and in fact, Adobe Principal Scientist @simonsaith denied the problem.

 

You could try LrApplication.addDevelopPresetForPlugin() to create a plugin-specific preset with {AutoSettings = true}, but I don't know if that method was correctly updated after the "new" preset format was added in LR 7 -- lots of bugs were introduced then.