Skip to main content
Participant
February 26, 2025
Answered

Does custom plugin metadata need to be defined in a LrMetadataProvider file?

  • February 26, 2025
  • 1 reply
  • 413 views

I am trying to use custom plugin-specific metadata on a per-photo basis. In the API reference for "setPropertyForPlugin" it states that metadata set using this function does not need to be declared anywhere. However, when I attempt to run a script I get an error that reads "attempt to access property that's not declared in Info.lua". Currently I do not have a metadata scheme defined nor a LrMetadataProvider file specified in my Info.lua file. I would like this metadata to only be viewable and editable from within the scope of my plugin. Did I misread the API reference stating that these metadata fields don't need to be declared? Do I need to specify my metadata id in an LrMetadataProvider file?

Correct answer johnrellis

"I am trying to use custom plugin-specific metadata on a per-photo basis."

 

catalog:setPropertyForPlugin() sets per-catalog custom fields, and as you read, they don't need to be declared.

 

But you want per-photo custom fields, for which you must use photo:setPropertyForPlugin(), and you have to declare them via Info.lua.

 

"I would like this metadata to only be viewable and editable from within the scope of my plugin."

 

Per-photo custom fields are viewable in the Metadata panel with the All Plug-in Metadata tagset, and any other plugin can read those fields as well.

1 reply

johnrellis
johnrellisCorrect answer
Legend
February 26, 2025

"I am trying to use custom plugin-specific metadata on a per-photo basis."

 

catalog:setPropertyForPlugin() sets per-catalog custom fields, and as you read, they don't need to be declared.

 

But you want per-photo custom fields, for which you must use photo:setPropertyForPlugin(), and you have to declare them via Info.lua.

 

"I would like this metadata to only be viewable and editable from within the scope of my plugin."

 

Per-photo custom fields are viewable in the Metadata panel with the All Plug-in Metadata tagset, and any other plugin can read those fields as well.

mp-reachAuthor
Participant
February 26, 2025

I see, thank you for the response. So to clarify, a field set with the photo:setPropertyForPlugin() function will be viewable by other plugins, but cannot be accessed or modified by other plugins. This being in contrast to the photo:setRawMetadata() function which would be viewable and editable by other plugins?

johnrellis
Legend
February 28, 2025

"a field set with the photo:setPropertyForPlugin() function will be viewable by other plugins, but cannot be accessed or modified by other plugins."

 

Correct.

 

"This being in contrast to the photo:setRawMetadata() function which would be viewable and editable by other plugins?"

 

Correct.