publish_plugins
AYONPyblishPluginMixin
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
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 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
|
convert_attribute_values(create_context, instance)
classmethod
Convert attribute values for instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
create_context | CreateContext | Create context. | required |
instance | CreatedInstance | Instance for which attributes are converted. | required |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
235 236 237 238 239 240 241 242 243 244 245 246 247 |
|
get_attr_defs_for_context(create_context)
classmethod
Publish attribute definitions for context.
Attributes available for all families in plugin's families
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
create_context | CreateContext | Create context. | required |
Returns:
Type | Description |
---|---|
list[AbstractAttrDef]: Attribute definitions for plugin. |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
get_attr_defs_for_instance(create_context, instance)
classmethod
Publish attribute definitions for an instance.
Attributes available for all families in plugin's families
attribute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
create_context | CreateContext | Create context. | required |
instance | CreatedInstance | Instance for which attributes are collected. | required |
Returns:
Type | Description |
---|---|
list[AbstractAttrDef]: Attribute definitions for plugin. |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
|
get_attr_values_from_data(data)
Get attribute values for attribute definitions from data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data(dict) | Data from instance or context. | required |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
268 269 270 271 272 273 274 275 |
|
get_attr_values_from_data_for_plugin(plugin, data)
staticmethod
Get attribute values for attribute definitions from data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plugin | Union[Plugin, Type[Plugin]] | The plugin for which attributes are extracted. | required |
data(dict) | Data from instance or context. | required |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
|
get_attribute_defs()
classmethod
Publish attribute definitions.
Attributes available for all families in plugin's families
attribute.
Returns:
Type | Description |
---|---|
list[AbstractAttrDef]: Attribute definitions for plugin. |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
159 160 161 162 163 164 165 166 167 168 169 |
|
instance_matches_plugin_families(instance)
classmethod
Check if instance matches families.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance | Optional[CreatedInstance] | Instance to check. Or None for context. | required |
Returns:
Name | Type | Description |
---|---|---|
bool | True if instance matches plugin families. |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
|
register_create_context_callbacks(create_context)
classmethod
Register callbacks for create context.
It is possible to register callbacks listening to changes happened in create context.
Methods available on create context: - add_instances_added_callback - add_instances_removed_callback - add_value_changed_callback - add_pre_create_attr_defs_change_callback - add_create_attr_defs_change_callback - add_publish_attr_defs_change_callback
Parameters:
Name | Type | Description | Default |
---|---|---|---|
create_context | CreateContext | Create context. | required |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
ColormanagedPyblishPluginMixin
Bases: object
Mixin for colormanaged plugins.
This class is used to set colorspace data to a publishing representation. It contains a static method, get_colorspace_settings, which returns config and file rules data for the host context. It also contains a method, set_representation_colorspace, which sets colorspace data to the representation. The allowed file extensions are listed in the allowed_ext variable. The method first checks if the file extension is in the list of allowed extensions. If it is, it then gets the colorspace settings from the host context and gets a matching colorspace from rules. Finally, it infuses this data into the representation.
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
|
get_colorspace_settings(context)
Returns solved settings for the host context.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
context | Context | publishing context | required |
Returns:
Type | Description |
---|---|
tuple | bool: config, file rules or None |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
426 427 428 429 430 431 432 433 434 435 |
|
set_representation_colorspace(representation, context, colorspace=None)
Sets colorspace data to representation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
representation | dict | publishing representation | required |
context | Context | publishing context | required |
colorspace | str | colorspace name. Defaults to None. | None |
Example
{
# for other publish plugins and loaders
"colorspace": "linear",
"config": {
# for future references in case need
"path": "/abs/path/to/config.ocio",
# for other plugins within remote publish cases
"template": "{project[root]}/path/to/config.ocio"
}
}
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
|
Extractor
Bases: InstancePlugin
Extractor base class.
The extractor base class implements a "staging_dir" function used to generate a temporary directory for an instance to extract to.
This temporary directory is generated through tempfile.mkdtemp()
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
|
staging_dir(instance)
Provide a temporary directory in which to store extracted files
Upon calling this method the staging directory is stored inside the instance.data['stagingDir']
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
399 400 401 402 403 404 405 406 |
|
KnownPublishError
Bases: Exception
Publishing crashed because of known error.
Artist can't affect source of the error.
Deprecated
Please use PublishError
instead. Marked as deprecated 24/09/02.
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
36 37 38 39 40 41 42 43 44 45 |
|
OptionalPyblishPluginMixin
Bases: AYONPyblishPluginMixin
Prepare mixin for optional plugins.
Defined active attribute definition prepared for published and prepares method which will check if is active or not.
class ValidateScene(
pyblish.api.InstancePlugin, OptionalPyblishPluginMixin
):
def process(self, instance):
# Skip the instance if is not active by data on the instance
if not self.is_active(instance.data):
return
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
|
get_attribute_defs()
classmethod
Attribute definitions based on plugin's optional attribute.
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
|
is_active(data)
Check if plugins is active for instance/context based on their data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data(dict) | Data from instance or context. | required |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
|
PublishError
Bases: Exception
Publishing crashed because of known error.
Message will be shown in UI for artist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message | str | Message of error. Short explanation an issue. | required |
title | Optional[str] | Title showed in UI. | None |
description | Optional[str] | Detailed description of an error. It is possible to use Markdown syntax. | None |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
PublishValidationError
Bases: PublishError
Validation error happened during publishing.
This exception should be used when validation publishing failed.
Publishing does not stop during validation order if this exception is raised.
Has additional UI specific attributes that may be handy for artist.
Argument 'title' is used to group errors.
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
RepairAction
Bases: Action
Repairs the action
To process the repairing this requires a static repair(instance)
method is available on the plugin.
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
|
RepairContextAction
Bases: Action
Repairs the action
To process the repairing this requires a static repair(context)
method is available on the plugin.
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
|