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

using the tekui toolkit with lightroom

$
0
0

 

 

 

Hello all,

first I'm new to this scripting language  and the plugin API for Lightroomso please forgive my ignorance .

 

I was wondering if any one as try using the tekui toolkit?

I been trying to uses it with no luck I keep getting the error "Could not find namespace tek.ui

I can run the sample helloworld.lua from the tekui sample file with knoiw problem..

 

I’m not sure if I need to recompile anything etc.

 

 

Any help would be great

Mike

 

code---------

this lua file I'm trying to uses to load the tekui dialog box..

 

MyHWExportItem = {}

 

function MyHWExportItem.showModalDialog()

ui = require"tek.ui"

 

ui.Application:new

{

            Children =

            {

                        ui.Window:new

                        {

                                    Title = "Hello",

                                    HideOnEscape = true,

                                    Children =

                                    {

                                                ui.Button:new

                                                {

                                                            Text = "_Hello, World!",

                                                            onPress = function(self, pressed)

                                                                        if pressed == false then

                                                                                    print "Hello, World!"

                                                                        end

                                                                        ui.Button.onPress(self, pressed)

                                                            end,

                                                },

                                    },

                        },

            },

}:run()

 

end

 

MyHWExportItem.showModalDialog()


LrCatalog.getCollections() ?

$
0
0

For the LrCollection class, the documentation says:
"Retrieve the objects for all the collections by calling LrCatalog.getCollections()."
but there is no other info about it. What does it return?

 

I have:
local LrApplication = import "LrApplication"
local LrCatalog = LrApplication.activeCatalog()
local collections = LrCatalog:getCollections()

 

I get:
internal error.... attempt to call method getCollections (a nil value)

 

What am I doing wrong?

Pete

Scripts - Not plugins

$
0
0

I recently discovered a new feature in Lightroom 4 (not documented).

 

Add a Scripts directory (sibling of 'Modules' directory) and you can run lua scripts without making full-blown plugins.

 

e.g. D:\Users\{me}\AppData\Roaming\Adobe\Lightroom\Scripts\HelloWorld.lua

 

local LrDialogs = import 'LrDialogs'

LrDialogs.message( "Hello", "(World)" )

 

Appears as 'HelloWorld' in Scripts Menu (Main Lightroom Toolbar - for all modules).

 

(restart Lightroom after adding new scripts).

 

Rob

How to define smart collection rules to match a folder's path?

$
0
0

I was hoping to define a tree of (smart) collections to match my folders tree, but coming up with a search criteria to match the folder path is proving difficult at best, impossible at worst.

 

Any ideas?

Is there documentation for URL Scheme of lightroom:// ?

$
0
0

Hi everyone,

I'm trying to find some sort of documentation for using URL Schemes for lightroom, I know it takes links like <a href="lightroom://foo"></a> and opens it, but I was wondering which actions can you pass?

 

Thank you.

Export plugin on Macintosh not honoring LrTasks.startAsyncTask ?

$
0
0

Hi -- I need some help again!

 

I'm writing an export plugin for my own application. 

 

On Windows, everything works as expected -- I can start the export and then go back to doing other tasks in Lightroom while my application does its own thing.

 

But on Macintosh, Lightroom hangs with the rotating "busy" icon until my application quits.

 

I am baffled by this behavior because I think I've wrapped everything I'm doing in calls to LrTasks.startAsyncTask.

 

Apparently I'm missing something about how asynchronous tasks work in Lightroom, or at least in Lightroom on Macintosh.

 

Do you have any suggestions about how I can get the Mac version to keep Lightroom responsive while my exported-to application does its thing?

 

Thanks!

 

--Rik

 

For further information...

 

Mac OS X 10.9, Lightroom 4.2

 

Here is the current structure of my ExportToMA.lua file

 

local myLogger        = LrLogger("myLogger")

 

myLogger:enable("logfile")

 

ExportToMA = {}

 

ExportToMA.outputToLog = function(param)

  myLogger:trace(param)

end

 

LrTasks.startAsyncTask( function()

    myLogger:trace("Entering outer LrTasks.startAsyncTask function")

    ...

    LrTasks.startAsyncTask( function()

        myLogger:trace("Entering inner LrTasks.startAsyncTask function")

        local activeCatalog = LrApplication.activeCatalog()

        local frameSet     = activeCatalog.targetPhotos

        local exportSession = LrExportSession( {

            exportSettings = {

                LR_exportServiceProvider       = "net.mydomain.MAloader",

                LR_exportServiceProviderTitle  = "My Application",

                LR_format                      = "TIFF",

                LR_tiff_compressionMethod      = "compressionMethod_None",

                LR_export_bitDepth             = 16,

                LR_export_colorSpace           = "sRGB",

                LR_minimizeEmbeddedMetadata    = false

                },

            photosToExport = frameSet,

            } )

        myLogger:trace("Before doExportOnCurrentTask()")

        exportSession:doExportOnCurrentTask()       

        myLogger:trace("After doExportOnCurrentTask()")

        myLogger:trace("Exiting inner LrTasks.startAsyncTask function")

    end )

    myLogger:trace("Exiting outer LrTasks.startAsyncTask function")

end )

 

When run on Windows, the log file contains a sequence of messages like this:

 

12/30/2013 10:36:48 TRACE    Entering outer LrTasks.startAsyncTask function
12/30/2013 10:36:48 TRACE    Exiting outer LrTasks.startAsyncTask function
12/30/2013 10:36:48 TRACE    Entering inner LrTasks.startAsyncTask function
12/30/2013 10:36:48 TRACE    Before doExportOnCurrentTask()
12/30/2013 10:36:49 TRACE    After doExportOnCurrentTask()
12/30/2013 10:36:49 TRACE    Exiting inner LrTasks.startAsyncTask function
   <meanwhile my application continues to run while Lightroom stays responsive>

 

But when run on Macintosh, this is what happens:

 

2013-12-30 19:01:50 +0000, TRACE    Entering outer LrTasks.startAsyncTask function
2013-12-30 19:01:50 +0000, TRACE    Exiting outer LrTasks.startAsyncTask function
2013-12-30 19:01:50 +0000, TRACE    Entering inner LrTasks.startAsyncTask function
2013-12-30 19:01:50 +0000, TRACE    Before doExportOnCurrentTask()
  <indefinitely long pause while my application runs>
2013-12-30 19:02:44 +0000, TRACE    After doExportOnCurrentTask()
2013-12-30 19:02:44 +0000, TRACE    Exiting inner LrTasks.startAsyncTask function

 

Ideas?

Lightroom Exchange Classic dead?

$
0
0

Looks like the Adobe Lightroom Exchange Classic is dead.  The last submitted plugin is dated 10/14/13.  My submission from last fall is still stuck in Status: New Submission awaiting review.

Overriding image width with updateExportSettings

$
0
0

Writing my first lightroom plugin, I have created a minimal example which should set the photo width here and included below. However I can not get the image to be the 400 x 400 specified.

 

ExportFilterProvider400.lua

local LrView = import 'LrView'
local bind   = LrView.bind
--------------------------------------------------------------------------------
-- This function will create the section displayed on the export dialog
-- when this filter is added to the export session.

local function sectionForFilterInDialog( f, propertyTable )
  return {    title = LOC "$$$/SDK/MetaExportFilter/SectionTitle=400x400 Filter",  }
end

--------------------------------------------------------------------------------
-- Example on updating export settings
local function updateExportSettings( exportSettings )
  exportSettings.LR_size_maxHeight = 400  exportSettings.LR_size_maxWidth  = 400  exportSettings.LR_size_doConstrain = true
end

--------------------------------------------------------------------------------
return {
sectionForFilterInDialog = sectionForFilterInDialog,
updateExportSettings     = updateExportSettings    , --Does this works
}

 

Info.lua

 

return {  LrSdkVersion        = 3.0,  LrSdkMinimumVersion = 1.3, -- minimum SDK version required by this plugin  LrPluginName        = "400x400 Export",  LrToolkitIdentifier = 'sample.export400x400',  LrExportFilterProvider = {    title = LOC "$$$/SDK/MetaExportFilter/Sample=400x400 Size", -- the string that appears in the export filter section of the export dialog in LR    file  = 'ExportFilterProvider400.lua', -- name of the file containing the filter definition script    id    = "metadata1",  -- unique identifier for export filter  },  VERSION = { major=5, minor=0, revision=0, build=907681, },
}

 

Adobe Lightroom can load the plugin, and add it to the export session, but the updateExportSettings do not seem to take effect. Tested in Lightroom 5.3.

 

 

Thanks


Custom collection order in publish service

$
0
0

