Adobe 65007312 Programming Guide - Page 44

Declaring export post-process actions, Export

Page 44 highlights

CHAPTER 3: Creating Export and Publish Services Adding an export post-process action 44 user clicks Export. In this case, the request is intercepted and redirected to Color. Color receives a list of renditions that it is expected to satisfy; the action then makes its own rendition request. This request is similarly intercepted and sent to MyAction. MyAction performs the actual processing and makes its own request for renditions. When there are no more actions, the requests are satisfied directly by Lightroom using LrExportRendition. Each action runs in its own task in Lightroom (see "Defining function contexts and tasks" on page 20), which means that the operations performed by each action can be performed in parallel. An action task first requests its renditions, then iterates through them making its transformations as appropriate. When the action is done rendering each photo, it signals the downstream task which can then process the rendered photo. For a more detailed description of the processing path, see "How post-process actions are executed" on page 47. Declaring export post-process actions In the Info.lua file for a plug-in that defines an export post-process action, you must set LrSdkVersion = 2.0 (or higher) in order for your filters to be recognized. If you set LrSdkMinimumVersion = 1.3, the plug-in can be loaded in Lightroom 1.3, but the post-process actions are ignored. To declare one or more post-process actions, add the following block to your Info.lua file: LrExportFilterProvider = { title = "Filter Name", -- this display string appears in the dialog file = "MyExportFilterProvider.lua", -- the action definition script id = "myFilter", -- a unique identifier for the action requiresFilter = "mainFilter" -- optional }, There can be one or many action definitions. Each definition is a table with up to four items: X title (string): The localizable display name of the action, which appears in the Post-Process Actions section of the Export dialog. X file (string): The name of the Lua file (action definition script) that provides more information about the action. The script is executed when the export operation is started; that is, when the user clicks Export in the Export dialog. X id (string): An identifying string for this action, unique within this plug-in. Required if more than one action is defined in one plug-in. X requiresFilter (string): Optional, the identifier for the action that performs the processing. For example, this defines three distinct actions, and the first is the one that actually performs the processing. It must be present before either of the other two can run; they simply set parameters to be used by the main action: LrExportFilterProvider = { { title = "MyAction", file = "myAction.lua", id = "main", }, { title = "Color", file = "colorAction.lua", id = "color", requiresFilter = "main",

  • 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

C
HAPTER
3: Creating Export and Publish Services
Adding an export post-process action
44
user clicks
Export
. In this case, the request is intercepted and redirected to Color. Color receives a list of
renditions that it is expected to satisfy; the action then makes its own rendition request. This request is
similarly intercepted and sent to MyAction. MyAction performs the actual processing and makes its own
request for renditions. When there are no more actions, the requests are satisfied directly by Lightroom
using
LrExportRendition
.
Each action runs in its own task in Lightroom (see
“Defining function contexts and tasks” on page 20
),
which means that the operations performed by each action can be performed in parallel. An action task
first requests its renditions, then iterates through them making its transformations as appropriate. When
the action is done rendering each photo, it signals the downstream task which can then process the
rendered photo. For a more detailed description of the processing path, see
“How post-process actions are
executed” on page 47
.
Declaring export post-process actions
In the
Info.lua
file for a plug-in that defines an export post-process action, you must set
LrSdkVersion
= 2.0
(or higher) in order for your filters to be recognized. If you set
LrSdkMinimumVersion = 1.3
, the
plug-in can be loaded in Lightroom 1.3, but the post-process actions are ignored.
To declare one or more post-process actions, add the following block to your
Info.lua
file:
LrExportFilterProvider = {
title = "Filter Name",
-- this display string appears in the dialog
file = "MyExportFilterProvider.lua",
-- the action definition script
id = "myFilter", -- a unique identifier for the action
requiresFilter = "mainFilter" -- optional
},
There can be one or many action definitions. Each definition is a table with up to four items:
X
title
(string): The localizable display name of the action, which appears in the Post-Process Actions
section of the Export dialog.
X
file
(string): The name of the Lua file (
action definition script
) that provides more information about
the action. The script is executed when the export operation is started; that is, when the user clicks
Export in the Export dialog.
X
id
(string): An identifying string for this action, unique within this plug-in. Required if more than one
action is defined in one plug-in.
X
requiresFilter
(string): Optional, the identifier for the action that performs the processing.
For example, this defines three distinct actions, and the first is the one that actually performs the
processing. It must be present before either of the other two can run; they simply set parameters to be
used by the main action:
LrExportFilterProvider = {
{
title = "MyAction",
file = "myAction.lua",
id = "main",
},
{
title = "Color",
file = "colorAction.lua",
id = "color",
requiresFilter = "main",