Lightroom SDK: photo:applyDevelopPreset() changes all settings, not just those of preset

  • 5
  • Problem
  • Updated 6 days ago
  • In Progress
  • (Edited)
[Update: There are two symptoms of the same underlying bug introduced in LR 7.3:

- preset:getSetting() returns all develop settings, not just those set by the preset

- photo:applyDevelopPreset() changes all settings, not just those of the preset

See this post for a script demonstrating both:
https://feedback.photoshop.com/photoshop_family/topics/lr-classic-7-3-resets-settings-when-develop-p...

-- John Ellis]

I use a script that uses "photo:applyDevelopPreset". If i use it with a partial preset (that have only a few or only one setting) it resets all other settings to default.
Reverting to previous version until this is fixed.
Photo of ariel martini

ariel martini

  • 16 Posts
  • 5 Reply Likes

Posted 2 months ago

  • 5
Photo of Sunil Bhaskaran

Sunil Bhaskaran, Official Rep

  • 299 Posts
  • 100 Reply Likes
Thanks for letting us know.
We are investigating.

Thanks,
Sunil
Photo of Ganesh

Ganesh, Lightroom Engineer

  • 37 Posts
  • 18 Reply Likes
@ariel can you share more details about the issue? If possible share your script, preset(s) along with the steps to reproduce. We will reach your email to request more details.

Thanks,
Ganesh
Photo of Ganesh

Ganesh, Lightroom Engineer

  • 37 Posts
  • 18 Reply Likes
Thanks  @ariel martini for the details.

I am able to reproduce the issue you are reporting. We will make a fix.

Thanks,
Ganesh
Photo of ariel martini

ariel martini

  • 16 Posts
  • 5 Reply Likes
Hey Ganesh, 7.3.1 not only DOESNT fix this, it makes scripts totally useless. I get "Assertion Failed" dialog box. How is this even released without passing this test?
Photo of Ganesh

Ganesh, Lightroom Engineer

  • 37 Posts
  • 18 Reply Likes
@ariel Lr 7.3.1 does not has the fix. Can you provide more details about the "assertion failed" dialog box. If possible please share the exact script which you are testing over email. One of our team member already contacted you over email some time back.

Regards,
Ganesh
Photo of ariel martini

ariel martini

  • 16 Posts
  • 5 Reply Likes
Ganesh I have no time to debug and troubleshoot for you, I pay for the software, I do not get paid to use it. If you want to pay me to debug it for you, I will be glad to do so.
Photo of John R. Ellis

John R. Ellis, Champion

  • 3448 Posts
  • 876 Reply Likes
Ganesh, please see this post for a script that demonstrates both symptoms of the bug:
https://feedback.photoshop.com/photoshop_family/topics/lr-classic-7-3-resets-settings-when-develop-p...
Photo of Joan Torrijos

Joan Torrijos

  • 1 Post
  • 0 Reply Likes
I have the same problem... I have a preset that sets the sharpening parameters.  When I apply it in LR Classic CC 7.3.1 it reverts the basic parameters to default.
Photo of Tomasz Sagadyn

Tomasz Sagadyn

  • 1 Post
  • 0 Reply Likes
following... applying presets via script resets every setting to 0 which r not included in preset!
Photo of John R. Ellis

John R. Ellis, Champion

  • 3448 Posts
  • 876 Reply Likes
This reply was created from a merged topic originally titled Lightroom SDK: preset:getSetting() returns all develop settings, not just those o....

In LR 7.3.1, preset:getSetting() returns all develop settings, not just the settings actually changed by the preset. This breaks existing plugins.

For example, the .xmp of a preset that changes just Exposure contains just the Exposure2012 develop setting:
   crs:Exposure2012="-0.12"
