8 Replies Latest reply on Jan 17, 2014 2:31 AM by DawMatt

    Writing Lightroom module

    PawelP

      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.

        • 1. Re: Writing Lightroom module
          johnrellis Most Valuable Participant

          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".

          • 2. Re: Writing Lightroom module
            PawelP Level 1

            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.

            • 3. Re: Writing Lightroom module
              areohbee Level 5

              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

              • 4. Re: Writing Lightroom module
                DawMatt Level 3

                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

                • 5. Re: Writing Lightroom module
                  PawelP Level 1

                  To be clear I have not made a custom module  (If I did why would I ask about it?). It was a theoretical question.

                   

                  Rob I've seen that you created many plug-ins for LR, and probably hit the wall many times that SDK is limited and you had to find a way around.

                  I was thinking If you've ever thought about having better control over LR via plugin/module by having more API.

                  • 6. Re: Writing Lightroom module
                    areohbee Level 5

                    PawelP wrote:

                     

                    To be clear I have not made a custom module

                    That was clear already.

                     

                     

                    PawelP wrote:

                     

                    It was a theoretical question.

                    That however was not clear, so thanks for clarifying.

                     

                     

                    PawelP wrote:

                     

                    Rob I've seen that you created many plug-ins for LR, and probably hit the wall many times that SDK is limited and you had to find a way around.

                    I was thinking If you've ever thought about having better control over LR via plugin/module by having more API.

                    Don't get me wrong: I'm all for creative thinking and brainstorming about how to push the envelope - sorry if I seemed discouraging.

                     

                    Jeffrey Friedl has done some things that I can't fathom via plugins, so obviously he's tapped into something beyond SDK calls (e.g. draggable scrollbar).

                     

                    I was envisioning you creating a module (not a plugin) and trying to sell it as such, which sounds like asking for trouble, not only from a technical standpoint but a legal one as well.

                     

                    But I'm all for figuring out how to make plugins which get around limitations.

                     

                    Cheers,

                    Rob

                    • 7. Re: Writing Lightroom module
                      PawelP Level 1

                      I was envisioning you creating a module (not a plugin) and trying to sell it as such, which sounds like asking for trouble, not only from a technical standpoint but a legal one as well.

                      Doing something that violates EULA and trying to sell it is the worst thing that anyone could ever do. I'm not that guy, believe me.

                       

                      But I'm all for figuring out how to make plugins which get around limitations.

                      Same here.

                      • 8. Re: Writing Lightroom module
                        DawMatt Level 3

                        Hi,

                         

                        Thanks for the clarification.

                         

                        PawelP wrote:

                         

                        PawelP wrote:

                         

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

                        I also asked about retrieving undocumented methods/properties via legal Lua methods (I guess it's a way to get something usefull, but inside SDK's world) . Does it break EULA or not?

                        Does it break the EULA? That is an interpretation you need to make yourself, sorry. Can't give you legal advice.

                         

                        Matt