In my publish service i have a problem. There is some collections which named by date of some period, and they update periodically (create new/delete old ). I need to sort them by descending, but they always sorted by ascending (it does not depens of collection creation date)

As example:

There are 2 collections: "2014-01-01" , "2014-01-02" (exact order) when I create new collection (newer date)  "2014-01-03"  it always creates below by sort order, but  if i create "2013-12-30"  it will be created  higher

How I can set my custom order ?

Modifying Metadata with an Export Filter

$
0
0

I have managed to create an export filter that modifies exportSettings shown below but is there a way to set metadata on the image, preferably on a per image basis (renditionOptions only being evaluated once), I would like to set the metadata on the generated image but on the lightroom master copy is ok. Ideally will not have to rely on external tools like exiftool.

 

I think the commad would go in the for sourceRendition section, but not sure how you access or change the photos metadata.

 

Thanks

 

local function sectionForFilterInDialog( f, propertyTable )

  return {

    title = LOC "$$$/SDK/MetaExportFilter/SectionTitle=400x400 Filter",

  }

end

 

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

local function postProcessRenderedPhotos( functionContext, filterContext )

 

  local renditionOptions = {

    filterSettings = function( renditionToSatisfy, exportSettings )

      logger:info('renditionOptions'  ) 

      exportSettings.LR_size_maxHeight = 400

      exportSettings.LR_size_maxWidth  = 400

      exportSettings.LR_size_doConstrain = true

    end

  }

 

  for sourceRendition, renditionToSatisfy in filterContext:renditions( renditionOptions ) do

    -- Wait for the upstream task to finish its work on this photo.

    local success, pathOrMessage = sourceRendition:waitForRender()

  end

end

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

 

return {

  sectionForFilterInDialog  = sectionForFilterInDialog,

  postProcessRenderedPhotos = postProcessRenderedPhotos,

}

Problem with startAsyncTask to fill value into popup_menu items

$
0
0

Hi everybody,

 

I encountered a problem to fill the popup_menu items with a startAsyncTask function.

 

This is my function:

 

function getLabelColor(propertyTable)          local catalog = LrApplication:activeCatalog()          local labelColor = catalog:getLabelMapToColorName()          propertyTable.label_red = getKeyForValue(labelColor, "red") -- getKeyForValue return the key for the value          propertyTable.label_green = getKeyForValue(labelColor, "green")          propertyTable.label_yellow = getKeyForValue(labelColor, "yellow")          propertyTable.label_blue = getKeyForValue(labelColor, "blue")          propertyTable.label_purple = getKeyForValue(labelColor, "purple")
end

 

I run the async task on sectionsForTopOfDialog:

 

function exportServiceProvider.sectionsForTopOfDialog(f, propertyTable)          LrTasks.startAsyncTask(function ()                    getLabelColor(propertyTable)          end)          return MLDialogs.settings(f, propertyTable)

end

 

On my MLDialogs.settings function I've this:

 

f:popup_menu {     title = LOC "$$$/ML/ExportManager/ASLabel=Color label for Dual ISO file :",     items = {           { title = "", value = "" },           { title = propertyTable.label_red, value = "red" }             { title = propertyTable.label_yellow, value = "yellow" },          { title = propertyTable.label_green, value = "green" },          { title = propertyTable.label_blue, value = "blue" },          { title = propertyTable.label_purple, value = "purple" },     },     value = bind "label",     size = 'small'
},

 

When I run the plugin, it display the value from the color label, but if I change the values for the color, when I run the plugin, the display values is the old (but on the log I've the new, so the title isn't refreshed).

 

I found that the async function return value after sectionsForTopOfDialog is displayed.

I try to change title = propertyTable.label_red to title = bind 'label_red' but I've an error:

 

Invalid parameter not satisfying: aString != nil

 

you can found the source here https://bitbucket.org/kichetof/lr_cr2hdr/src

 

I hope you can help me!

Cheers

Tof

Question about showing jpeg metadata in lightroom

$
0
0

Hi,

 

I have briefly gone through the sdk material but there are some aspects that remained unclear to me. In more detail, I would like to show the RegionName tag from jpg-file in the LR metadata for searching etc. This tag includes the face recognition data from Picasa. I have already experimented with the exiftool and know how to add the names in RegionName to Subject or Keywords tag in both jpg-file and corresponding .xmp file for the raw-file. However, I would like to find an elegant solution by showing the tag in the LR directly. Before trying the make the LUA code, I would like to understand some basic principles behind the plugin programming namely:

