Quantcast
Channel: Adobe Community : Popular Discussions - Lightroom SDK
Viewing all 53524 articles
Browse latest View live

How to avoid re publish all after service settings change?

$
0
0

Hi All,

 

I am working on a publish service for lightroom. I would like to avoir the lightroom build in dialog "You have changed the settings for this publish connection" to show.

 

All my settings doesn't affect at all the photos and we don't need to re publish all. But when the users see that dialog, they don't understand and re publish all a lot of time.
It is useless and time wasting.

 

I don't find any clue to avoid tthat. I would like to be able to say (like for metadata) which settings trigger a re publish action.

 

Thank you for your help,

All the best,
Martin


accessing preview images

$
0
0

Is there a way to access and use the smart previews or the regular previews that Lightroom creates?

 

Best would be to use the previews in php. But for a start any other programming language e.g. java would also be ok.

Reason why I am asking is, I want to have a WebInterface for Lightroom in my LAN (not Internet)

 

For now I create thumbnails and images myself using regular export function of lightroom.

But this is extra work to do.

Thank you

Updated Lightroom CC 2015 SDK documentation

$
0
0

Are there any updated Lightroom CC 2015 SDK documentation, as the currently available ones are getting out of date with current functionality (they are a couple of years old by now).

 

It would be excellent to have an up-2-date documentation including the new funcitonality (such as parameters for interacting with the new transform panel, not present in the documentation. Such as names for revealPanel and such), also some parametes seems to have stopped working (such as setting EnableDetail, EnableToneCurve etc. are now read-only, setting these does not enable/disable the corresponding panel anymore - worked in previous versions).

 

Not having up-2-date documentation makes plugin development like shooting in the dark, there are lots of undocumented parameters and the likes - and with stringly-typed arguments it is virtually impossible to discover proper parameter names, without simply brute forcing.

catalog:getActiveSources() returning an table of nils

$
0
0

local  catalog = import "LrApplication".activeCatalog()

local a = catalog:getActiveSources()

 

any thoughts on why getActiveSources() here is returning a table of nils? the count of items in the table is correct it's just that they're all nils.

 

thanks.

How to create a plugin dialog with a variable amount of radiobutton ?

$
0
0

I'm trying to expend the functionalities of a plugin I wrote (based on the sdk samples) by adding some radio button so that the user can select 1 choice.
Meaning : Based of a "Key", the export folder and export parameters will adapted.
The last choice must be saved for the next run.

 

The issue is : I cannot find how to manage the fact that the number of radio buttons aren't fixed.

I tried to adapt the following code (from sample)

 

f:column {

spacing = f:control_spacing(),

 

f:radio_button {

title = "Button one",

value = LrView.bind( "selectedButton" ),

checked_value = "one",

},

 

f:radio_button {

title = "Button two",

value = LrView.bind( "selectedButton" ),

checked_value = "two",

},

},

 

 

In this way (as long as I found keys in the list, I add a radio button) datas are stored in a string like : key1:folder1;key2:folder2;

 

while true do
     -- if all keys were treated, it's finished

if keys ~= '' then

return true

end

 

     -- extract the first key

pstart= 1

pend= string.find(keys,":")

KeyM = string.sub(keys, pstart, pend-1)

 

-- extract the folder

pstart= pend+1

pend = string.find(keys,";")

FolderM= string.sub(keys, pstart, pend-1)

 

-- remove the 1st "line"

keys= string.sub(keys, posfin+1)

 

-- add the button the the dialog

f:radio_button {

title = FolderM,

value = LrView.bind( "selectedButton" ),

checked_value = "one",

},

end

 

 

1. I get an error : "Yielding is not allowed within a C or metamethod call". I do not really understand what this means.

 

2. I do not understand i

 

Any help is welcome

[Q] Is it possible to Lightroom can connect WebSocket server on localhost?

$
0
0

Hi all,

 

I have current running WebSocket server on localhost.

I'd like to make Lightroom plugin that connect the server.

 

My understanding is following.

     * Lightroom modules cannot add third party code like LuaRocks installation.

     * Lightroom 6/CC has LrSocket and LrHttp.

 

Is that possible to implement WebSocket client on top or LrSocket or any other way?

 

Thank you,

Naoki

I need to create Default CollectionSets(Folder) through "publish-plugin".

$
0
0

Hello,

I need to create default CollectionSets(Folder) through "publish-plugin". When Someone configures the plugin then two collections should be created automatically. Can anyone please help me? I am new.

 

Thanks in advance:)

Anand

Bug: Infinite "Invalid numeric entry" loop with numeric edit_fields

$
0
0

In SDK 3.0, a numeric edit_field control can easily get into an infinite loop of popping up an "Invalid numeric entry" message, and the user is forced to kill LR using the task manager.

 

To reproduce:

 

1. Run the test plugin below.

 

2. Click in another (non-Lightroom) window. Depending on the arrangement of windows, the "Invalid numeric entry" message pops up below the main LR window, invisible to the user.

 

3. Click back in the edit_field of the plugin.

 

At this point, the "Invalid numeric entry" message is visible, and clicking OK just brings it up again.  You've got to use the task manager to kill Lightroom.

 

The plugin code:

 

local LrDialogs = import 'LrDialogs'
local f = import 'LrView'.osFactory()
LrDialogs.presentModalDialog {
    title = "Test",
    contents = f:edit_field {min = 1}}

 

I've submitted this via the Web form but posted it here in case others encounter similar symptoms.


How to use LrCatalog.createCollectionSet

$
0
0

Can anyone tell me why the following code fails, please?

 

local LrFunctionContext = import 'LrFunctionContext'
local LrLogger = import 'LrLogger'
local LrApplication = import 'LrApplication'
local LrTasks = import 'LrTasks'

 

Foo = {}

 

function Foo.foo()
  local log = LrLogger("foo")
  log:enable("logfile")

 

  LrTasks.startAsyncTask(function()
    local result = LrFunctionContext.callWithContext("showCustomDialog", function (context)
      local cat = LrApplication.activeCatalog()
      cat:withWriteAccessDo("Foo", function()
        local existingCollectionSets = cat:getChildCollectionSets()   
        if not cat.hasWriteAccess then
          log:trace("Write access could not be obtained.")
        end
        for _, s in ipairs(existingCollectionSets) do
          if s:getName() == LOC "Smart Collections" then
            log:trace("Found parent collection set: " .. s:getName())
            set = cat:createCollectionSet("New smart collection set", s, false)
            break
          end
        end
        if set == nil then
          log:trace("Unable to create new collection set.")
        else
          log:trace("Collection set '" .. set.getName() .. "' successfully created.")
        end
      end)  -- withWriteAccessDo
    end) -- startAsyncTask
  end) -- callWithContext
end

 

Foo.foo()

 

The call to createColectionSet fails with an internal error of "assertion failed!".  The parent collection set is found.  The error occurs whether the third parameter is false, true or absent.  There is no smart collection set in "Smart Collections" with the name "New smart collection set".

 

And, whilst I have your attention, a real newbie question:  I can search the forums for, say, "createCollectionSet" and I can see the forums in which the term has been mentioned, and the contributors have used the term.  I can see links to the forums and to the contributors' profiles, but I can't see a link to the specific posts in which the search term is used.  Am I missing something, or do I really have to scroll through the entire forum to try find the relevant post(s)?

 

Thanks in advance for your help.

 

J

Lightroom -traceback debugging tip

$
0
0

Excerpt from post by Dan Tull at http://feedback.photoshop.com/photoshop_family/topics/how_to_better_understand_when_lr_bug s_bite_can_we_somehow_activate_logging

 

To get Lightroom traceback info:

 

Windows
1. Right click the Lightroom icon you use to launch on the desktop and choose Copy from the menu.
2. Right click the Desktop and choose Paste from the menu.
3. Right click the new icon and choose Properties... from the menu.
4. In the Target field of the properties dialog append -tracebacks (separated from the path by a space):
(It will look like this at the end when you're done (leave the rest of the path alone): lightroom.exe" -tracebacks)
5. In the general tab, you might also want to change the name so you can easily visually distinguish this new icon from the original (we'll delete it when we're done).
6. Go to this site in your browser: http://technet.microsoft.com/en-us/sy...
7. On the right hand side of the page, click the "Run DebugView" link (it's safe – it's just a debug output viewer from Microsoft)
8. Click through the Eula if necessary.
9. With DebugView running, double click the new icon we created in steps 1-5.
10. Repeat the steps in Lightroom that cause the error message or hang that you are seeing.
11. Save the output. You can either highlight and copy/paste or choose "Save as..." from the menu to save the output to a file.

 

Mac
1. In Finder, navigate to the Utilities subfolder of the Applications folder (Command + Shift + U).
2. Double Click Terminal.app
3. Paste the following text: '/Applications/Adobe Lightroom 3.app/Contents/MacOS/Adobe Lightroom 3' -tracebacks
(Note that this may be different for some versions of LR, like RC/Beta releases, etc)
4. Press enter to start.
5. Repeat the steps in Lightroom that cause the error message or hang that you are seeing.
6. Use the Shell -> Export Text As... menu item (Command + S) to save the output to a file (or select it for copy and paste).

 

Note that the output this produces requires the exact build number of LR that emitted it to be translated into a stack trace with source file names and line numbers.

 

Rob

creating tables (or other persistent data structures) in Lightroom Lua

$
0
0

I have a complex data structure I want to be able to add to a Lightroom plugin.  I know Lightroom uses a SQLite database. Can I add tables to that database from either inside a Lightroom plugin or externally?  I see no documentation of any API capabilities granting direct queries of the SQLite database and as of now it's looking like the only technique I have at my disposal is to create my own homebrewed database system using the file system. I would like that not to be the case.  Does anyone have any guidance for me?

Documentation differences between LR 4 and 5 SDKs

$
0
0

Here's what the Readme says:

 

------------------------------------------------------------------------------------------ -------------

     For this release (5.0) the SDK highlights the following:

 

1. Create Floating Windows: With the addition of LrDialogs.presentFloatingDialog(...)

          SDK developers are now able to create separate, floating, non-modal windows that

          allow more robust interactions between the plug-in and Lightroom.

2.          Access Smart Previews: Smart Previews can be built and deleted via

          photo:buildSmartPreview() and photo:deleteSmartPreview() respectively.  In addition,

          SDK developers can access the Smart Preview path on disk and file size via

          photo:getRawMetadata(...)

3.          Create Virtual Copies: Virtual copies for one or more images can now be created via

          catalog:createVirtualCopies(...)

4.          Retrieve Smart Collection Search Descriptions: The search description for a Smart

          Collection can now be accessed via collection:getSearchDescription()

5.          Create Bezel Overlays: LrDialogs.showBezel(...) will show a message in a window that

          will display and fade away after a short duration.

6.          Request Jpeg Previews: LrPhoto:requestJpegThumbnail(...) retrieves a  jpeg preview

          of the photo of the requested size

7.          Key Bug Fixes and JDI’s:

          -          LrView:catalog_photo(...)’s "photo" argument can now be set to "nil" in

                    order to specify no photo is to be displayed

          -          LrCatalog:getActiveSources(...) now returns defined constants for special

                    sources (e.g. "All Photographs", "Previous Import", etc.)

          -          LR_LiveName propery now available to smart collections

          -          Horizontal and Vertical scrollbars can now be disabled on a

                    LrView:scrolled_view

          -          LrView:simple_list now properly supports enabled and visible properties

------------------------------------------------------------------------------------------ -------------

 

I can't determine what is meant by "LR_LiveName property now available to smart collections".

 

I did a "diff" between the documentation for LR 4 SDK and LR 5 SDK.  Here's what I found:

 

LrCatalog

catalog:buildSmartPreviews() [new]

catalog:createVirtualCopies() [new]

catalog:findPhotos() [can’t determine the exact difference]

catalog:getActiveSources() [corrected documentation]

 

LrCollection

collection:getSearchDescription() [new]

 

LrDialogs

LrDialogs.presentFloatingDialog() [new]

LrDialogs.showBezel() [new]

 

LrHttp

LrHttp.post() [corrected documentation]

LrHttp.postMultipart() [new parameter, suppressFormData]

 

LrPhoto

photo:buildSmartPreview() [new]

photo:deleteSmartPreview() [new]

photo:getRawMetadata() [new key “smartPreviewInfo”]

photo:requestJpegThumbnail() [new]

photo:setRawMetadata () [can’t determine the exact difference]

 

LrPublishedCollection

pubCollection:getSearchDescription() [new]

 

LrTasks

LrTasks.execute() [explanation of Mac OS sandbox restrictions]

 

LrView

[explanation that a factory object can only be used in one place at a time]

viewFactory:catalog_photo() [can’t determine the exact difference]

viewFactory:scrolled_view() [new parameters background_color, horizontal_scroller, vertical_scroller]

Restarting Lightroom - how to do it *and* have preferences saved (& start up with specified catalog)

$
0
0

I know one way to restart Lightroom (with specified catalog), however preferences are not saved:

 

Win: lightroom.exe -restart {catalog}

Mac: open {catalog}

 

However sometimes (usually) it would be better if preferences were saved on the way out.

 

PS - I can exit Lightroom with preferences saved by stuffing the keyboard (Alt/Cmd-FX), but how to get it to startup again (with specified catalog).

 

Any ideas?

 

Rob

How to send lightroom data to arduino?

$
0
0

Has anyone done this?

 

I'm an industrial design student working on a project in school and I want a two way communication with lightroom. I want to have physical output (LED's, turning knobs) that sits on your desk next to your computer. Send commands from arduino is not a problem, i've done that already but i want output as well

