Lightroom SDK: photo:applyDevelopPreset() doesn't update Develop display when GPU enabled

  • 6
  • Problem
  • Updated 2 years ago
The SDK call photo:applyDevelopPreset() doesn't update the photo display in Develop properly when the GPU is enabled. The display gets updated to show the effect of the preset only after the plugin exits or the next call to photo:applyDevelopPreset() (which itself doesn't get displayed properly until the plugin exits or the next call to photo:applyDevelopPreset()). This problem does not occur when the GPU is disabled or when in Library Grid or Loupe view.

To reproduce the problem:

1. Disable the GPU in Preferences > Performance and go to Develop mode.

2. Run the script below.

3. Notice that as you click the two preset buttons, the display of the photo gets updated instantly.

4. Enable the GPU in Preferences > Performance and go to Develop mode.

5. Run the script.

6. Click the first preset button. Notice that the Navigator preview has updated properly but the photo itself has not, even though History shows the preset was applied:



7. Click OK to exit the dialog. Notice that the photo display is now updated properly:



I've tested this on LR 6.0.1 / OS X 10.10.3 with:
MacBook Pro (Retina, 15-inch, Late 2013)
Graphics Processor Info:
NVIDIA GeForce GT 750M OpenGL Engine
Check OpenGL support: Passed
Vendor: NVIDIA Corporation
Version: 4.1 NVIDIA-10.2.7 310.41.25f01
Renderer: NVIDIA GeForce GT 750M OpenGL Engine
LanguageVersion: 4.10

But users of my Any Source plugin have also noticed the problem on other machines.


local LrApplication = import 'LrApplication'
local LrDialogs = import 'LrDialogs'
local LrTasks = import 'LrTasks'
local LrView = import 'LrView'

local catalog = LrApplication.activeCatalog ()
local f = LrView.osFactory()

local function applyPreset (preset)
LrTasks.startAsyncTask (function ()
catalog:withWriteAccessDo ("Apply Settings", function ()
catalog:getTargetPhoto ():applyDevelopPreset (preset)
end, {timeout = 15})
end)
end

LrTasks.startAsyncTask (function ()
local folders = LrApplication.developPresetFolders ()
local preset1 = folders [1]:getDevelopPresets ()[1]
local preset2 = folders [1]:getDevelopPresets ()[2]

LrDialogs.presentModalDialog {title = "Preset Bug", contents =
f:column {spacing = f:control_spacing (),
f:push_button {title = preset1:getName (),
action = function () applyPreset (preset1) end},
f:push_button {title = preset2:getName (),
action = function () applyPreset (preset2) end}}}
end)
Photo of John R. Ellis

John R. Ellis, Champion

  • 3865 Posts
  • 1019 Reply Likes

Posted 3 years ago

  • 6
Photo of John R. Ellis

John R. Ellis, Champion

  • 3865 Posts
  • 1019 Reply Likes
I found a workaround. After invoking applyDevelopPreset(), invoke:

LrApplicationView.zoomIn()
LrApplicationView.zoomOut()

This forces LR to do a refresh of the display when in develop mode.
Photo of John R. Ellis

John R. Ellis, Champion

  • 3865 Posts
  • 1019 Reply Likes
The problem with his workaround is that, at least on my OS X LR CC 2015.1.1, the display will not always fully update to the fullest resolution. LR leaves the image pixelated at lower resolution.
Photo of Jarno Heikkinen

Jarno Heikkinen

  • 28 Posts
  • 6 Reply Likes
On LR 6.9, this workaround bounce zooms photo, so it is not really recommended.
Photo of Robert Frost

Robert Frost

  • 396 Posts
  • 53 Reply Likes
Is this the same problem that I have just had - edited psd in Photoshop and when it came back into LR the edits were not showing in Develop mode, but were showing in Library mode. Going into Print mode possibly made Develop show it correctly.

Bob Frost
Photo of John R. Ellis

John R. Ellis, Champion

  • 3857 Posts
  • 1014 Reply Likes
More likely it is another issue that others have reported: http://feedback.photoshop.com/photosh....

Double-check that you're running the most recent version (6.1.1 / CC 2015.1.1) by doing Help > System Info. (Sometimes the update process fools people into thinking they've got the most recent version.) If after ensuring you have the most recent version the problem is still happening, then add your vote and opinion to that other topic.
Photo of Robert Frost

Robert Frost

  • 396 Posts
  • 53 Reply Likes
I am running CC2015.1.1

Bob Frost
Photo of John R. Ellis

John R. Ellis, Champion

  • 3865 Posts
  • 1019 Reply Likes
Problem still exists in LR CC 2015.6 / 6.6.
Photo of Jarno Heikkinen

Jarno Heikkinen

  • 28 Posts
  • 6 Reply Likes
Same problem still with LR 6.9