1) How do I read the RegionName tag from the jpg-file and in which part of the plug-in? Is there a way to make LR read it every time the "Read Metadata from File" is used?

2) How do I "publish" it to appear in the Metadata panel on the right side of the LR (this is somewhat handled in the examples even though I do not understand the com.adobe.xxx reference i.e. which structure is it actually referencing to?)

 

Any comments and help is welcome on this or any advice where to find the information!

 

Mikko

Question about how ExifMeta handles multivalued tags

$
0
0

Hi,

 

I have tested the ExifMeta (Great work, just what I needed!) to read face recognition data written by Picasa to RegionName, RegionType etc. fields in jpg metadata. Everything seems to work fine if there is only one name in the field but Picasa writes several values separated with commas like this:

RegionName     John Doe, Jill Doll

RegionType     Face, Face

etc.

 

In that case, the corresponding fields remain completely empty. So is this convention of writing several values separated by commas "standard" way of doing this? Is there any way to fix this?

 

Additionally, three Region category tags refuse to load giving the following error:

"Not updating due to error getting property, id: XMPmwgrs_RegionAppliedToDimensionsUnit, from: nil, to: pixel, err-msg: Attempt to access property "XMPmwgrs_RegionAppliedToDimensionsUnit" not declared in com.robcole.lightroom.ExifMeta's Info.lua"

 

This is minor problem but it would be nice to know how to handle this kind of error in the future. Do I need to declare these in the lua-code if I need them?

 

Looking forward to replies,

 

Mikko

Interactive debugger for Lightroom plugins

$
0
0

The Lua IDE "ZeroBrane" now supports interactive debugging of Lightroom plugins. This means you can set breakpoints, step through your code line by line, examine/watch your variables as you do so etc. It can be quite helpful when debugging a complex situation in a plugin, and I don't think it was previously available.

 

For more details see here,

http://notebook.kulchenko.com/zerobrane/debugging-lightroom-plugins-zerobrane-studio-ide

See the last screenshot for a view of the interactive debugger.

 

(Disclaimer: I am not affiliated with them but have worked a little with their software, and like it. Paul, the developer, is very responsive and helpful, in case you should still encounter the occasional quirk.)

photo:getRawMetadata( "gpsAltitude") always returns a positive value

$
0
0

I noticed, both on Windows 7 and Apple OS X 10.9 that calling the photo:getRawMetadata( "gpsAltitude") always returns a positive value.

Also when Lightroom in the user interface displays a negative value.

 

The strange thing is that the photo:getFormattedMetadata( "gpsAltitude") returns the right value, however formatted.

 

I reported the bug, see Lightroom 5 SDK photo:getRawMetadata( "gpsAltitude") gives always positive value also when it should be negative

 

I thought to document it also here for those who walk into this also.


function publishServiceProvider.metadataThatTriggersRepublish( publishSettings ) issue in Mac

$
0
0

This is the function where I am trying to set custom metadata tagset for my plugin to true so that when user will update those metadata then it would be marked for Re-publish. However this only works for Lightroom in Windows and not for Lightroom in Mac. Below is the snippet of this function.

 

function publishServiceProvider.metadataThatTriggersRepublish( publishSettings )

  return {

  default = false,

  title = false,

  caption = true,

  keywords = true,

  [ "com.custom.publisher.category" ] = true,

  }

end

 

 

I am using Lightroom 5.

Can I export. Tiff file from Lightroom Mobile to camera roll on iPad or to another app

$
0
0

I Snyc from Lightoom 5.4 to LM on my ipad. They are tif files .  I edit and want to either send to Camera roll on iPad or copy to another app for further editing.  I can't seem to do it.  It becomes a jpeg.

THanks

Weak keys, weak values, garbage collection...

$
0
0

Any body have any experience with these things they could share?

 

Like when does garbage collection run, and cases when weak tables might be appropriate..

catalog:getFolderByPath does not work if folder on (unmapped) network drive.

assertion failed "Lightroom 5

$
0
0

when I try to open Lightroom on my PC, it answered "assertion failed". I allready tried to visit the "picture registrer" as recommanded by Adobe, and the register's name seems to be right. What more can I do? I downloaded the 30 das version and I bought the version 5 on CD.

Viewing all 53524 articles
Browse latest View live


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