But preset:getSetting() returns all the develop settings:
{--table: 1
    AutoBrightness = false, 
    AutoContrast = false, 
    AutoExposure = false, 
    AutoGrayscaleMix = false, 
    AutoLateralCA = 0, 
    AutoShadows = false, 
    AutoTone = false, 
    Blacks2012 = 0, 
    BlueHue = 0, 
    BlueSaturation = 0, 
    Brightness = 50, 
    ChromaticAberrationB = 0, 
    ChromaticAberrationR = 0, 
    Clarity = 0, 
    Clarity2012 = 0, 
    ColorNoiseReduction = 25, 
    ColorNoiseReductionDetail = 50, 
    ColorNoiseReductionSmoothness = 50, 
    Contrast = 25, 
    Contrast2012 = 0, 
    ConvertToGrayscale = false, 
    Defringe = 0, 
    DefringeGreenAmount = 0, 
    DefringeGreenHueHi = 60, 
    DefringeGreenHueLo = 40, 
    DefringePurpleAmount = 0, 
    DefringePurpleHueHi = 70, 
    DefringePurpleHueLo = 30, 
    Dehaze = 0, 
    EnableCalibration = true, 
    EnableCircularGradientBasedCorrections = true, 
    EnableColorAdjustments = true, 
    EnableDetail = true, 
    EnableEffects = true, 
    EnableGradientBasedCorrections = true, 
    EnableGrayscaleMix = true, 
    EnableLensCorrections = true, 
    EnablePaintBasedCorrections = true, 
    EnableRedEye = true, 
    EnableRetouch = true, 
    EnableSplitToning = true, 
    EnableToneCurve = true, 
    EnableTransform = true, 
    Exposure = 0, 
    Exposure2012 = -0.12, 
    FillLight = 0, 
    GrainAmount = 0, 
    GrainFrequency = 50, 
    GrainSize = 25, 
    GrayMixerAqua = 0, 
    GrayMixerBlue = 0, 
    GrayMixerGreen = 0, 
    GrayMixerMagenta = 0, 
    GrayMixerOrange = 0, 
    GrayMixerPurple = 0, 
    GrayMixerRed = 0, 
    GrayMixerYellow = 0, 
    GreenHue = 0, 
    GreenSaturation = 0, 
    HighlightRecovery = 0, 
    Highlights2012 = 0, 
    HueAdjustmentAqua = 0, 
    HueAdjustmentBlue = 0, 
    HueAdjustmentGreen = 0, 
    HueAdjustmentMagenta = 0, 
    HueAdjustmentOrange = 0, 
    HueAdjustmentPurple = 0, 
    HueAdjustmentRed = 0, 
    HueAdjustmentYellow = 0, 
    LensManualDistortionAmount = 0, 
    LensProfileEnable = 0, 
    LensProfileSetup = "LensDefaults", 
    LuminanceAdjustmentAqua = 0, 
    LuminanceAdjustmentBlue = 0, 
    LuminanceAdjustmentGreen = 0, 
    LuminanceAdjustmentMagenta = 0, 
    LuminanceAdjustmentOrange = 0, 
    LuminanceAdjustmentPurple = 0, 
    LuminanceAdjustmentRed = 0, 
    LuminanceAdjustmentYellow = 0, 
    LuminanceNoiseReductionContrast = 0, 
    LuminanceNoiseReductionDetail = 50, 
    LuminanceSmoothing = 0, 
    OverrideLookVignette = false, 
    ParametricDarks = 0, 
    ParametricHighlights = 0, 
    ParametricHighlightSplit = 75, 
    ParametricLights = 0, 
    ParametricMidtoneSplit = 50, 
    ParametricShadows = 0, 
    ParametricShadowSplit = 25, 
    PerspectiveAspect = 0, 
    PerspectiveHorizontal = 0, 
    PerspectiveRotate = 0, 
    PerspectiveScale = 100, 
    PerspectiveUpright = 0, 
    PerspectiveVertical = 0, 
    PerspectiveX = 0, 
    PerspectiveY = 0, 
    PostCropVignetteAmount = 0, 
    PostCropVignetteFeather = 50, 
    PostCropVignetteHighlightContrast = 0, 
    PostCropVignetteMidpoint = 50, 
    PostCropVignetteRoundness = 0, 
    PostCropVignetteStyle = 1, 
    ProcessVersion = "10.0", 
    RedEyeInfo = {}, 
    RedHue = 0, 
    RedSaturation = 0, 
    RetouchInfo = {}, 
    Saturation = 0, 
    SaturationAdjustmentAqua = 0, 
    SaturationAdjustmentBlue = 0, 
    SaturationAdjustmentGreen = 0, 
    SaturationAdjustmentMagenta = 0, 
    SaturationAdjustmentOrange = 0, 
    SaturationAdjustmentPurple = 0, 
    SaturationAdjustmentRed = 0, 
    SaturationAdjustmentYellow = 0, 
    Shadows = 5, 
    Shadows2012 = 0, 
    ShadowTint = 0, 
    SharpenDetail = 25, 
    SharpenEdgeMasking = 0, 
    SharpenRadius = 1, 
    Sharpness = 40, 
    SplitToningBalance = 0, 
    SplitToningHighlightHue = 0, 
    SplitToningHighlightSaturation = 0, 
    SplitToningShadowHue = 0, 
    SplitToningShadowSaturation = 0, 
    ToneCurve = {--table: 2
        [1] = 0, 
        [2] = 0, 
        [3] = 32, 
        [4] = 22, 
        [5] = 64, 
        [6] = 56, 
        [7] = 128, 
        [8] = 128, 
        [9] = 192, 
        [10] = 196, 
        [11] = 255, 
        [12] = 255}, 
    ToneCurveBlue = {--table: 3
        [1] = 0, 
        [2] = 0, 
        [3] = 255, 
        [4] = 255}, 
    ToneCurveGreen = {--table: 4
        [1] = 0, 
        [2] = 0, 
        [3] = 255, 
        [4] = 255}, 
    ToneCurveName = "Medium Contrast", 
    ToneCurveName2012 = "Linear", 
    ToneCurvePV2012 = {--table: 5
        [1] = 0, 
        [2] = 0, 
        [3] = 255, 
        [4] = 255}, 
    ToneCurvePV2012Blue = {--table: 6
        [1] = 0, 
        [2] = 0, 
        [3] = 255, 
        [4] = 255}, 
    ToneCurvePV2012Green = {--table: 7
        [1] = 0, 
        [2] = 0, 
        [3] = 255, 
        [4] = 255}, 
    ToneCurvePV2012Red = {--table: 8
        [1] = 0, 
        [2] = 0, 
        [3] = 255, 
        [4] = 255}, 
    ToneCurveRed = {--table: 9
        [1] = 0, 
        [2] = 0, 
        [3] = 255, 
        [4] = 255}, 
    ToneMapStrength = 0, 
    UprightCenterMode = 0, 
    UprightCenterNormX = 0.5, 
    UprightCenterNormY = 0.5, 
    UprightFocalLength35mm = 35, 
    UprightFocalMode = 0, 
    UprightFourSegmentsCount = 0, 
    UprightPreview = false, 
    UprightTransformCount = 6, 
    UprightVersion = 151388160, 
    Version = "10.3", 
    Vibrance = 0, 
    VignetteAmount = 0, 
    VignetteMidpoint = 50, 
    WhiteBalance = "As Shot", 
    Whites2012 = 0}
Photo of John R. Ellis

John R. Ellis, Champion

  • 3448 Posts
  • 876 Reply Likes
There are two symptoms of the same underlying bug:

- preset:getSetting() returns all develop settings, not just those set by the preset

- photo:applyDevelopPreset() changes all settings, not just those of the preset

Here is a script and accompany preset that demonstrates both symptoms:
https://www.dropbox.com/s/pp5hjilw3zeno9r/applypresetsbug.2018.06.12.zip?dl=0

To run the script:

1. Install the accompanying preset "ApplyPresetsBug.xmp" in the User Presets
   group. This preset sets Exposure to 1.23 but not other setting.

2. Place "applypresetsbug.lua" in LR's Scripts folder and run it from the Scripts menu.