Skip to main content
Inspiring
January 1, 2023
Question

Writing Export Service Provider

  • January 1, 2023
  • 1 reply
  • 251 views

Hi.

I'm writing Export plugin for Lightroom Classic and have some questions.

Hope someone will be able to answer them 🙂

Main idea of the plugin is to group photos that user selected for export into sets based on metadata, and then export each set with different settings.

I'm doing this in the exportServiceProvider.processRenderedPhotos(functionContext, exportContext).

Everything seems fine so far.

My questions are:

1. What should I do with original LrExportSession provided in the exportContext?

I can't find any mention of destructor or something similar in the SDK.

I suppose it consumes memory, and if user is exporting thousands of images this can be quite noticeable.

Should I just leave it alone and LRC will handle everything, or should I perform cleanup somehow?

2. What should I do (if anything) to make export filters attached in the export dialog to work with my newly created export sessions?

 

If this matters - export settings for new export sessions are copied from original export session and then some fields edited.

 

Hope someone will shed some lite on this.

 

This topic has been closed for replies.

1 reply

johnrellis
Legend
January 1, 2023

"What should I do with original LrExportSession provided in the exportContext?

I can't find any mention of destructor or something similar in the SDK."

 

Lua has garbage collection, so in general there are no destructors in the SDK that clients need to call.  

 

"What should I do (if anything) to make export filters attached in the export dialog to work with my newly created export sessions?"

 

I'm not expert in exporting and publishing with the SDK, so perhaps someone else can chime in.  But did you see Chapter 3: Creating Export And Publish Services in the Lightroom Classic SDK Programmers Guide?  It's got an in-depth discussion of how the stages of exporting with filters work.

FSt0pAuthor
Inspiring
January 1, 2023

Thank you for your reply.

 

"Lua has garbage collection, so in general there are no destructors in the SDK that clients need to call."

 

Well, I understand that if I'll just leave it alone Lightroom will eventually handle it. My concern is that I'm creating new exports programmatically and will eventually double required memory, so I'm thinking about calling removePhoto() on original export session after photo is copied to my new session (actually move photo from old session to new one instead of copy). I just thought maybe there is some better way to do this...

 

"But did you see Chapter 3: Creating Export And Publish Services in the Lightroom Classic SDK Programmers Guide?"

Yes, I did.

The problem for me is that it kinda explains pipeline, but doesnt explain how those stages are referenced by APIs (or maybe I just didn't get it).

There it is written that when processRenderedPhotos() is called, filters have already been applied. But it's not clear what structures exactly was changed by filters (list of photos, renditions or something else).

Because of this I don't know if my newly created export sessions will inherit those changes or not.

Of course I can just test if filter effect will be preserved and hope that I'm not missing anything, but in my opinion it's not a proper way to write programs...

johnrellis
Legend
January 2, 2023

You've reached the limits of my knowledge, hopefully someone else who knows more will reply. The plug-in community here is pretty small, especially after Adobe merged the plug-in forum with the main forum.