publish
AYONPyblishPluginMixin
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
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 276 277 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 | |
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
264 265 266 267 268 269 270 271 272 273 274 275 276 | |
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
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
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
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | |
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
297 298 299 300 301 302 303 304 | |
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
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | |
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
188 189 190 191 192 193 194 195 196 197 198 | |
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
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 | |
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
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
AbstractCollectRender
Bases: ContextPlugin
Gather all publishable render layers from renderSetup.
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
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 276 277 278 279 280 281 282 283 284 285 | |
__init__(*args, **kwargs)
Constructor.
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
134 135 136 137 138 | |
add_additional_data(data)
Add additional data to collected instance.
This can be overridden by host implementation to add custom additional data.
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
270 271 272 273 274 275 276 277 | |
get_expected_files(render_instance) abstractmethod
Get list of expected files.
Returns:
| Name | Type | Description |
|---|---|---|
list | expected files. This can be either simple list of files with their paths, or list of dictionaries, where key is name of AOV for example and value is list of files for that AOV. |
Example::
['/path/to/file.001.exr', '/path/to/file.002.exr']
or as dictionary:
[
{
"beauty": ['/path/to/beauty.001.exr', ...],
"mask": ['/path/to/mask.001.exr']
}
]
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |
get_instances(context) abstractmethod
Get all renderable instances and their data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context | Context | Context object. | required |
Returns:
| Type | Description |
|---|---|
| list of :class: |
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
231 232 233 234 235 236 237 238 239 240 241 242 243 | |
post_collecting_action()
Execute some code after collection is done.
This is useful for example for restoring current render layer.
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
279 280 281 282 283 284 285 | |
process(context)
Entry point to collector.
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
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 | |
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
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 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 | |
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
455 456 457 458 459 460 461 462 463 464 | |
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
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 | |
ExpectedFiles
Bases: ABC
Class grouping functionality for all supported renderers.
Attributes:
| Name | Type | Description |
|---|---|---|
multipart | bool | Flag if multipart exrs are used. |
Source code in client/ayon_core/pipeline/publish/abstract_expected_files.py
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 | |
get(render_instance) abstractmethod
Get expected files for given renderer and render layer.
This method should return dictionary of all files we are expecting to be rendered from the host. Usually render_instance corresponds to render layer. Result can be either flat list with the file paths or it can be list of dictionaries. Each key corresponds to for example AOV name or channel, etc.
Example::
['/path/to/file.001.exr', '/path/to/file.002.exr']
or as dictionary:
[
{
"beauty": ['/path/to/beauty.001.exr', ...],
"mask": ['/path/to/mask.001.exr']
}
]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
render_instance ( | class: | required |
Returns:
| Name | Type | Description |
|---|---|---|
list | Full paths to expected rendered files. | |
| list of dict: Path to expected rendered files categorized by AOVs, etc. |
Source code in client/ayon_core/pipeline/publish/abstract_expected_files.py
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 | |
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
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | |
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
428 429 430 431 432 433 434 435 | |
IntegrationTemplateItem
Represents single template item.
Template path, template data that was used in the template.
Attributes:
| Name | Type | Description |
|---|---|---|
anatomy | Anatomy | Anatomy object. |
template_data | dict[str, Any] | Template data. |
template_object | TemplateItem | Template object |
Source code in client/ayon_core/pipeline/publish/lib.py
1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 | |
__init__(anatomy, template_data, template_object)
Initialize TemplateItem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anatomy | Anatomy | Anatomy object. | required |
template_data | dict[str, Any] | Template data. | required |
template_object | TemplateItem | Template object. | required |
Source code in client/ayon_core/pipeline/publish/lib.py
1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 | |
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
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 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
get_attribute_defs() classmethod
Attribute definitions based on plugin's optional attribute.
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | |
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
349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
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 | |
PublishXmlValidationError
Bases: PublishValidationError
Raise an error from a dedicated xml file.
Can be useful to have one xml file with different possible messages that helps to avoid flood code with dedicated artist messages.
XML files should live relative to the plugin file location
'{plugin dir}/help/some_plugin.xml'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugin | Plugin | Plugin that raised an error. Is used to get path to xml file. | required |
message | str | Exception message, can be technical, is used for console output. | required |
key | Optional[str] | XML file can contain multiple error messages, key is used to get one of them. By default is used 'main'. | None |
formatting_data | Optional[dict[str, Any] | Error message can have variables to fill. | None |
help_filename | Optional[str] | Name of xml file with messages. By default, is used filename where plugin lives with .xml extension. | None |
Source code in client/ayon_core/pipeline/publish/publish_plugins.py
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 | |
RenderInstance
Bases: object
Data collected by collectors.
This data class later on passed to collected instances. Those attributes are required later on.
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
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 | |
check_frame_end(_, value)
Validate if frame end is not less then start.
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
95 96 97 98 99 100 | |
check_frame_start(_, value)
Validate if frame start is not larger then end.
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
88 89 90 91 92 93 | |
check_tiles_x(_, value)
Validate if tile x isn't less then 1.
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
102 103 104 105 106 107 108 109 110 111 | |
check_tiles_y(_, value)
Validate if tile y isn't less then 1.
Source code in client/ayon_core/pipeline/publish/abstract_collect_render.py
113 114 115 116 117 118 119 120 121 122 | |
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
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | |
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
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | |
add_trait_representations(instance, representations)
Add trait representations to instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | Instance to add trait representations to. | required |
representations | list[Representation] | List of representation trait based representations to add. | required |
Source code in client/ayon_core/pipeline/publish/lib.py
1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 | |
apply_plugin_settings_automatically(plugin, settings, logger=None)
Automatically apply plugin settings to a plugin object.
Note
This function was created to be able to use it in custom overrides of 'apply_settings' class method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugin | type[Plugin] | Class of a plugin. | required |
settings | dict[str, Any] | Plugin specific settings. | required |
logger | Optional[Logger] | Logger to log debug messages about applied settings values. | None |
Source code in client/ayon_core/pipeline/publish/lib.py
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | |
context_plugin_should_run(plugin, context)
Return whether the ContextPlugin should run on the given context.
This is a helper function to work around a bug pyblish-base#250 Whenever a ContextPlugin sets specific families it will still trigger even when no instances are present that have those families.
This actually checks it correctly and returns whether it should run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugin | Plugin | Plugin with filters. | required |
context | Context | Pyblish context with instances. | required |
Returns:
| Name | Type | Description |
|---|---|---|
bool | Context plugin should run based on valid instances. |
Source code in client/ayon_core/pipeline/publish/lib.py
725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 | |
filter_crashed_publish_paths(project_name, crashed_paths, *, project_settings=None)
Filter crashed paths happened during plugins discovery.
Check if plugins discovery has enabled strict mode and filter crashed paths that happened during discover based on regexes from settings.
Publishing should not start if any paths are returned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_name | str | Project name in which context plugins discovery happened. | required |
crashed_paths | set[str] | Crashed paths from plugins discovery report. | required |
project_settings | Optional[dict[str, Any]] | Project settings. | None |
Returns:
| Type | Description |
|---|---|
set[str] | set[str]: Filtered crashed paths. |
Source code in client/ayon_core/pipeline/publish/lib.py
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 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |
filter_instances_for_context_plugin(plugin, context)
Filter instances on context by context plugin filters.
This is for cases when context plugin need similar filtering like instance plugin have, but for some reason must run on context or should find out if there is at least one instance with a family.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugin | Plugin | Plugin with filters. | required |
context | Context | Pyblish context with instances. | required |
Returns:
| Type | Description |
|---|---|
| Iterator[pyblish.lib.Instance]: Iteration of valid instances. |
Source code in client/ayon_core/pipeline/publish/lib.py
684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 | |
get_default_reviewable_layers(project_settings)
Get default reviewable layers from project settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_settings | dict | Project settings. | required |
Returns:
| Type | Description |
|---|---|
list[str] | list[str]: List of default reviewable layers. |
Source code in client/ayon_core/pipeline/publish/lib.py
1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 | |
get_errored_instances_from_context(context, plugin=None)
Collect failed instances from pyblish context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context | Context | Publish context where we're looking for failed instances. | required |
plugin | Plugin | If provided then only consider errors related to that plug-in. | None |
Returns:
| Type | Description |
|---|---|
| List[pyblish.lib.Instance]: Instances which failed during processing. |
Source code in client/ayon_core/pipeline/publish/lib.py
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 | |
get_errored_plugins_from_context(context)
Collect failed plugins from pyblish context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context | Context | Publish context where we're looking for failed plugins. | required |
Returns:
| Type | Description |
|---|---|
| List[pyblish.api.Plugin]: Plugins which failed during processing. |
Source code in client/ayon_core/pipeline/publish/lib.py
663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 | |
get_instance_families(instance)
Get all families of the instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | Instance to get families from. | required |
Returns:
| Type | Description |
|---|---|
list[str] | list[str]: List of families. |
Source code in client/ayon_core/pipeline/publish/lib.py
1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 | |
get_instance_publish_template(instance)
Return anatomy template name to use for integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | Instance to process. | required |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | Anatomy template name |
Source code in client/ayon_core/pipeline/publish/lib.py
1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 | |
get_instance_staging_dir(instance)
Unified way how staging dir is stored and created on instances.
First check if 'stagingDir' is already set in instance data. In case there already is new tempdir will not be created.
Returns:
| Name | Type | Description |
|---|---|---|
str | Path to staging dir |
Source code in client/ayon_core/pipeline/publish/lib.py
799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 | |
get_instance_template_name(instance)
Return anatomy template name to use for integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | Instance to process. | required |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | Anatomy template name |
Source code in client/ayon_core/pipeline/publish/lib.py
1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 | |
get_plugin_settings(plugin, project_settings, log, category=None)
Get plugin settings based on host name and plugin name.
Note
Default implementation of automated settings is passing host name into 'category'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugin | Plugin | Plugin where settings are applied. | required |
project_settings | dict[str, Any] | Project settings. | required |
log | Logger | Logger to log messages. | required |
category | Optional[str] | Settings category key where to look for plugin settings. | None |
Returns:
| Type | Description |
|---|---|
| dict[str, Any]: Plugin settings {'attribute': 'value'}. |
Source code in client/ayon_core/pipeline/publish/lib.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 | |
get_publish_instance_families(instance)
Get all families of the instance.
Look for families under 'productType' and 'families' keys in instance data. Value of 'productType' is used as first family and then all other families in random order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pyblish.api.Instance | Instance to get families from. | required |
Returns:
| Type | Description |
|---|---|
| list[str]: List of families. |
Source code in client/ayon_core/pipeline/publish/lib.py
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 | |
get_publish_instance_label(instance)
Try to get label from pyblish instance.
First are used values in instance data under 'label' and 'name' keys. Then is used string conversion of instance object -> 'instance._name'.
Todos
Maybe 'productName' key could be used too.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | Pyblish instance. | required |
Returns:
| Name | Type | Description |
|---|---|---|
str | Instance label. |
Source code in client/ayon_core/pipeline/publish/lib.py
1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 | |
get_publish_repre_path(instance, repre, only_published=False)
Get representation path that can be used for integration.
When 'only_published' is set to true the validation of path is not relevant. In that case we just need what is set in 'published_path' as "reference". The reference is not used to get or upload the file but for reference where the file was published.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | Processed instance object. Used for source of staging dir if representation does not have filled it. | required |
repre | dict | Representation on instance which could be and could not be integrated with main integrator. | required |
only_published | bool | Care only about published paths and ignore if filepath is not existing anymore. | False |
Returns:
| Name | Type | Description |
|---|---|---|
str | Path to representation file. | |
None | Path is not filled or does not exists. |
Source code in client/ayon_core/pipeline/publish/lib.py
747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | |
get_publish_template_name(project_name, host_name, product_base_type, task_name, task_type, *, project_settings=None, hero=False, logger=None)
Get template name which should be used for passed context.
Publish templates are filtered by host name, family, task name and task type.
Default template which is used at if profiles are not available or profile has empty value is defined by 'DEFAULT_PUBLISH_TEMPLATE' constant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_name | str | Name of project where to look for settings. | required |
host_name | str | Name of host integration. | required |
product_base_type | str | Product base type for which should be found template. | required |
task_name | str | Task name on which is instance working. | required |
task_type | str | Task type on which is instance working. | required |
project_settings | Dict[str, Any] | Prepared project settings. | None |
hero | bool | Template is for hero version publishing. | False |
logger | Logger | Custom logger used for 'filter_profiles' function. | None |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | Template name which should be used for integration. |
Source code in client/ayon_core/pipeline/publish/lib.py
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 | |
get_publish_template_object(instance, category_name='publish', template_name=None)
Return anatomy template object to use for integration.
Note: What is the actual type of the object?
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | Instance to process. | required |
category_name | str | Category name of the template to use. Defaults to "publish". | 'publish' |
template_name | str | Template name to use. If not provided, it will get the template name from the provided instance. | None |
Returns:
| Name | Type | Description |
|---|---|---|
AnatomyTemplateItem | 'AnatomyTemplateItem' | Anatomy template object |
Source code in client/ayon_core/pipeline/publish/lib.py
1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 | |
get_rootless_path(anatomy, path)
Get rootless variant of the path.
Returns, if possible, a path without an absolute portion from the root (e.g. 'c:\' or '/opt/..'). This is basically a wrapper for the meth:Anatomy.find_root_template_from_path method that displays a warning if the root path is not found.
This information is platform-dependent and shouldn't be captured. For example::
'c:/projects/MyProject1/Assets/publish...'
will be transformed to:
'{root}/MyProject1/Assets...'
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anatomy | Anatomy | Project anatomy. | required |
path | str | Absolute path. | required |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | Path where root path is replaced by formatting string. |
Source code in client/ayon_core/pipeline/publish/lib.py
1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 | |
get_trait_representations(instance)
Get trait representations from instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | Instance to get trait representations from. | required |
Returns:
| Type | Description |
|---|---|
list[Representation] | list[Representation]: List of representation names. |
Source code in client/ayon_core/pipeline/publish/lib.py
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 | |
get_version_data_from_instance(instance)
Get version data from the Instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | the current instance being published. | required |
Returns:
| Name | Type | Description |
|---|---|---|
dict | dict | the required information for |
Source code in client/ayon_core/pipeline/publish/lib.py
1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 | |
has_trait_representations(instance)
Check if instance has trait representation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | Instance to check. | required |
Returns:
| Name | Type | Description |
|---|---|---|
True | bool | Instance has trait representation. |
False | bool | Instance does not have trait representation. |
Source code in client/ayon_core/pipeline/publish/lib.py
1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 | |
load_help_content_from_filepath(filepath)
Load help content from xml file. Xml file may contain errors and warnings.
Source code in client/ayon_core/pipeline/publish/lib.py
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 276 | |
main_cli_publish(path, targets=None, addons_manager=None)
Start headless publishing.
Publish use json from passed path argument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path | str | Path to JSON. | required |
targets | Optional[List[str]] | List of pyblish targets. | None |
addons_manager | Optional[AddonsManager] | Addons manager instance. | None |
Raises:
| Type | Description |
|---|---|
RuntimeError | When there is no path to process or when executed with list of JSON paths. |
Source code in client/ayon_core/pipeline/publish/lib.py
1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 | |
publish_plugins_discover(paths=None)
Find and return available pyblish plug-ins.
Overridden function from pyblish module to be able to collect crashed files and reason of their crash.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths | list | Paths to discover plug-ins from. If no paths are provided, all paths are searched. | None |
Source code in client/ayon_core/pipeline/publish/lib.py
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 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 | |
set_trait_representations(instance, representations)
Set trait representations to instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance | Instance | Instance to set trait representations to. | required |
representations | list[Representation] | List of trait based representations. | required |
Source code in client/ayon_core/pipeline/publish/lib.py
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 | |