• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

SDK: Update Transform?

Participant ,
Jul 05, 2024 Jul 05, 2024

Copy link to clipboard

Copied

Does anyone know if there is a way to "Update" transform via the SDK? I don't see anything in the documentation.

 

See the screenshot below for the Update that I am referring to.

 

Screenshot 2024-07-05 at 5.45.24 PM.png

TOPICS
SDK

Views

271

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 05, 2024 Jul 05, 2024

Copy link to clipboard

Copied

You can use the LrPhoto class, using the methods photo:getDevelopSettings() and photo:applyDevelopSettings() to get and set individual Develop settings. They're mostly undocumented, so you'll have to reverse-engineer their meanings.  The relevant fields are:

    PerspectiveAspect = 0, 
    PerspectiveHorizontal = 0, 
    PerspectiveRotate = 0, 
    PerspectiveScale = 100, 
    PerspectiveUpright = 0, 
    PerspectiveVertical = 0, 
    PerspectiveX = 0, 
    PerspectiveY = 0, 
    UprightCenterMode = 0, 
    UprightCenterNormX = 0.5, 
    UprightCenterNormY = 0.5, 
    UprightFocalLength35mm = 35, 
    UprightFocalMode = 0, 
    UprightFourSegmentsCount = 0, 
    UprightPreview = false, 
    UprightTransformCount = 6, 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 07, 2024 Jul 07, 2024

Copy link to clipboard

Copied

Hi @johnrellis, thanks for your help with this. From my testing, it doesn't look like any of these will replicate pressing the Update button in the UI. Again, thanks for your help!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 07, 2024 Jul 07, 2024

Copy link to clipboard

Copied

No, there isn't a way to directly get the effect of the Update button.

 

But perhaps you could describe the circumstances leading up to why you'd like to do that?  To set one of the auto modes (Auto, Level, Vertical, Full), you set PerspectiveUpright:

 

photo:applyDevelopSettings {PerspectiveUpright = 1}

 

That will recompute that mode automatically and won't highlight the Update button.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 07, 2024 Jul 07, 2024

Copy link to clipboard

Copied

The use case is when a user copies and pastes the transform settings (such as upright auto) and then they need to click update on the pasted image in order for the settings to take effect properly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 07, 2024 Jul 07, 2024

Copy link to clipboard

Copied

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

When you copy just Upright Mode, e.g. Auto, then LR will recompute Auto for each target photo, and the Update button won't be highlighted.

 

johnrellis_0-1720398320084.png

 

If you copy Upright Mode and Upright Transforms, then the mode is set to Auto in the target photos, but the particular transforms used for the source photo are also copied. Since those source transforms are typically not the same as what Auto would compute for the target photo, the Update button is highlighted. When you click it, it will recompute Auto on that photo, and Update will no longer be highlighted.

 

So instead of copying Upright Mode and Upright Transforms and then clicking Update, why not just copy Upright Mode? You'll get the same result.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 08, 2024 Jul 08, 2024

Copy link to clipboard

Copied

@johnrellis thanks for the additional information. Interestingly, when I copy auto transform from a reference and paste it to a target image using only Upright Mode, it does work (no need to update) but the results are different than simply selecting auto transform on the target image. Also, copying all the transform values and pasting gives me the update option but when I press update I get a different result. I get three different results from the three different methods.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 08, 2024 Jul 08, 2024

Copy link to clipboard

Copied

LATEST

"I get three different results from the three different methods."

 

I forgot about these long-standing bugs, where Transform's auto settings don't always copy correctly. Sometimes the differences are small, sometimes larger:

 

P: Transform doesn't copy/sync correctly

https://community.adobe.com/t5/lightroom-classic-bugs/p-transform-doesn-t-copy-sync-correctly/idc-p/... 

 

P: Batch-applying Upright > Level produces different results than individually

https://community.adobe.com/t5/lightroom-classic-discussions/p-batch-applying-upright-gt-level-produ...

 

P: Syncing Transform > Auto w just Upright Mode checked sometimes won't automatically recompute Auto

https://community.adobe.com/t5/lightroom-classic-bugs/p-syncing-transform-gt-auto-w-just-upright-mod...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines