7 Replies Latest reply on Aug 6, 2017 6:48 AM by cecin

    Why applyDevelopPreset doesnt refresh Lr's preview

    Maxim3 Level 1


      Hi all

       

      My plug-in has a couple sliders. When a slider is changed then I change some parameters and apply new preset. like as

       

      catalog:withWriteAccessDo(Title,function()

           local presetNew = LrApplication.addDevelopPresetForPlugin( _PLUGIN, Title, settingsNew)

           photo:applyDevelopPreset(presetNew, _PLUGIN)

      ...

       

      On my end all work fine. But my testers have the follow problem. Often, when they move a slider and a preset is applied, the Lr's parameters are changed, Lr's histogram is refreshed BUT Lr's preview is still old.

       

      I tried to call

       

      photo:deleteSmartPreview()

      photo:buildSmartPreview()

       

      but no effect.

       

      Also I tried to call catalog:withWriteAccessDo asynchronously

      catalog:withWriteAccessDo(Title,function() ...end , {4.0,nil,'asynchronous'})

       

      but also no effect.

       

      Does somebody met with this problem and has any idea how to fix it?

        • 1. Re: Why applyDevelopPreset doesnt refresh Lr's preview
          johnrellis Most Valuable Participant

          Please add your vote and details to this bug report: Lightroom SDK: photo:applyDevelopPreset() doesn't update Develop display when GPU enabled.  At least in my experiments, the problem only occurs with the GPU enabled in LR 6 / CC 2015.

           

          I've tried a number of workarounds, including the undocumented photo:applyDevelopSettings(), to no avail.  The only workaround I discovered for my Any Preset plugin was to have it switch to Library Loupe view temporarily.  May not be appropriate for what you want to do. 

           

          You might also consider using the new LrDevelopController module. (It wasn't suitable for my Any Preset plugin.)

          • 2. Re: Why applyDevelopPreset doesnt refresh Lr's preview
            Maxim3 Level 1

            Thank John for quick and qualified answer.

             

            What about your mention way:

             

            LrApplicationView.zoomIn()

            LrApplicationView.zoomOut()

             

            Does it work? 

             

            - There is a way how to programmatically switch off GPU support during plug-in dialog is active?

             

            - LrDevelopController is not present in LR SDK 5. Is it a some new feature in SDK6? Is it helpful for solve the problem with screen updating?

            Same as LrAplicationView is not presented in SDK5.

             

            - It seems, there is only one reasonable way - to switch off GUI support in display preferences. Is it possible to make programmatically?

            • 3. Re: Why applyDevelopPreset doesnt refresh Lr's preview
              johnrellis Most Valuable Participant

              LrApplicationView.zoomIn()

              LrApplicationView.zoomOut()

              I added a comment to that: "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."

              There is a way how to programmatically switch off GPU support during plug-in dialog is active?

              Unfortunately not.  The SDK doesn't even let you determine if it is enabled.  But with a hack, your plugin can read the LR settings file, which is mostly (but not entirely) reliable (different code is required on Windows and Mac).

               

              LrDevelopController is not present in LR SDK 5. Is it a some new feature in SDK6? Is it helpful for solve the problem with screen updating?

              Same as LrAplicationView is not presented in SDK5.

              LrDevelopController was introduced in LR 6.  See the LR 6 SDK documentation.  I haven't tried LrDevelopController, since it wasn't adequate for my purposes.  But it sounds like it might be perfect for your use, since you want a slider directly controlling a develop setting.

               

              If you are observing the same bug, then it is caused by use of the GPU, which was introduced in LR 6.  So you only need a workaround for LR 6, not LR 5.

              • 4. Re: Why applyDevelopPreset doesnt refresh Lr's preview
                Maxim3 Level 1

                it seems I have to download new SDK and test LrDevelopController. What is makes? applies presets or refresh screen?

                 

                Also, if GPU option is stored into some  .ini file then maybe it was possible to change this file with help of some external binary program? Did you try to find this option? I cannot find it until I've not installer newest Lr versions

                 


                • 5. Re: Why applyDevelopPreset doesnt refresh Lr's preview
                  johnrellis Most Valuable Participant
                  What is makes? applies presets or refresh screen?

                  I'm not sure what you are asking?

                  • 6. Re: Why applyDevelopPreset doesnt refresh Lr's preview
                    johnrellis Most Valuable Participant
                    Also, if GPU option is stored into some  .ini file then maybe it was possible to change this file with help of some external binary program?

                    On Mac, the plugin could use the "defaults" program to change the option.  On Windows, the plugin can write the preferences file directly.  However, the plugin would need to cause LR to exit and then run an external script, since LR will overwrite the preferences when it exits.   You can search this forum for a recent thread about how a plugin can cause LR to exit cleanly. 

                     

                    While you might be able to get this to work, in the past, people have found it's fragile and hard to make reliable.

                    • 7. Re: Why applyDevelopPreset doesnt refresh Lr's preview
                      cecin

                      Hi guys,

                       

                      Isn't there any progress with this bug?

                      applyDevelopPreset doesnt work.

                       

                      I have a slider in my plugin.

                      When I click it, my LrDevelopController.setValue code is triggering and the preview is working properly.

                      However, If I don't click my slider and if I call the slider trigger code manually, the preview is not working.

                      Do you have any suggestion?