When I export from Lightroom to MC, I export to a folder that MC 'watches' so that the exported files are automatically imported. Is this how you do it? Yes, I do it that way
For exported files already in your library, you would need to update manually. For future automatic imports, you can set up 'tag on import' rules that will do this automatically for you. Instructions for both procedures are outlined below.
Are you familiar with adding fields to your MC library? Yes, I have added a couple of calculated fields
Excellent. To get up and running, you will need to add a couple of fields. Details are outlined below.
Do you want separate "Keywords" and "Lightroom Heirarchy" fields? Not necessarily. If the hierarchy can be automagically converted to nested keywords great. I assumed it would be a two pass process.
You can get to nested MC keywords in one pass. I've played quite a bit with it now. Results are excellent.
When you export, do you have the Lightroom metadata export option to "write keywords as Lightroom heirarchy" checked?. Yes, I do. I have checked the metadata in the exported photos and the hierarchies are correct
Yup. I have tested this both ways, and as well as the export heirarchy option being checked, all levels of the Lightroom heirarchy also need to be set to "include on export" and "Export containing keywords"
The steps below might take longer to read than to actually set up. I went a bit verbose to try and be clear for everyone who might be interested here. I also think it's important that, rather than just following a set of instructions, people understand exactly what they're asking MC to do with this setup.
Basically, all the ramble below arrives at is the addition of two library fields and a couple of 'tag on import' rules.
OK, so here we go with the how and a little bit of "why" where necessary.
1. Make two new library fields. I called them Lightroom and Lightroom to Keywords.
1a. [Lightroom]
When adding this, name it Lightroom, and if you are as OCD as me, set the 'Plural' to be Lightroom too, as "Lightrooms" is just not right!
1b. [Lightroom to Keywords]
This will be a calculated field. The expression will be, simply,
=[Keywords]. If copying and pasting, take
all the red text.
Make sure you can see these fields, and the keywords field, in your tag window. You will notice that if a file has existing keywords data, this is reflected in the "Lightroom to Keywords" field also. For now, do
not try and edit the "Lightroom to Keywords" field. Read the "Why" section below first.
In step 2, we will set up the "Tag on import" rules, but before we do that, you must read, and understand, the following. If anything is not clear, either ask, or proceed with caution and use test files so you can see what's happening. After reading and understanding, you will be well placed to make your choice about how you want to proceed.
The "Why"Before setting up auto import rules, we need to think about some things.
From Lightroom:From my limited and recent testing, I have found that, when using a keyword heirarchy in Lightroom, the exported IPTC keywords (which MC reads by default) written by Lightroom are really just a jumbled mess of all the heirarchy headings, and their base keywords, in alphabetical order. I found this both distracting and disappointing. However, if, when exporting, you have the metadata option to "write keywords as Lightroom heirarchy" checked, then we get a nice "HierarchicalSubject" data block in the XMP tag that retains the keyword tree as it is displayed in Lightroom. In my limited testing, I found that sometimes, this heirarchy data was not present in XMP, but, with the export option checked, it has always been there.
MC can now read that data.
This might change in the future, but, for now, it can only read this data if the user specifically asks for it.
We can do this manually after importing the files into MC, or we can set up "Tag on import" rules to have the data read automatically at the time of importing.
We need to think about where we want this data stored, and whether or not we want it imported automatically when MC imports the files.
We could...
a. import to a field set up to exclusively receive and display this data.
b. import to MC's default 'Keywords' field.
c. both of the above.
"a" is a bit of a no-brainer, and it's why we created the "Lightroom" field earlier.
"b" needs more thought...
Auto import will
not over write the contents of list type fields, it will only append to existing data. However, we
can work around this limitation.
In my experience, the files exported from Lightroom using a keyword heirarchy have a complete mess of keywords (maybe I'm not using it correctly or optimally?), and having the heirarchy appended, means everything is now duplicated in the keywords field, albeit with one set of duplicates neatly organised in a tree. I want the heirarchy tree to
replace the existing keywords data, in a way that MC can interpret, and so display the tree in the keywords pane,
but, only if Lightroom heirarchy data exists. This is why we created the "Lightroom to Keywords" field earlier, and now, I'll explain that in more detail...
Lightroom to Keywords:We set this field as a calculated field.
You should see that if you have existing Keywords data, it is reflected in this new field we created using the simple expression =[Keywords].
The cleverness comes from the fact that if you edit the contents of this field, your edits will propogate on to the real Keywords field. Yes, it works in reverse too, which is very handy.
Knowing this, our options are becoming clearer.
Either manually or automatically, we can bring the Lightroom data into the "Lightroom" field.
Either manually or automatically, we can bring the Lightroom data into the "Lightroom to Keywords" field, which in turn
replaces any existing "Keywords" data with the "Lightroom" data.
Have a think. Something to consider here is that the assumption is made that we are dealing with files you exported personally and so are familiar with the contained metadata. If you also import images from unknown third parties, it's possible that these could potentially contain differring IPTC keywords and Lightroom heirarchy data which could, depending on your choices, cause the IPTC keywords to be replaced by the Lightroom heirarchy. Make your choice, and read on through "2"....
2. Importing the Lightroom heirarchy data into the MC library:
2a: Manually:Manually is a pain, but also a necessary one if you have previously imported files that you know contain Lightroom heirarchy data and you want to get it out of files and into your library.
You could, of course, forgo the exclusive "Lightroom" library field if you wanted, but personally, despite forcing my data into "Keywords", I've kept the exclusive field too. It's not going to do any harm, and makes auto import a little easier to follow. When copying the expressions, be sure to catch
all of the red text.
Manual import of Lightroom heirarchy:In the tag window, click on the Lightroom field to open it for editing and enter the following expression:
=replace(Tag(XMP: HierarchicalSubject),|,\)Lightroom uses a pipe "|" to define the heirarchy levels.
MC uses a back slash "\" to define its heirarchy levels.
The expression imports the heirarchy data, replacing the pipes with back slashes.
Go to a view that contains your image files, and add the "Lightroom" pane to it to see the Lightroom heirarchy reproduced in your MC library.
Manual replacement of existing Keywords data with Lightroom heirarchy:Assuming you have the "Lightroom" field above:
In the tag window, click on the "Lightroom to Keywords" field to open it for editing and enter the following expression:
=[Lightroom]If you don't want the Lightroom field at all, and want to pass directly to Keywords, enter the following expression instead:
=replace(Tag(XMP: HierarchicalSubject),|,\)Manually appending Lightroom heirarchy to existing Keywords data:Assuming you have the "Lightroom" field above:
In the tag window, click on the "Lightroom to Keywords" field to open it for editing and enter the following expression:
=[keywords];[Lightroom]If you don't want the Lightroom field at all, and want to pass directly to Keywords, enter the following expression instead:
=[keywords];replace(Tag(XMP: HierarchicalSubject),|,\)2b: The magic of "Tag on Import":"Tag on Import" is a wonderful MC feature. Using it, we can automate all or any of the above manual steps.
Open MC's options (press ctrl+o), type auto-import into the search field at the bottom, and click on "Configure auto-import"
Find your "Pictures" folder in the list, or add the folder you export to if it is not listed. Select it, and press the "Edit" button.
In the lower section, titled "Apply these tags (optional)", we add the rules we want.
The order is very important here.The first thing we will do is bring the data into the Lightroom field.
Click the "Add" button.
Pick "Lightroom" from the list of fields at the top.
Enter the following expression into the "Value" field:
=replace(Tag(XMP: HierarchicalSubject),|,\)Press "OK"
Next, we want to replace any existing keywords with this Lightroom data, but,
only if there is Lightroom data to replace it with. If we run this, and there is no Lightroom data, we will only succeed in deleting all existing keywords data, and we don't want to do that, so we test for it first. If there is no Lightroom data, do nothing, otherwise, replace the keywords.
Press the "Add" button again, and this time, choose "Lightroom to Keywords" from the list of fields.
Enter the following expression into the "Value" field:
if(isempty([Lightroom,0]),[keywords,0],replace(Tag(XMP: HierarchicalSubject),|,\))Make sure that "Skip for files that already have a value in this field" is not checked.
OK your way all the way out, export some files from Lightroom for MC to auto-import and let me know if I missed anything.
I've read this over at least three times and I
think it's complete. If it's what you want, you should now know what you're doing, and why you're doing it.
If it doesn't work, it will be because one of us missed something. Just reply here and we'll figure it out. It does appear to work, I have it working a treat here, and have tried to break it in many different ways, without success.
Replacing one set of data with another always makes people nervous. Using these steps, the only time I can see 'accidental' data loss is if importing images from a third party source that contain unexpected Lightroom heirarchy data. If I missed any other possibilities, please let me know so that I can review the instructions above.If you would like to learn more about expressions and their possibilities, there are pages of info and examples
on the wiki.
Hope that helps a bit,
-marko