22 Replies Latest reply on Mar 11, 2017 11:20 AM by johnrellis

    Lightroom 6 SDK Changes

    jarnoh Level 1

      It seems that there are new classes with LR6:

       

      LrDevelopController

      LrApplicationView

      LrSelection

      LrSlideshow

      LrSounds

      LrTether

      LrUndo

       

      For my purposes, LrDevelopController sounds promising

       

      Jarno

        • 1. Re: Lightroom 6 SDK Changes
          jarnoh Level 1

          Figured out one method:

           

          LrApplicationView.showView(viewName)


          viewName must be one of: develop_before, develop_before_after_horiz, develop_loupe, grid, survey, compare, develop_before_after_vert, loupe, people

          • 2. Re: Lightroom 6 SDK Changes
            jarnoh Level 1

            LrUndo.canUndo()

            LrUndo.undo()

            LrUndo.canRedo()

            LrUndo.redo()

            • 3. Re: Lightroom 6 SDK Changes
              jarnoh Level 1

              LrApplication.addKeyModifierObserver() sounds interesting as well

              • 4. Re: Lightroom 6 SDK Changes
                johnrellis Most Valuable Participant

                Here's a longer list of new modules, functions, methods, and getFormatted/RawMetadata keys in LR 6:

                 

                LrAnalytics

                LrAnalytics.addToGroup

                LrAnalytics.checkParticipation

                LrAnalytics.getApipDisplay

                LrAnalytics.getBuildNum

                LrAnalytics.getLang

                LrAnalytics.getProduct

                LrAnalytics.getShortModuleName

                LrAnalytics.getVersion

                LrAnalytics.initializeApip

                LrAnalytics.initializeApipC

                LrAnalytics.isBeta

                LrAnalytics.logUTEvent

                LrAnalytics.newDataGroup

                LrAnalytics.newDataGroupWithDetails

                LrAnalytics.observeAgCommand

                LrAnalytics.observeAgUndo

                LrAnalytics.observeCatalogFileType

                LrAnalytics.observeCatalogImageNum

                LrAnalytics.observeCatalogProcessVersion

                LrAnalytics.observeCreateService

                LrAnalytics.observeHelpToolTips

                LrAnalytics.observeModuleChange

                LrAnalytics.observeNumberOfCatalogImagesWithKeywords

                LrAnalytics.observePhotoMerge

                LrAnalytics.observePrintModule

                LrAnalytics.observeTrackedCollections

                LrAnalytics.observeVideoPlayback

                LrAnalytics.recordDuration

                LrAnalytics.regObserver

                LrAnalytics.terminateApip

                 

                LrApplication

                LrApplication.addActivePhotoChangeObserver

                LrApplication.addKeyModifierObserver

                 

                LrApplicationView

                LrApplicationView.getCurrentModuleName

                LrApplicationView.getSecondaryViewName

                LrApplicationView.isSecondaryDisplayOn

                LrApplicationView.showSecondaryView

                LrApplicationView.showView

                LrApplicationView.switchToModule

                LrApplicationView.toggleSecondaryDisplay

                LrApplicationView.toggleSecondaryDisplayFullscreen

                LrApplicationView.toggleZoom

                LrApplicationView.zoomIn

                LrApplicationView.zoomInSome

                LrApplicationView.zoomOut

                LrApplicationView.zoomOutSome

                 

                LrDevelopController

                LrDevelopController.addAdjustmentChangeObserver

                LrDevelopController.decrement

                LrDevelopController.getProcessVersion

                LrDevelopController.getRange

                LrDevelopController.getSelectedTool

                LrDevelopController.getValue

                LrDevelopController.increment

                LrDevelopController.resetAllDevelopAdjustments

                LrDevelopController.resetBrushing

                LrDevelopController.resetCircularGradient

                LrDevelopController.resetCrop

                LrDevelopController.resetGradient

                LrDevelopController.resetRedeye

                LrDevelopController.resetSpotRemoval

                LrDevelopController.resetToDefault

                LrDevelopController.revealAdjustedControls

                LrDevelopController.revealPanel

                LrDevelopController.selectTool

                LrDevelopController.setMultipleAdjustmentThreshold

                LrDevelopController.setProcessVersion

                LrDevelopController.setTrackingDelay

                LrDevelopController.setValue

                LrDevelopController.startTracking

                LrDevelopController.stopTracking

                 

                LrSelection

                LrSelection.clearLabels

                LrSelection.decreaseRating

                LrSelection.deselectActive

                LrSelection.deselectOthers

                LrSelection.extendSelection

                LrSelection.flagAsPick

                LrSelection.flagAsReject

                LrSelection.getColorLabel

                LrSelection.getFlag

                LrSelection.getRating

                LrSelection.increaseRating

                LrSelection.nextPhoto

                LrSelection.previousPhoto

                LrSelection.removeFlag

                LrSelection.selectAll

                LrSelection.selectFirstPhoto

                LrSelection.selectInverse

                LrSelection.selectLastPhoto

                LrSelection.selectNone

                LrSelection.setColorLabel

                LrSelection.setRating

                LrSelection.toggleBlueLabel

                LrSelection.toggleGreenLabel

                LrSelection.togglePurpleLabel

                LrSelection.toggleRedLabel

                LrSelection.toggleYellowLabel

                 

                LrSlideshow

                LrSlideshow.startSlideshow

                LrSlideshow.stopSlideshow

                 

                LrSocket

                LrSocket.bind

                 

                LrSounds

                LrSounds.getSystemSounds

                LrSounds.playSystemSound

                 

                LrSystemInfo

                LrSystemInfo.ipAddress

                 

                LrTableUtils

                LrTableUtils.tableToString

                 

                LrTasks

                LrTasks.executeWithRunAsVerb

                 

                LrTether

                LrTether.getAdvanceSelectionOnTetheredCapture

                LrTether.isTetherActive

                LrTether.numDownloadsPending

                LrTether.setAdvanceSelectionOnTetheredCapture

                LrTether.startTether

                LrTether.triggerCapture

                LrTether.triggerCaptureBlocking

                 

                LrUndo

                LrUndo.canRedo

                LrUndo.canUndo

                LrUndo.redo

                LrUndo.undo

                 

                photo

                photo:applyDevelopSettings

                 

                getFormattedMetadata

                getFormattedMetadata.gpsImgDirection

                 

                getRawMetadta

                getRawMetadata.cameraSN

                getRawMetadata.captureTime

                getRawMetadata.gpsImgDirection

                getRawMetadata.lens

                getRawMetadata.orientation

                 

                The following exist in LR 5 but not LR 6 (they were all undocumented):

                 

                LrController

                LrController.nextPhoto

                LrController.previousPhoto

                LrController.showBezel

                LrController.showGrid

                LrController.showLoupe

                LrController.startSlideshow

                LrController.stopSlideshow

                LrController.triggerCapture

                 

                ftp

                ftp.getAndClearLog

                ftp.loggingEnabled

                • 5. Re: Lightroom 6 SDK Changes
                  bartwybouw

                  Hi where I can find the new SDK, I'm only seeing vs5 online.

                  • 6. Re: Lightroom 6 SDK Changes
                    jarnoh Level 1

                    SDK hasn't been updated yet, that's why we are gathering unofficial information.

                     

                    I run into some screen updates in my The Fader plugin.  It uses photo:applyDevelopPreset, and the screen update was lagging in GPU mode (buffering problem?). I released a new version with applyDevelopPreset replaced it with LrDevelopController.setValue.   Perhaps I should also take a look at photo:applyDevelopSettings, whatever it does.

                    • 7. Re: Lightroom 6 SDK Changes
                      jarnoh Level 1

                      Looks like LrDevelopController.setValue considers old process values (Shadows) same as new process values (Shadows2012).   Not very nice.

                       

                      I ran into same refresh problems with photo:applyDevelopSettings as I had with photo:applyDevelopPreset.

                      • 8. Re: Lightroom 6 SDK Changes
                        Lee in CLE

                        Has anyone found a way to decipher person keywords vs. normal ones in the new API?

                        • 9. Re: Lightroom 6 SDK Changes
                          johnrellis Most Valuable Participant
                          Has anyone found a way to decipher person keywords vs. normal ones in the new API?

                          An "other" keyword looks like this:

                          Untitled.png

                          While a "person" keyword looks like this:

                          Untitled2.png

                          • 10. Re: Lightroom 6 SDK Changes
                            johnrellis Most Valuable Participant

                            Some experiments suggest the signature of LrApplication.addKeyModifierObserver is:

                             

                            LrApplication.addKeyModifierObserver (context, modifier, key, observer)

                             

                            "context" is an LrFunctionContext.

                             

                            "modifier" is one of "option", "command", "control", "capsLock"

                             

                            "key" can be any non-nil value

                             

                            "observer" is a function that will be called when the up/down state of the modifier key changes. It is called with one argument "t", a table where t[1] is "key" and t[2]" is true if the modifier has been pressed and false if the modifier has been released.

                            1 person found this helpful
                            • 11. Re: Lightroom 6 SDK Changes
                              johnrellis Most Valuable Participant

                              Examination of lots of sample pics indicates the following:

                               

                              getFormattedMetadata ("gpsImageDirection")

                              (string) The GPS image direction rounded to the nearest North, North-East, East, South-East, etc.

                               

                              getRawMetadata ("cameraSN")

                              (string) The same as getFormattedMetadata ("cameraSerialNumber")

                               

                              getRawMetadata ("captureTime")

                              (number) The capture time in Cocoa date-stamp format, seconds since 2001/1/1 0:00:00 UTC.

                               

                              getRawMetadata ("gpsImageDirection")

                              (number) The GPS image direction in degrees

                               

                              getRawMetadata ("lens")

                              (string) The same as getFromattedMetadata ("lens")

                               

                              getRawMetadata ("orientation")

                              (string) Encodes the current rotation and mirroring of the image.  The result is a two letter code as specified by this table:

                               

                              Degrees Rotated

                              Clockwise

                              No

                              Mirroring

                              Flipped

                              Horizontal

                              0ABBA
                              90BCCB
                              180CDDC
                              270DAAD
                              • 12. Re: Lightroom 6 SDK Changes
                                Iain Malcolm

                                Just dipping a toe in the lua water to try and write a plugin that will go through a large number of bracketed exposure photos and generate hdr merges appropriately. For use with timelapse sequences of night scenes and anything else with higher dynamic range than the camera can cope with.

                                 

                                How can I fire off a photomerge operation from a lua script?

                                 

                                The loading and analysis is fairly straightforward so far

                                • 13. Re: Lightroom 6 SDK Changes
                                  johnrellis Most Valuable Participant
                                  How can I fire off a photomerge operation from a lua script?

                                  You can't do it, at least by any method that's documented or listed above.  The best you could do is keyboard-stuffing, but that can be pretty fragile and difficult to make reliable.

                                  • 14. Re: Lightroom 6 SDK Changes
                                    Iain Malcolm Level 1

                                    Ah! so sad, I feared as much. Looks like best approach is to generate out a file for another app to do the hdr merging.

                                    • 15. Re: Lightroom 6 SDK Changes
                                      kimaldis Level 1

                                      LrSocket, a couple of questions:

                                       

                                      why only localhost, why not any IP?

                                       

                                      Seems to require separate ports, one for send, the other for receive. Given that most likely you'd want a response of some kind following a send to a remote process, it would have made life a bunch easier to be able to send and receive on the same port, like telnet, for example?

                                       

                                      If I wanted to talk to, say, an iPad, I'd need to jump through a few hoops with an intermediate process on localhost in order to do so, in addition to opening and handling the two ports locally.

                                       

                                      Or am I missing something?

                                      • 16. Re: Lightroom 6 SDK Changes
                                        kimaldis Level 1

                                        I'm guessing this adds a callback to a modified keypress but any idea what format 'key' takes? I've tried a char and an ascii code but neither seem to work. Thoughts?

                                         

                                        thanks.

                                        • 17. Re: Lightroom 6 SDK Changes
                                          johnrellis Most Valuable Participant

                                          In LrApplication.addKeyModifierObserver (context, modifier, key, observer), "key" doesn't refer to a keyboard key.  Rather, it can be any non-nil value, and it is passed as the first element of the table value passed to the observer function.

                                          • 18. Re: Lightroom 6 SDK Changes
                                            kimaldis Level 1

                                            OK, thanks.Shame, I was hoping for something I could use to detect hotkeys.  I'm struggling to think what you might use it for.

                                            • 19. Re: Lightroom 6 SDK Changes
                                              johnrellis Most Valuable Participant
                                              I'm struggling to think what you might use it for.

                                              The only thing I can think of is detecting whether one of the modifier keys was held down when the user invoked the menu command for the plugin.  The plugin would need to start up a background task when it first loads that calls addKeyModifierObserver() and then sleeps indefinitely.

                                              • 20. Re: Lightroom 6 SDK Changes
                                                johnrellis Most Valuable Participant

                                                These keys appear to have been added to photo:getDevelopSettings() at some version between 6.0 and 6.9:

                                                 

                                                CameraProfileDigest

                                                CropConstrainAspectRatio

                                                GrayMixerAqua

                                                GrayMixerBlue

                                                GrayMixerGreen

                                                GrayMixerMagenta

                                                GrayMixerOrange

                                                GrayMixerPurple

                                                GrayMixerRed

                                                GrayMixerYellow

                                                UprightFourSegments_0

                                                UprightFourSegments_1

                                                • 21. Re: Lightroom 6 SDK Changes
                                                  jarnoh Level 1

                                                  GrayMixer values have been there, but they only appear if photo has Treatment: Black&White set. I don't see any change with that behaviour in 6.9.

                                                  • 22. Re: Lightroom 6 SDK Changes
                                                    johnrellis Most Valuable Participant

                                                    Makes sense. My script for uncovering changes isn't that sophisticated.