Export plugin on Macintosh not honoring LrTasks.startAsyncTask ?
hi -- need again!
i'm writing export plugin own application.
on windows, works expected -- can start export , go doing other tasks in lightroom while application own thing.
but on macintosh, lightroom hangs rotating "busy" icon until application quits.
i baffled behavior because think i've wrapped i'm doing in calls lrtasks.startasynctask.
apparently i'm missing how asynchronous tasks work in lightroom, or @ least in lightroom on macintosh.
do have suggestions how can mac version keep lightroom responsive while exported-to application thing?
thanks!
--rik
for further information...
mac os x 10.9, lightroom 4.2
here current structure of 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, log file contains sequence of messages 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 application continues run while lightroom stays responsive>
but when run on macintosh, 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 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?
well, async task working, export-on-current-task seems strange. mean, windows version should take longer (1 second multi-photo export - really?), , mac version shouldn't cause spinning beach ball. so, i'm guessing have bug in export settings happens manifest differently on different platforms - be? (for example, no export destination has been specified).
here's can try:
instead of
exportsession:doexportoncurrenttask()
do this:
for i, rendition in exportsession:renditions() do
local status, pathormessage = rendition:waitforrender()
if status then
outputtolog( "exported "..pathormessage )
else
outputtolog( "unable export - "..pathormessage )
end
end
More discussions in Lightroom SDK
adobe
Comments
Post a Comment