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.
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,
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!
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.
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.
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.
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.
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.
Copy link to clipboard
Copied
"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: Batch-applying Upright > Level produces different results than individually