# Dynamic content in the Export plugin



## apple (Nov 20, 2008)

Hi all 

I am was a begginner in Lightroom plugin development role and have some questions.
Of course I see sources of the Jeffrey Friedl's plugins for LR 1 and can fix
may be all my problems except dynamic context one.
Lets look on the problem:

 I download from site the list of the contacts for logged in user
to specify for each one - can them see the photos or not.
As I understand I can not on the fly create the set of the checkboxes
and add them to dialog. So solution is to place contacts into
2 popup menus - "Yes" or "No" and add 4 buttons ("<<" "<" ">" ">>" )to move them from one menu to another.

2. What is the current state of the lua decompiler? - LR2 use 5.1.2 version so 
we have no access to source code of the all new LR2 plugins -
last supported is 5.'.1. Because samples included in the SDK do not
cover many things, ability to see the source of the real plugin can help in the development process.

3. Where is the complete SDK reference - for example I can not found in the PDF documentation file information related to VERSION macro in the Info.lua for LR 2. Also I need a listbox with multiselection control - why the number 
of standard set controls is limited to combobox and popup menu?


----------



## Brad Snyder (Nov 20, 2008)

Apple, Welcome. 

That's pretty esoteric stuff for most of our regulars. Several folks here will probably be able to help, but they're scattered in time zones around the world and turnaround time may suffer a little.


----------



## apple (Nov 21, 2008)

Thanks 4 response
May be some plugin developres read the forum

Will share some part of magic knowledge 

To have a version of the plugin indside PluginManager dialog
developer must add following into Info.lua file on LR2
for version 1.'.'.1 for example:

VERSION = { major=1, minor=', revision=', build=1, display='1.'.'.1'},

Please note the display='1.'.'.1' attribute - it was specific for LR2
(VERSION can be found in one of the sample plugins )


----------



## Kiwigeoff (Nov 21, 2008)

Welcome apple, I sure hope that some one will come along and help you out. I have no knowledge of code at all !!
Enjoy yourself here!!:lol:


----------



## Victoria Bampton (Nov 21, 2008)

Welcome apple

Your best bet for SDK stuff is probably the official SDK forum.  http://www.adobeforums.com/webx/.59b5c4e8/


----------



## mjmw (Nov 22, 2008)

Hi apple, Victoria is right, the Adobe SDK forum is probably best, but looking at your comments...

1. As far as I have found, yes that would be the only way to do what you want.  I have poked around trying to create dynamic lists of checkboxes, but ended up changing my UI to fit the SDK.

2. I assume/guess that most people 'pre-compile' their plugins to protect their IP and revenue stream.  For example, if Timothy Armes released his plugins as ASCII Lua scripts, it would be trivial to remove the limitations of the 'free' versions and therefore reduce the 'desire' to donate.

3. There is documentation in *LrApplication* for version information...although I agree that VERSION seems very poorly documented!

EDIT: to clarify, LrApplication is for Lightroom version not the Plugin version.


----------



## AlexeyD (Dec 10, 2008)

Hi,  I can try to answer one of your questions.  





apple said:


> 2. What is the current state of the lua decompiler? - LR2 use 5.1.2 version so
> we have no access to source code of the all new LR2 plugins -
> last supported is 5.'.1. Because samples included in the SDK do not
> cover many things, ability to see the source of the real plugin can help in the development process.


  There is unfortunately no known Lua 5.1 decompiler and only partially working Lua 5.' decompiler (known as luadec). Unfortunately porting from Lua 5.' to 5.1 is not a very straightforward task because the underlying VM changes (in some cases quite significant). Also the luadec was done as a proof of concept application so it does not aim to be complete. For example it will struggle with the compiled Lua application that has symbol information stripped (it needs to distinguish between local variables and temp values and without symbols it's not always even possible). Still it could be done - perhaps you may be up to the challenge?-)  

 The plugin authors use bytecode compilation on purpouse to protect their intellectual property and I respect that. The Jeffrey Friedl's earlier code for his LR 1.x plugins was all practically open source (except single file) so you can use that as a starting point. If you feel adventurous enough and know about Lua VM then you can use ChunkSpy - which is a Lua disassembler (but it does make it easy to read the code since it decyphers the symbols and numeric data). 

There are some clever tricks that can make even that task quite challenging though - the same Jeffrey Friedl very cleverly obfuscated his LR 2.x plugins so it's not your typical Lua compiled files and you find disassembly practically unintelligible (it adds a layer of extra enveloping of all the stuff in a table which makes it practically unreadable in disassembly). So for the sake of saving your time - I'd say it's not worth it. Jeffrey and other LR plugin developers are very nice and open guys and I'm sure if you ask them a question about how to do something tricky in LR plugin , then you will definitely get your answer.  

Good luck.


----------



## Sean McCormack (Dec 18, 2008)

They are protective of their code, but not their knowledge. That said, both Jeffrey and Tim are quite busy at the moment and are among the more prolific plugin writers.


----------

