Local Preset storage location

72 views
Skip to first unread message

John Cothron

unread,
Jul 7, 2019, 9:25:40 PM7/7/19
to MIDI2LR
I recall that at some point (several versions ago) I had to deal with the way I store my local presents (with the catalog in custom named folders) vs. the way MIDI2LR expected those presets to be stored. As a result, the presets did not show up in the "local presets dialog" and therefore could not be chose as to which is local 1, 2, etc.  

In any event, apparently my work around has gone away with one of the recent updates, and I cannot remember exactly what I did in the first place.  I thought there had been a thread here discussing the issue but if so I can't find it through search now.  

From what little I can piece together, I THINK I added a config file somewhere, that contained the actual path to the local presents.  Does that sound correct?  Looking at the code I do recall what I had to figure out was how to specificy a direct path vs. the line below which is in the localpresent.lua part of the code 

51 local LocalAdjustmentPresetsPath = LrPathUtils.child(LrPathUtils.getStandardFilePath ('appData') , 'Local Adjustment Presets')

If I'm remembering correctly I replaced everything after the = sign with the actual path ..   "C:\x\x\x|Local Adjustment Presents"  and placed that file in a config.lua file or something like that.

Ironically the local adjustments I already had assigned still work correctly, I just cannot update or add new ones in the options dialog.

Thank you

John


Rory Jaffe

unread,
Jul 9, 2019, 2:31:04 PM7/9/19
to MIDI2LR
Yes, replace everything after the = sign with the path. One thing-with Windows, you'll have to double each backslash, so C:\x\x\x|Local Adjustment Presents should be written as C:\\x\\x\\x\\Local Adjustment Presents

John Cothron

unread,
Jul 12, 2019, 5:44:48 PM7/12/19
to MIDI2LR
Rory,

I really appreciate the help, unfortunately I'm apparently still doing something incorrectly.  I tried two things:

1.  I placed this line :  local LocalAdjustmentPresetsPath = "C:\\Users\\John Cothron\\Lightroom\\Lightroom Settings\\Local Adjustment Presets"   in a file called named config.lua and placed that file in the midi2LR plugin folder.  I confirmed that the config.lua file is not getting treated as a .txt file.  I also tried the same line with single quote marks, as well as removing the "local" from the beginning thinking it might need to be a global variable  when set as part of the config file.  None of that seemed to work.  (obviously reloaded the plugin)

2.  I copied the contents of the localpresets.lua file from the source code, and modified line 51 to read the same as in #1 and saved it as localpresets.lua and placed that in the plugin folder  I renamed the existing localpresets.lua file to localpresetsold.lua before adding the "new" version.  I didn't have any luck with that either, and didn't expect to really.

I realize I'm obviously missing something but haven't been able to figure it out thusfar (still looking at reading).  I'm not that familiar with lua (yet) although I'm learning just by looking through some of the code and a couple of simple plugins I've written on my own.  

Incidentally it's frustrating that they limit the field types you can create, particular the text field 500 character limit.

Any help appreciated!

Rory Jaffe

unread,
Jul 12, 2019, 11:15:49 PM7/12/19
to MIDI2LR
config.lua would have no effect--it's not relevant to MIDI2LR.

Editing LocalPresets.lua should work. Line 51 defines the path that will be searched for presets. The for loop starting on line 82 looks for files in that directory and child directories that are non-zero in size and have lrtermplate as the extension, and puts those into the table for use in the dialog.

lua string literals delimited with '' or "" are treated alike, so that doesn't change things (other than that within '' you need to escape an ', and within "" you need to escape a ").

I would triple-check the file path you used. Getting Line 51 correct should allow you to see your presets.

Good luck in learning lua. It has some oddities, such as for certain types you are dealing with references to the data, not the data itself (e.g., tables, strings), and most of its advanced capabilities stem from what you can do with tables and metatables. I also find it very hard to debug.

John Cothron

unread,
Jul 13, 2019, 9:29:50 AM7/13/19
to MIDI2LR
Rory,

Thank you again.  Here is the way I modified the localpresets.lua file:

local LrApplicationView   = import 'LrApplicationView'
local LrDevelopController = import 'LrDevelopController'
local LrDialogs     = import 'LrDialogs'
local LrFileUtils   = import 'LrFileUtils'
local LrPathUtils   = import 'LrPathUtils'
local LrView        = import 'LrView'

local LocalAdjustmentPresetsPath = "C:\\Users\\John Cothron\\Lightroom\\Lightroom Settings\\Local Adjustment Presets"

local LocalPresets = {}  --Store presets in table when reqested by user : key = filename, value = preset values table

I'm sure I have something wrong there, but it must be some sort of syntax I'm missing, the path is for sure correct.

In fact, I reverted to the original localpresets.lua file, moved my local adjustment presets to \appdata\roaming, etc. (the place they normally get stored) and everything works as it should.  So it is obviously something I'm doing incorrectly.

In any event, I made the decision to store my lightroom settings/presents as lightroom normally would by default.  Frankly that seems easier and less complicated to deal with. I just need to modify my backup scheme some.  That will allow me to use my free time to work on the project that is really on my mind which is dealing with how Lr exports keywords, and the lack of choices.  I have a concept in mind but I think I'll have to utilize exiftool to make it work.

I really appreciate the help!
Reply all
Reply to author
Forward
0 new messages