Adobe 65007312 Programming Guide - Page 22

Writing a Lightroom Plug-in, Writing standard plug-ins for Lightroom

Page 22 highlights

2 Writing a Lightroom Plug-in The Lightroom SDK allows you to create plug-ins that customize the behavior of Lightroom in specific ways. Most types of plug-in share a common architecture, which is discussed in this chapter. X Web Gallery plug-ins use a different architecture; see Chapter 6, "Writing a Web-engine Plug-in." The Plug-in Manager dialog allows a user to load plug-ins from any location, enable and disable loaded plug-ins, and remove unused plug-ins. Your plug-in can customize the dialog by adding sections. See "Customizing plug-in load behavior" on page 30. Writing standard plug-ins for Lightroom The Lightroom SDK allows you to customize the behavior of Lightroom in specific ways using a standard plug-in (as opposed to a web-engine plug-in). The behavior implemented by your plug-in is provided by one or more Lua scripts. An information file installed in a standard plug-in folder identifies your plug-in scripts to Lightroom, and associates the plug-in with a unique name. X You can add items to the File, Library, or Help menus to start an operation. X Your plug-in can add a new export or publish destination with an Export Service Provider or Publish Service Provider. Such a service can also customize the Export or Publishing Manager dialog by adding and removing sections as appropriate for the destination when the user selects it. See "Creating an export or publish service" on page 35. X Your plug-in can intercept the export process with an Export Filter Provider, which can apply further processing to photos that the user has chosen to export. The post-process action that a filter defines is applied after Lightroom's initial rendering, and before the photos are sent to the final destination. Each filter can add a section to the Export dialog, in which the user can select options and set parameters. See "Adding an export post-process action" on page 41. X In addition to or instead of defining export customizations, your plug-in can define custom metadata fields for Lightroom. See Chapter 4, "Working with Metadata." Declaring the contents of a plug-in In addition to the Lua script or scripts that define your extension to Lightroom functionality, your plug-in must contain a file named Info.lua that describes the plug-in to Lightroom, using a Lua table of descriptive items. The table can or must include these items: LrSdkVersion LrSdkMinimumVersion Required The preferred version of the Lightroom SDK for this plug-in. Should be set to 3.0 for the current release; older plug-ins number may have a value of 1.3, 1.4, or 2.0. Optional number The minimum version of the SDK that this plug-in can use. If your plug-in works with Lightroom 2.0 but it also provides new features specific to Lightroom 3.0, set this value to 2.0 and LrSdkVersion to 3.0. Default is the value of LrSdkVersion. 22

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204

22
2
Writing a Lightroom Plug-in
The Lightroom SDK allows you to create plug-ins that customize the behavior of Lightroom in specific
ways. Most types of plug-in share a common architecture, which is discussed in this chapter.
X
Web Gallery plug-ins use a different architecture; see
Chapter 6, “Writing a Web-engine Plug-in
.”
The Plug-in Manager dialog allows a user to load plug-ins from any location, enable and disable loaded
plug-ins, and remove unused plug-ins. Your plug-in can customize the dialog by adding sections. See
“Customizing plug-in load behavior” on page 30
.
Writing standard plug-ins for Lightroom
The Lightroom SDK allows you to customize the behavior of Lightroom in specific ways using a standard
plug-in (as opposed to a web-engine plug-in). The behavior implemented by your plug-in is provided by
one or more Lua scripts. An information file installed in a standard plug-in folder identifies your plug-in
scripts to Lightroom, and associates the plug-in with a unique name.
X
You can add items to the File, Library, or Help menus to start an operation.
X
Your plug-in can add a new export or publish destination with an
Export Service Provider
or
Publish
Service Provider
. Such a service can also customize the Export or Publishing Manager dialog by adding
and removing sections as appropriate for the destination when the user selects it. See
“Creating an
export or publish service” on page 35
.
X
Your plug-in can intercept the export process with an
Export Filter Provider
, which can apply further
processing to photos that the user has chosen to export. The
post-process action
that a filter defines is
applied after Lightroom’s initial rendering, and before the photos are sent to the final destination. Each
filter can add a section to the Export dialog, in which the user can select options and set parameters.
See
“Adding an export post-process action” on page 41
.
X
In addition to or instead of defining export customizations, your plug-in can define custom metadata
fields for Lightroom. See
Chapter 4, “Working with Metadata
."
Declaring the contents of a plug-in
In addition to the Lua script or scripts that define your extension to Lightroom functionality, your plug-in
must contain a file named
Info.lua
that describes the plug-in to Lightroom, using a Lua table of
descriptive items. The table can or must include these items:
LrSdkVersion
Required
number
The preferred version of the Lightroom SDK for this plug-in.
Should be set to 3.0 for the current release; older plug-ins
may have a value of 1.3, 1.4, or 2.0.
LrSdkMinimumVersion
Optional
number
The minimum version of the SDK that this plug-in can use.
If your plug-in works with Lightroom 2.0 but it also
provides new features specific to Lightroom 3.0, set this
value to 2.0 and
LrSdkVersion
to 3.0. Default is the value
of
LrSdkVersion
.