Skip to main content
Participant
January 16, 2014
Question

Writing Lightroom module

  • January 16, 2014
  • 2 replies
  • 1634 views

Has anyone tried to write Lightroom module (*.lrmodule)? I checked SDK API and it's quite limited (but i've seen nice plug-ins based on it).

I believe that module can have bigger possibilites than plug-in. I'm also interested if it breaks EULA.

This topic has been closed for replies.

2 replies

DawMatt
Inspiring
January 17, 2014

Hi,

PawelP wrote:

Has anyone tried to write Lightroom module (*.lrmodule)? I checked SDK API and it's quite limited (but i've seen nice plug-ins based on it).

I believe that module can have bigger possibilites than plug-in. I'm also interested if it breaks EULA.

I'd really discourage any attempts to write an lrmodule. While I'm sure it would break the EULA and bring unwanted legal attention, I'd discourage it purely based upon the technical issues of writing and maintaining your code.

If you look in the Lightroom folder you'll see different .lrmodule files for each of the modules you can access from the interface and some that are not considered full modules in their own right (i.e. import). These are major portions of the Lightroom application and need to be "glued" into the UI so users can access them (primarily the module bar or menu settings). They use an undocumented file structure, undocumented interfaces, and were only ever intended for use by Adobe developers working on the core of the product. They are likely to use a mix of languages (presumably C or Objective-C and Lua) in the implementation. Any code you write here won't be operating within the safety net provided by the Lightroom SDK and could lock up the UI and/or corrupt data.

To make it work you would need to do a significant amount of reverse engineering from now through to whenever you stop maintaining the module, because every LR release could potentially break something in your code. You would need to modify the UI to create ways to hook into the module. And it will likely result in fragile code because you will be guessing at the design and code constraints you should be operating within. To me it sounds like a good way to lose lots and lots of hours of effort writing and maintaining code that will always be fragile because of all the unknowns.

The architecture of Lightroom has been described in slides and video by one of the Adobe team. This would give you an idea of what you would be getting yourself into.

In recent versions I've noticed that some of the inbuilt plugins were released as .lrplugin files (not directories) on Windows and I did ask about that. Turned out this was merely a different approach to packaging and as such was cosmetic only. The only notable impact of packaging a plugin this way is that you would need to distribute Mac and Windows versions of your plugins separately because the new packaging was Windows specific and wouldn't work on Mac. Presumably you would strike a similar issue if you built an lrmodule and would need to distribute separate versions for each platform.

All in all it feels like it wouldn't be worth the effort. I'm curious if you think you have an idea that could be worth all that pain.

Matt

johnrellis
Legend
January 16, 2014

I haven't heard of anyone trying to write a LR module.   As you've observed, the SDK does not provide an API for writing a module.  It would almost certainly require reserve engineering, which the LR license (included in the install directory) prohibits, and it would probably require modification of the LR binary to allow Lua modules you write to call into internal Lua APIs.  Whether the prohibition against reverse engineering is ethical or legally enforceable in the US or EU is a complex, still-debated question -- do an Internet search for "reverse engineering".

PawelPAuthor
Participant
January 16, 2014

I've seen on forum entries with undocumented namespaces and methods. Were they reverse engineered?

I'm wondering whether using ipairs/pairs/debug.getmetatable/debug.setmetatable to discover methods or properties is reverse engineering.

Regarding modyfing binary code. I assume that idea behind module is to produce generic code without need for extra hacks.

areohbee
Legend
January 17, 2014

Finding undocumented lua methods etc. and reverse engineering for custom module are worlds apart, regardless of the semantics / licensing / legal...

My guess: it'd be a very large can of worms attempting a custom module - maybe I'm wrong..

And it's one thing to make a plugin that uses some undocumented features (Adobe not likely to raise a stink) vs. having an un-authorized/un-approved Lr module - it wouldn't surprise me if you got a call from their attorney...

Maybe some day, Adobe will support 3rd party modules, but that day is not today.

I mean, I'd be curious if you learn more - I'm just speculating...

Cheers,

Rob