has anyone any advice where to begin, or anyone could help me out?

I can program in arduino pretty good, and have some basics in python

 

 

THANKS!

Which Lua version is used by LR 6?

$
0
0

Which Lua version is used by LR 6?

"Lightroom SDK 6 Programme Guide" states: "Lightroom 5 uses version 5.1.4 of the Lua language."

What about LR 6?

Is there a way to determine the version by means of the SDK or Lua?


How to change a font dynamically?

$
0
0

At a dialog I try to change a font dynamically. "Dynamically" means, changes of the font name and size by changes of related controls should affect the font of a static text (or edit field) immediatetly – not only if the values are stored at preferences and read by a subsequent call of the dialog. A test script:

***

local LrDialogs = import 'LrDialogs'

local LrView = import 'LrView'

local LrFunctionContext = import 'LrFunctionContext'

local LrBinding = import 'LrBinding'

local LrPrefs = import 'LrPrefs'

 

local LrLogger = import 'LrLogger'

local log = LrLogger('TestLogger')

log:enable('logfile')

 

local f = LrView.osFactory()

local bind = LrView.bind

local prefs = LrPrefs.prefsForPlugin()

 

local text = 'Lorem ipsum dolor sit amet, consectetur adipisici elit, ...'

 

LrFunctionContext.callWithContext ('showPreview', function(context)

  local props = LrBinding.makePropertyTable(context)

  props.font_name = prefs.fontName or 'Courier'

  props.font_size = prefs.fontSize or 12

  log:trace('Read: ' .. props.font_name .. '/' .. props.font_size)

 

  local previewText = f:static_text {

    title = text,

    font = {

      name = props.font_name,

      size = tonumber(props.font_size)

    },

  }

 

  local function updateFont()

    previewText.font = {

      name = props.font_name,

      size = tonumber(props.font_size),

    }

    log:trace('Change: ' .. props.font_name .. '/' .. props.font_size)

  end

 

  props:addObserver('font_name', updateFont)

  props:addObserver('font_size', updateFont)

 

  local contents = f:column {

    spacing = f:control_spacing(),

    bind_to_object = props,

 

    previewText, -- defined above

    f:separator { fill_horizontal = 1 },

    f:row {

      f:static_text { title = 'Font Name:' },

      f:combo_box {

        value = bind 'font_name',

        width_in_chars = 10,

        immediate = true,

        items = {

          'Courier', -- Mac

          'Courier New', -- Win

          'Lucida Console', -- Win

          'Monaco', -- Mac

        },

      },

      f:static_text { title = 'Font Size:' },

      f:combo_box {

        value = bind 'font_size',

        width_in_chars = 2,

        immediate = true,

        precision = 0,

        items = { 10, 12, 14, 16, },

      },

    },

  }

 

  LrDialogs.presentModalDialog({

    title = 'Font Change Test',

    contents = contents,

  })

 

  log:trace('Save: ' .. props.font_name .. '/' .. props.font_size)

  prefs.fontName = props.font_name

  prefs.fontSize = props.font_size

 

end)

