{"id":2731,"date":"2016-09-15T21:37:55","date_gmt":"2016-09-15T12:37:55","guid":{"rendered":"https:\/\/regex.info\/blog\/2016-09-15\/2731"},"modified":"2016-09-15T21:45:09","modified_gmt":"2016-09-15T12:45:09","slug":"adding-your-own-custom-photo-metadata-fields-to-lightroom","status":"publish","type":"post","link":"https:\/\/regex.info\/blog\/2016-09-15\/2731","title":{"rendered":"Adding Your Own Custom Photo-Metadata Fields to Lightroom"},"content":{"rendered":"\n\n<style type=\"text\/css\">\ndiv.warning {\n        background-image: url(http:\/\/regex.info\/i\/p\/warning.png);\n        background-repeat: no-repeat;\n        background-position: 20px 20px;\n        background-color: black;\n        border: solid 1px white;\n        margin:60px 50px;\n        padding-left: 120px;\n        padding-top: 15px;\n        padding-right: 2em;\n        min-height: 95px;\n  }\n  div.warning p:first-child { margin-top:0px }\n<\/style>\n\n<p>Lightroom allows for a variety of metadata for each photo or video... capture date, caption, keywords, etc., and plugins can\nadd further, custom fields, but sometimes what's offered by Lightroom or existing plugins just doesn't fulfill one's own specific\nneeds. Luckily, it's actually fairly easy to make your very own Lightroom plugin to add your own metadata fields. <span\nclass='nobr'>In this post<\/span>, I'll show you how.<\/p>\n\n<p>It's fairly quick and simple. It will take <i>far<\/i> longer to read this post about how to do it\nthan it takes to actually do it.<\/p>\n\n<p>The kind of fields we can add this way are simple text fields, where you can enter whatever text you like. <span\nclass='nobr'>The example<\/span> we'll use throughout this article is adding these three fields to track co-artists of <span\nclass='nobr'>a modeling<\/span> shoot:<\/p>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin01.png\" width=\"350\" height=\"287\"\nclass=\"raw\"\nid=\"iown_custom_plugin01\"\/>\n<div style='margin-top:10px'>three data fields we will add via\n<br\/>our example <span class='QO'>&#8220;<\/span>Modeling Info<span class='QC'>&#8221;<\/span> plugin\n<meta itemprop='about' content=\"three data fields we will add via our example &amp;#8220; Modeling Info &amp;#8221; plugin\"\/><\/div>\n<\/div>\n\n<p>Your plugin can have more or fewer fields, and of course you can make different plugins\nfor different sets of data.<\/p>\n\n<p>As I said, it's fairly simple to set up, but since it does involve editing\nprogram files, some things must be done exactly as described, so take care\nto follow instructions.<\/p>\n\n<p>The outline of the process:<\/p>\n\n<ol>\n<li>Create <span class='nobr'>a folder<\/span> (with <span class='nobr'>a special<\/span> name, as I'll describe) for the plugin.<\/li>\n<li>Add two starter files into the folder.<\/li>\n<li>Personalize the first file.<\/li>\n<li>Personalize the second file.<\/li>\n<li>Point Lightroom at your new plugin and start using it.<\/li>\n<li>(Optional) Create <span class='nobr'>a metadata<\/span>-view template to ease access your new data fields.<\/li>\n<\/ol>\n\n<p>Again, the process is pretty quick once you're used to it, but we'll go over the steps in detail below.<\/p>\n\n<div class=\"warning\">\n\n<p>Steps three and four involves editing program files, and in doing so you\nmust not use a <span class='QO'>&#8220;<\/span>document<span class='QC'>&#8221;<\/span> editor (e.g. Microsoft Word). Rather, you must use\n<span class='nobr'>a simple<\/span> <span class='QO'>&#8220;<\/span>text<span class='QC'>&#8221;<\/span> editor that adds no formatting or <span class='QO'>&#8220;<\/span>rich text<span class='QC'>&#8221;<\/span>.<\/p>\n\n<p>Under OSX you can use TextEdit, so long as you remain in <span class='QO'>&#8220;<\/span>Plain Text<span class='QC'>&#8221;<\/span> mode.<\/p>\n\n<p>Under Windows you can use Notepad.<\/p>\n\n<\/div>\n\n<p id='step1'><b>Step 1: Create the Plugin Folder<\/b><\/p>\n\n<p>You can take care of both this step and the next by downloading the starter sample plugin this article describes, <span\nclass='QO'>&#8220;<\/span><a href='\/modeling-info.lrplugin.zip'><tt>modeling-info.lrplugin.zip<\/tt><\/a><span\nclass='QC'>&#8221;<\/span>. After unzipping, you'll be left with <span class='nobr'>a folder<\/span> named <span\nclass='QO'>&#8220;<\/span><tt>modeling-info.lrplugin<\/tt><span class='QC'>&#8221;<\/span>. Move it to wherever on your system you\nwant your plugin to reside.<\/p>\n\n<p>(Don't make the mistake to double-click on the folder, as it'll invoke some copy of Lightroom &mdash; on my system, it\ninexplicably brings up <span class='nobr'>Lightroom 3!<\/span> &mdash; after which it brings up the Import Dialog to try to bring non-existent photos from\nthe plugin into Lightroom.)<\/p>\n\n<p>Or, manually create a folder somewhere on your system where you want your plugin files to reside, naming the folder so that it\nends with <span style='nobr'><span class='QO'>&#8220;<\/span><tt>.lrplugin<\/tt><span class='QC'>&#8221;<\/span>.<\/span> The example\nplugin uses the name <span class='QO'>&#8220;<\/span><tt>modeling-info.lrplugin<\/tt><span class='QC'>&#8221;<\/span>, but other\nexample names might include <span style='nobr'><span class='QO'>&#8220;<\/span><tt>My Archive Data.lrplugin<\/tt><span\nclass='QC'>&#8221;<\/span><\/span> or <span style='nobr'><span class='QO'>&#8220;<\/span><tt>Extra Fields.lrplugin<\/tt><span\nclass='QC'>&#8221;<\/span>.<\/span><\/p>\n\n<p>Choose <span class='nobr'>a name<\/span> that means something to you and your use of the data;\nthe name doesn't matter too much to Lightroom, so long as it ends with <span class='QO'>&#8220;<\/span><tt>.lrplugin<\/tt><span\nclass='QC'>&#8221;<\/span>.<\/p>\n\n<p>We'll refer to this as your <span class='QO'>&#8220;<\/span>plugin folder<span class='QC'>&#8221;<\/span>; as mentioned above,\nour example plugin folder is <span class='QO'>&#8220;<\/span><tt>modeling-info.lrplugin<\/tt><span class='QC'>&#8221;<\/span>.<\/p>\n\n<p style='margin-top:50px; margin-bottom:0'><b>Mac-Only Note:<\/b><\/p>\n<div style='border-left: solid 5px gray; padding-left:1em'>\n\n\n<p style='margin-top:10px'>OSX treats <span class='nobr'>a folder<\/span> with this kind of name specially, as <span class='nobr'>a\nsingle<\/span> <span class='QO'>&#8220;<\/span>package<span class='QC'>&#8221;<\/span> rather than <span class='nobr'>a\ncollection<\/span> of files, but for the next couple of steps we'll want to get inside so we can edit individual files. <span\nclass='nobr'>To do this<\/span>, in Finder we invoke the <span class='QO'>&#8220;<\/span>Show Package Contents<span\nclass='QC'>&#8221;<\/span> menu item...<\/p>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin02.png\" width=\"600\" height=\"311\"\nclass=\"raw\"\nid=\"iown_custom_plugin02\"\/><\/div>\n\n<p>This puts us inside our plugin folder. It'll have two files in it already if this is the sample downloaded from my site, but if\nyou created it manually you'll be presented with the empty folder:<\/p>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin03.png\" width=\"600\" height=\"249\"\nclass=\"raw\"\nid=\"iown_custom_plugin03\"\/><\/div>\n\n<\/div>\n\n\n<p style='margin-top:50px' id='step2'><b>Step 2: Copy In Starter Files<\/b><\/p>\n\n<p>If you're not using the sample download, then you'll need to create two text files within your plugin folder, one named <span\nclass='QO'>&#8220;<\/span><tt>Info.lua<\/tt><span class='QC'>&#8221;<\/span>, and the other named <span\nclass='QO'>&#8220;<\/span><tt>CustomMetadata.lua<\/tt><span class='QC'>&#8221;<\/span>. <span class='nobr'>You can copy<\/span> them from <span class='nobr'>the\nsample download<\/span> or just copy\/paste their contents from below.<\/p>\n\n<p style='margin-top:50px' id='step3'><b>Step 3: Personalize the <span class='QO'>&#8220;<\/span>Info.lua<span class='QC'>&#8221;<\/span> File<\/b><\/p>\n\n<p>The starter <span class='QO'>&#8220;<\/span><tt>Info.lua<\/tt><span class='QC'>&#8221;<\/span> file looks something like this:<\/p>\n\n<style type=\"text\/css\">\nspan.mustchange { color: red; font-style:italic }\nspan.canchange { color: yellow; font-style:italic }\npre.snippet {\n    border: dotted 1px #CCC;\n    margin-left: 1em;\n    border-left: 10px solid #888;\n    padding-left: 1em;\n    padding-top: 13px;\n    padding-bottom: 13px;\n}\n<\/style>\n\n\n<pre class='snippet'>\nreturn {\n   LrPluginName        = \"<span class='mustchange'>Modeling Info<\/span>\",\n   LrToolkitIdentifier = \"<span class='mustchange'>jeff.friedl.modeling<\/span>\",\n   LrSdkVersion        = 2,\n   LrMetadataProvider  = 'CustomMetadata.lua',\n}\n<\/pre>\n\n<p>The parts shown in red should be edited to your taste using <span class='nobr'>a raw-text<\/span> editor (like Notepad or TextEdit).\nDon't change anything else... these are program files, so every little bit of punctuation matters.<\/p>\n\n<p>The first bit of text to change (<span class='QO'>&#8220;<\/span><tt><span class='mustchange'>Modeling Info<\/span><\/tt><span\nclass='QC'>&#8221;<\/span>) is the name Lightroom should display when referencing this plugin in its UI. <span class='nobr'>It's\nprimarly<\/span> used in the plugin manager. <span class='nobr'>Put something<\/span> here that's meaningful for you. <span\nclass='nobr'>It's best if<\/span> it's short enough to display without being truncated, so <span class='QO'>&#8220;<\/span>Modeling\nInfo<span class='QC'>&#8221;<\/span> is better than, for example, <span class='QO'>&#8220;<\/span>Extra metadata fields to help me\ntrack modeling sessions<span class='QC'>&#8221;<\/span>.<\/p>\n\n<p>Regardless of what name you choose now, you can always return to this\nfile to update this name later, if you like. <span class='nobr'>It's used only<\/span> as <span class='nobr'>a display<\/span>\nlabel.<\/p>\n\n<p>The second item that must be changed, the <span class='QO'>&#8220;<\/span>plugin identifier<span class='QC'>&#8221;<\/span> (shown\nabove as <span class='QO'>&#8220;<\/span><tt><span class='mustchange'>my.custom.modeling<\/span><\/tt><span class='QC'>&#8221;<\/span>), is\nextremly important: it's <i>the<\/i> key identifier used by Lightroom behind the scenes\nto tie your plugin to your catalog, and each photo to its extra data.<\/p>\n\n<p>You must pick something that's unique to this plugin (that is, something not used by any other plugin that you might ever use),\nand once you pick it and start using the plugin, it can not be changed.<\/p>\n\n<p>It's standard practice to combine something with your name (of yourself\nor your business) and something about this particular plugin. <span class='nobr'>It's standard<\/span> practice to use <span class='nobr'>a period<\/span> instead of spaces.<\/p>\n\n<p>For example, if you're <span class='QO'>&#8220;<\/span>Bob's Photo Studio<span class='QC'>&#8221;<\/span> and you make one plugin to\nhandle modeling data, and another plugin to handle archive data, you might\nuse <span class='QO'>&#8220;<\/span><tt>bobs.photo.studio.modeling<\/tt><span class='QC'>&#8221;<\/span> for one plugin's identifier, and\n<span class='QO'>&#8220;<\/span><tt>bobs.photo.studio.archive.data<\/tt><span class='QC'>&#8221;<\/span> for the other's.<\/p>\n\n<p>Remember that all editing must be done as plain, bland, un-rich raw text. In particular,\nmake sure not to use <span class='QO'>&#8220;<\/span>smart<span class='QC'>&#8221;<\/span> quotes... <\/p>\n<div style='margin-left:3em'>\n<tt><span class='QO'>&#8220;<\/span>Modeling Info<span class='QC'>&#8221;<\/span><\/tt> <span style='color:#888'>\u2190 <i>this will fail<\/i><\/span>\n<br\/><tt>&#34;Modeling Info&#34;<\/tt> <span style='color:#888'>\u2190 <i>this is correct<\/i><\/span>\n<\/div>\n\n<p>Take a careful look at the punctuation above. <span class='nobr'>See the difference<\/span>?<\/p>\n\n<p>Once you've picked the plugin label and internal identifier, save the file and move on to the other.<\/p>\n\n<p style='margin-top:50px' id='step4'><b>Step 4: Personalize the <span class='QO'>&#8220;<\/span>CustomMetadata.lua<span class='QC'>&#8221;<\/span> File<\/b><\/p>\n\n<p>The other file contains your list of extra metadata fields that\nthe plugin makes avaialble to each photo.<\/p>\n\n<p>The starter file is the example defining our three modeling fields:<\/p>\n\n<style type=\"text\/css\">\n  span.comment { font-size: 90% ; color:gray; font-family: arial}\n<\/style>\n<pre class='snippet'>\nreturn {\n schemaVersion = <span class='canchange'>1<\/span>, -- <span class='comment'><i>increment this value any time you make a change to the field definitions below<\/i><\/span>\n\n metadataFieldsForPhotos = {\n  -- <span class='comment'><i>You can have as many fields as you like (the example below shows three)... just make sure each 'id' and 'title' are unique.<\/i><\/span>\n  -- <span class='comment'><i>Set \"searchable\" to true to allow as a search criteria in smart collections.<\/i><\/span>\n  -- <span class='comment'><i>If both \"searchable\" and \"browsable\" are true, the field shows up under \"Metadata\" in Library's grid filter.<\/i><\/span>\n  { dataType=\"string\", searchable=<span class=\"canchange\">false<\/span>, browsable=<span class=\"canchange\">false<\/span>, id=\"<span class=\"mustchange\">field1<\/span>\", title=\"<span class=\"mustchange\">Makeup Artist<\/span>\" },\n  { dataType=\"string\", searchable=<span class=\"canchange\">false<\/span>, browsable=<span class=\"canchange\">false<\/span>, id=\"<span class=\"mustchange\">field2<\/span>\", title=\"<span class=\"mustchange\">Wardrobe<\/span>\"      },\n  { dataType=\"string\", searchable=<span class=\"canchange\">false<\/span>, browsable=<span class=\"canchange\">false<\/span>, id=\"<span class=\"mustchange\">field3<\/span>\", title=\"<span class=\"mustchange\">Hair Stylist<\/span>\"  },\n }\n}\n<\/pre>\n\n<p>This sample defines three data fields, so the first thing you'll want to do is update it to define the number of fields you\nactually want. <span class='nobr'>If you need<\/span> less than three, delete the extra <span class='QO'>&#8220;<\/span><tt>{ dataType<\/tt>...<span\nclass='QC'>&#8221;<\/span> lines. <span class='nobr'>If you need<\/span> more than three, replicate one of the lines until you have as many such lines as\nfields you want.<\/p>\n\n<p>The <span class='QO'>&#8220;<\/span>title<span class='QC'>&#8221;<\/span> for each metadata field is the label that Lightroom\nuses when displaying the metadata field to the user. <span class='nobr'>You can use<\/span> most any descriptive text you like,\nthough shorter values have <span class='nobr'>a better<\/span> chance of fitting within Lightroom's cramped UI.<\/p>\n\n<p>The <span class='QO'>&#8220;<\/span>id<span class='QC'>&#8221;<\/span> is the internal key used by Lightroom to tie <span\nclass='nobr'>a photo<\/span> to its data for this field. The <span class='QO'>&#8220;<\/span>id<span class='QC'>&#8221;<\/span> value\nmust be unique for each field within this plugin (so take extra care if you replicated lines to fill out the number of fields you\nneeded; in doing so you also replicated the title and id, and while you probably <i>want<\/i> to update the title, the id\n<i>must<\/i> be changed).<\/p>\n\n<p>For the ids, <span class='nobr'>you can simply<\/span> use\n<span class='QO'>&#8220;<\/span><tt>field1<\/tt><span class='QC'>&#8221;<\/span>,\n<span class='QO'>&#8220;<\/span><tt>field2<\/tt><span class='QC'>&#8221;<\/span>, etc.,\nas is shown above, or pick short descriptive words such as\n<span class='QO'>&#8220;<\/span><tt>makeup<\/tt><span class='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span><tt>wardrobe<\/tt><span\nclass='QC'>&#8221;<\/span>, <span class='QO'>&#8220;<\/span><tt>hair<\/tt><span class='QC'>&#8221;<\/span>.\nIt doesn't matter too much to Lightroom so long as there are no repeats,\nbut <a href='#access'>as illustrated here<\/a>, there's <span class='nobr'>a benefit<\/span> to using descriptive ids over <span class='nobr'>a simple<\/span>\n<span class='QO'>&#8220;<\/span><tt>field1<\/tt><span class='QC'>&#8221;<\/span> enumeration.<\/p>\n\n<p>(Note: the plugin identifier in the <tt>Info.lua<\/tt> file that we edited first must be unique across all plugins, but the\nfield ids in this file need be unique only within this particular plugin.)<\/p>\n\n\n<p style='margin-top:40px'>You can turn on some options for how the fields work in Lightroom by updating the text shown in yellow\nabove...<\/p>\n\n<p>If you want a particular data field to be usable within smart-collection criteria, change the <span\nclass='QO'>&#8220;<\/span><tt>false<\/tt><span class='QC'>&#8221;<\/span> after <span class='QO'>&#8220;<\/span>searchable=<span\nclass='QC'>&#8221;<\/span> to <span class='QO'>&#8220;<\/span><tt>true<\/tt><span class='QC'>&#8221;<\/span>.<\/p>\n\n<p>If you want the field to appear in the Library Grid Filter, change <b>both<\/b> <span class='QO'>&#8220;<\/span><tt>false<\/tt><span\nclass='QC'>&#8221;<\/span> on the field's line to <span class='QO'>&#8220;<\/span><tt>true<\/tt><span class='QC'>&#8221;<\/span>.<\/p>\n\n<p style='margin-top:40px'>If, after you've started to use the plugin, you need to return to this file to add or remove fields, or\nmake any other change (e.g. toggling a <span class='QO'>&#8220;<\/span><tt>true<\/tt><span class='QC'>&#8221;<\/span> to <span\nclass='QO'>&#8220;<\/span><tt>false<\/tt><span class='QC'>&#8221;<\/span> or vice-versa), increment (add one to) the <span\nclass='QO'>&#8220;<\/span>schemaVersion<span class='QC'>&#8221;<\/span> value.<\/p>\n\n<p style='margin-top:50px' id='step5'><b>Step 5: Point Lightroom to your Plugin<\/b><\/p>\n\n<p>Now you install the plugin just like any other: visit the plugin manager, use the <span class='QO'>&#8220;<\/span>Add<span\nclass='QC'>&#8221;<\/span> button, and navigate to the <span class='QO'>&#8220;<\/span><tt>.lrplugin<\/tt><span\nclass='QC'>&#8221;<\/span> folder you created in Step 1.<\/p>\n\n<p>Now back in the Library Module, your new fields should appear in the Metatdata panel when you choose the <span class='QO'>&#8220;<\/span>All Plugin Metadata<span class='QC'>&#8221;<\/span>\nviewing preset:<\/p>\n\n<table align='center'>\n<tr valign='top'>\n <td align='center'>\n   <img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin04.png\" width=\"300\" height=\"162\"\nclass=\"raw\"\nid=\"iown_custom_plugin04\"\/>\n   <div style='margin-top:10px'>1) click here to select <span class='nobr'>a new<\/span> view<\/div>\n <\/td>\n<td width='50'><\/td>\n <td align='center'>\n   <img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin05.png\" width=\"300\" height=\"306\"\nclass=\"raw\"\nid=\"iown_custom_plugin05\"\/>\n   <div style='margin-top:10px'>2) select <span class='QO'>&#8220;<\/span>All Plugin Metadata<span class='QC'>&#8221;<\/span><\/div>\n <\/td>\n<\/tr>\n<\/table>\n\n<p style='margin-top:30px'>And voil\u00e0, the three fields show up, empty and waiting to be filled in as appropriate for each photo:<\/p>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin01.png\" width=\"350\" height=\"287\"\nclass=\"raw\"\nid=\"iown_custom_plugin01b\"\/>\n<\/div>\n\n<p id='step6'><b>Step 6: (Opgtional) Metadata Viewer Preset<\/b><\/p>\n\n<p>The need to switch to the <span class='QO'>&#8220;<\/span>All Plugin Metadata<span class='QC'>&#8221;<\/span> view preset, as we did in the last step, can be inconvenient when you want\naccess to both your new fields and other traditional metadata fields like capture date and photo title.<\/p>\n\n<p>However, using <a href='\/blog\/lightroom-goodies\/metadata-presets'>my Metadata-Viewer Preset Editor plugin<\/a>,\nyou can create your own <span class='QO'>&#8220;<\/span>view<span class='QC'>&#8221;<\/span> of photo data, so that you see whatever fields you like (including the new ones you just added), in\nwhatever order you like.<\/p>\n\n<p>When using that plugin to create your own custom view, look for the <span class='QO'>&#8220;<\/span>import fields from plugin<span class='QC'>&#8221;<\/span> button\nat the bottom. That'll make your custom fields available in that plugin.<\/p>\n\n\n<p id='access'><b>Accessing Your Custom Fields<\/b><\/p>\n\n<p>The data you add to each photo in your custom fields is kept in your Lightroom catalog, and nowhere else. <span\nclass='nobr'>It's not saved<\/span> in XMP sidecars, nor is it added to exported copies of photos.<\/p>\n\n<p>However, you can have your custom data stuffed into certain standard metadata fields of exported copies,\nusing <a href='\/blog\/lightroom-goodies\/metadata-wrangler'>my Metadata Wrangler plugin<\/a>. <span class='nobr'>It may seem<\/span> <span class='nobr'>a bit<\/span> cryptic, especially if you're not used to\n<a href='\/blog\/lightroom-goodies\/template'>the template tokens<\/a> that many of my plugins understand,\nbut here's an example showing the wardrobe-artist data being inserted into the caption of an exported image copy:<\/p>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin06.png\" width=\"600\" height=\"253\"\nclass=\"raw\"\nid=\"iown_custom_plugin06\"\/>\n<br\/>screenshot of the Metadata Wrangler as part of an export\n<meta itemprop='about' content=\"screenshot of the Metadata Wrangler as part of an export\"\/><\/div>\n\n<p>Both the plugin id (from the <tt>Info.lua<\/tt> file) and the field id\n(from <tt>CustomMetadata.lua<\/tt>) are needed to reference the specific metadata field,\ntied together with an extra dot (period) character.\nHere's <span class='nobr'>a breakdown<\/span> on constructing <span class='nobr'>a reference<\/span> to <span class='nobr'>a custom<\/span> plugin field:<\/p>\n\n<style type=\"text\/css\">\ntable#token { font-size: 150% }\ntable#token div.note { margin-top: 3px; border-top: 1px dotted red; text-align:center; font-size:70% }\ntable#token span.g { color: gray }\n.bracket { color: white }\n<\/style>\n\n<table align='center' id='token' cellspacing='0' cellpadding='0'><tr valign='baseline'>\n<td><tt><span class='bracket'>{<\/span>PluginProperty=<\/tt><\/td>\n<td><span class='g'>jeff<tt>.<\/tt>friedl<tt>.<\/tt>modeling<\/span><div class='note'>plugin id<\/div><\/td>\n<td><tt class='bracket'>.<\/tt><br\/><span style='color:#8F8'>\u2191<\/span><\/td>\n<td><span class='g'>field2<\/span><div class='note' style='border-color:yellow'>field id<\/div><\/td>\n<td><tt class='bracket'>}<\/tt><\/td>\n<\/tr>\n<\/table>\n\n<p>Notice the extra period (marked with <span class='nobr'>a green<\/span> arrow) tying together the plugin id and the field id? Don't forget that, and don't\nlet any extra spaces creep in. Also don't forget to wrap the whole reference in curly brackets.<\/p>\n\n<p>References from afar like this are one reason to choose <span class='nobr'>a descriptive<\/span> plugin id, and descriptive\nfield ids. The <span class='QO'>&#8220;<\/span><tt>field2<\/tt><span class='QC'>&#8221;<\/span> field id seen in this example is <span class='nobr'>a lot<\/span> less enlightening than\nthe <span class='QO'>&#8220;<\/span><tt>wardrobe<\/tt><span class='QC'>&#8221;<\/span> alternate suggestion.<\/p>\n\n<p style='margin-top:60px'>You can also shuffle data around within the catalog with the <span class='QO'>&#8220;<\/span>Write Data Field<span class='QC'>&#8221;<\/span> feature of\n<a href='\/blog\/lightroom-goodies\/bag-o-goodies'>my Bag of Goodies plugin<\/a>. Here's <span class='nobr'>a screenshot<\/span>\nshowing Lightroom's <span class='QO'>&#8220;<\/span>Caption<span class='QC'>&#8221;<\/span> field about to be filled with text that includes data from <span class='nobr'>a custom<\/span> plugin field:<\/p>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin07.png\" width=\"600\" height=\"170\"\nclass=\"raw\"\nid=\"iown_custom_plugin07\"\/>\n<\/div>\n\n<p>This might be useful in special cases, but <span class='nobr'>I don't<\/span> think it's all that useful for most workflows because the data movement\nhappens only when you ask for it, as opposed to the Metadata-Wrangler example above that you can set up once (in <span class='nobr'>a Publish<\/span> Service\nor in an Export preset) to have happen automatically from then on.<\/p>\n\n\n<p style='margin-top:60px' id='delete'><b>Cleaning Custom Data from your Catalog<\/b><\/p>\n\n<p>If you've been using a custom plugin to add custom fields that you no longer need, and you want to reclaim the space in your\ncatalog database file, you can't just delete the plugin to have the plugin's data removed. This is <span class='nobr'>a good<\/span> thing,\nbecause you certainly don't want to lose valuable plugin data just because you accidentally deleted <span class='nobr'>a plugin<\/span> file.<\/p>\n\n<p>The only way I know to actually delete all the data from the catalog is to select all photos in Grid mode,\nthen clear out the data by selecting and deleting the <span class='QO'>&#8220;<\/span><tt>&lt;&nbsp;mixed&nbsp;&gt;<\/tt><span class='QC'>&#8221;<\/span> value shown in the data field.<\/p>\n\n<div class='ic tight'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin08.png\" width=\"300\" height=\"138\"\nclass=\"raw\"\nid=\"iown_custom_plugin08\"\/>\n<\/div>\n\n<div class='img_right' style='margin-top:0; padding:0'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin10.png\" width=\"250\" height=\"383\"\nclass=\"raw\"\nid=\"iown_custom_plugin10\"\/><\/div>\n\n<p>A few caveats:<\/p>\n\n<p>After selecting <span class='QO'>&#8220;<\/span>All Photographs<span class='QC'>&#8221;<\/span> (as seen at right) while in Library Grid mode,\nmerely selecting all images (Command\/Control-A) isn't necessarily sufficient.<\/p>\n\n<p>First of all, you have to make sure that the Grid Filters are turned off...\ntap Command\/Control-L to toggle them off. (If they had been off, you'll see <span class='nobr'>a brief<\/span>\n<span class='QO'>&#8220;<\/span>Library Filters On<span class='QC'>&#8221;<\/span> message, in which case you'll want to re-tap Command\/Control-L to\nturn them back off.)<\/p>\n\n<p>You'll want to re-select all after turning off the filters, then to make sure that nothing is hidden within <span class='nobr'>a closed<\/span> stack,\ninvoke <span class='nobr'><span class='QO'>&#8220;<\/span>Photo &gt; Stacking &gt; Expand All Stacks<span class='QC'>&#8221;<\/span><\/span>. Then again <span class='QO'>&#8220;<\/span>select all<span class='QC'>&#8221;<\/span> one last time.<\/p>\n\n<p>Now, before selecting one of the fields to update, make sure that the spinning <span class='QO'>&#8220;<\/span>metadata busy<span class='QC'>&#8221;<\/span> icon is not present. <span class='nobr'>It looks<\/span> like this:<\/p>\n\n<div class='ic'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/lr\/own-custom-plugin09.png\" width=\"500\" height=\"173\"\nclass=\"raw\"\nid=\"iown_custom_plugin09\"\/>\n<\/div>\n\n<p>This is an area of Lightroom's UI that <span class='nobr'>I think<\/span> is <i>horrible<\/i>, so you've got to be careful. When that icon is spinning,\nLightroom <i>might<\/i> ignore anything you type into <span class='nobr'>a text<\/span>-input field, or it might treat it as keyboard shortcuts\ninstead of text to be entered. <span class='nobr'>It's all too<\/span> easy to destroy lots about your images when working with many of them\nand typing the wrong thing at what for parts of Lightroom is the wrong time.<\/p>\n\n<p>So, wait until the spinning icon goes away.  Then select the first data field and delete the\n<span class='QO'>&#8220;<\/span><tt>&lt;&nbsp;mixed&nbsp;&gt;<\/tt><span class='QC'>&#8221;<\/span> placeholder value. <i>Then wait again<\/i> until the spinning icon\nis no more. Repeat for all your fields.<\/p>\n\n<p>Then you can remove the plugin from Lightroom.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Lightroom allows for a variety of metadata for each photo or video... capture date, caption, keywords, etc., and plugins can add further, custom fields, but sometimes what's offered by Lightroom or existing plugins just doesn't fulfill one's own specific needs. Luckily, it's actually fairly easy to make your very own Lightroom plugin to add your own metadata fields. In this post, I'll show you how.<\/p> <p>It's fairly quick and simple. It will take far longer to read this post about how to do it than it takes to actually do it.<\/p> <p>The kind of fields we can add this way [...]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,4],"tags":[],"_links":{"self":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts\/2731"}],"collection":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/comments?post=2731"}],"version-history":[{"count":0,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts\/2731\/revisions"}],"wp:attachment":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/media?parent=2731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/categories?post=2731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/tags?post=2731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}