***

 

The problem is: It works on macOS, not on Windows.

User Scripting (not plugins) in Lightroom?

$
0
0
Hi,

I don't know if any of you have been following the Export Keywords problem, but a KB article including a fix has been published about it. http://kb.adobe.com/selfservice/viewContent.do?externalId=kb405074&sliceId=2

This wouldn't normally be a subject for this forum, but the fix (an SQL update) is delivered via a .lua file that is:
* installed into a Scripts directory in the Lightroom presets directory (it wasn't present on my system prior to this)
* Enables a Scripts menu (to the right of the Window menu) and the first item is "Open User Scripts Folder"
* presents a dialog box (with a few options) that runs the SQL then restarts the product

Why I'm interested is it appears the Lightroom team has already baked a User Scripting mechanism into the product, beyond the plugin SDKs that have officially been announced. This hints at wider capability for us to extend the product - that certainly grabs my attention.

This is the first time I've seen any form of scripting (beyond that included in the Plugin SDK) publicly acknowledged albiet indirectly. Does anyone know where to find documentation about User Scripting capabilities/SDK/etc? Can anyone glean additional information from the fix that was published? I'm hoping one of you more experienced development types may be able to shed more light on this.

Thanks,
Matt

Dynamically Create Dialogs?

$
0
0

I am trying to figure out a way to dynamically create a dialog box... essentially I would like a dialog with a row for each item in an array...

 

However, I am kind of stuck with the Lua syntax for doing this.. any ideas?

 

my skeleton dialog is something like this --  this successfully creates a dialog with one row, but I can't figure out how to loop this so it would build multiple rows based on the number of iterations in the loop...

 

local f = LrView.osFactory()

 

local myRow = f:row {

     spacing = f:label_spacing(),

 

     f:edit_field {

          fill_horizonal = 1,

          width_in_chars = 25,

          value = 'test',

     },

 

     f:push_button {

          width = 50,

          title = 'Up',

          enabled = true,

     },

 

     f:push_button {

     width = 50,

     title = 'Down',

     enabled = true,

     },

}

 

 

 

-- set up the column ---------------------------------

 

local contents = f:column {

     spacing = f:control_spacing(),

     fill = 1,

     myRow

}                                  

 

Feature Request: Exiting Lightroom - Kill subprocesses too...

$
0
0

As it stands, there are certain subprocesses Lightroom starts, to handle things like http connections, I guess.

 

Unfortunately, when exiting, Lightroom does not always kill the aforementioned subprocesses, thus the Lightroom process persists and must be ended using task-manager (windows) before Lightroom can be started up again.

 

This makes it difficult for plugins that use xmlrpc, as example, to terminate everything so Lightroom can cleanly exit, just ceasing from issueing additional http requests is not enough.

 

I dont know if the details of my description are spot-on, but I'm having a devil of a time getting a plugin with an xmlrpc background task to gracefully shutdown so Lightroom can fully terminate its main process, so it can be restarted.

 

If I use "taskkill /IM Lightroom.exe /T" then it does the job, but it would be better if normal user termination did the job too, and anyway that command wont work on Mac, which I heard has the same trouble - anybody know how to do the equivalent on Mac (kill process + subprocesses)?

 

Thanks,

Rob

Writing a plugin to create Smart Collections

$
0
0

Hi folks

 


Is it possible to use the SDK to create a plugin that creates a Collection Set that contains a number of Smart collections.

 

I'd also like to be able to select a Folder and have the plugin use the folder name as one of the parameters in the Smart collections and the title of the Collection Set

 

Cheers in advance

Viewing all 53524 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>