pipeline
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 |
|
Anatomy
Bases: BaseAnatomy
Source code in client/ayon_core/pipeline/anatomy/anatomy.py
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 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 499 500 501 502 503 504 505 506 507 508 509 510 |
|
AutoCreator
Bases: BaseCreator
Creator which is automatically triggered without user interaction.
Can be used e.g. for workfile
.
Source code in client/ayon_core/pipeline/create/creator_plugins.py
959 960 961 962 963 964 965 966 967 |
|
remove_instances(instances)
Skip removal.
Source code in client/ayon_core/pipeline/create/creator_plugins.py
965 966 967 |
|
BaseCreator
Bases: ABC
Plugin that create and modify instance data before publishing process.
We should maybe find better name as creation is only one part of its logic and to avoid expectations that it is the same as avalon.api.Creator
.
Single object should be used for multiple instances instead of single instance per one creator object. Do not store temp data or mid-process data to self
if it's not Plugin specific.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_settings | dict[str, Any] | Project settings. | required |
create_context | CreateContext | Context which initialized creator. | required |
headless | bool | Running in headless mode. | False |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
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 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 355 356 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 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 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 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 |
|
collection_shared_data
property
Access to shared data that can be used during creator's collection.
Returns:
Type | Description |
---|---|
dict[str, Any]: Shared data. |
Raises:
Type | Description |
---|---|
UnavailableSharedData | When called out of collection phase. |
identifier
property
Identifier of creator (must be unique).
Default implementation returns plugin's product type.
log
property
Logger of the plugin.
Returns:
Type | Description |
---|---|
logging.Logger: Logger with name of the plugin. |
product_type
abstractmethod
property
Family that plugin represents.
project_anatomy
property
Current project anatomy.
Returns:
Name | Type | Description |
---|---|---|
Anatomy | Project anatomy object. |
project_name
property
Current project name.
Returns:
Name | Type | Description |
---|---|---|
str | Name of a project. |
apply_settings(project_settings)
Method called on initialization of plugin to apply settings.
Default implementation tries to auto-apply settings values if are in expected hierarchy.
Data hierarchy to auto-apply settings
├─ {self.settings_category} - Root key in settings │ └─ "create" - Hardcoded key │ └─ {self.settings_name} | {class name} - Name of plugin │ ├─ ... attribute values... - Attribute/value pair
It is mandatory to define 'settings_category' attribute. Attribute 'settings_name' is optional and class name is used if is not defined.
Example data
ProjectSettings { "maya": { # self.settings_category "create": { # Hardcoded key "CreateAnimation": { # self.settings_name / class name "enabled": True, # --- Attributes to set --- "optional": True,# "active": True, # "fps": 25, # ------------------------- }, ... }, ... }, ... }
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_settings | dict[str, Any] | Project settings. | required |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
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 |
|
collect_instances()
abstractmethod
Collect existing instances related to this creator plugin.
The implementation differs on host abilities. The creator has to collect metadata about instance and create 'CreatedInstance' object which should be added to 'CreateContext'.
Example:
def collect_instances(self):
# Getting existing instances is different per host implementation
for instance_data in pipeline.list_instances():
# Process only instances that were created by this creator
creator_id = instance_data.get("creator_identifier")
if creator_id == self.identifier:
# Create instance object from existing data
instance = CreatedInstance.from_existing(
instance_data, self
)
# Add instance to create context
self._add_instance_to_context(instance)
Source code in client/ayon_core/pipeline/create/creator_plugins.py
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 |
|
create()
abstractmethod
Create new instance.
Replacement of process
method from avalon implementation. - must expect all data that were passed to init in previous implementation
Source code in client/ayon_core/pipeline/create/creator_plugins.py
433 434 435 436 437 438 439 440 441 442 |
|
get_attr_defs_for_instance(instance)
Get attribute definitions for an instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance | CreatedInstance | Instance for which to get attribute definitions. | required |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
599 600 601 602 603 604 605 606 607 |
|
get_dynamic_data(project_name, folder_entity, task_entity, variant, host_name, instance)
Dynamic data for product name filling.
These may be dynamically created based on current context of workfile.
Source code in client/ayon_core/pipeline/create/creator_plugins.py
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
|
get_group_label()
Group label under which are instances grouped in UI.
Default implementation use attributes in this order
- 'group_label' -> 'label' -> 'identifier' Keep in mind that 'identifier' use 'product_type' by default.
Returns:
Name | Type | Description |
---|---|---|
str | Group label that can be used for grouping of instances in UI. Group label can be overridden by instance itself. |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
|
get_icon()
Icon of creator (product type).
Can return path to image file or awesome icon name.
Source code in client/ayon_core/pipeline/create/creator_plugins.py
496 497 498 499 500 501 502 |
|
get_instance_attr_defs()
Plugin attribute definitions.
Attribute definitions of plugin that hold data about created instance and values are stored to metadata for future usage and for publishing purposes.
NOTE: Convert method should be implemented which should care about updating keys/values when plugin attributes change.
Returns:
Type | Description |
---|---|
list[AbstractAttrDef]: Attribute definitions that can be tweaked for created instance. |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 |
|
get_next_versions_for_instances(instances)
Prepare next versions for instances.
This is helper method to receive next possible versions for instances. It is using context information on instance to receive them, 'folderPath' and 'product'.
Output will contain version by each instance id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instances | list[CreatedInstance] | Instances for which to get next versions. | required |
Returns:
Type | Description |
---|---|
dict[str, int]: Next versions by instance id. |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 |
|
get_product_name(project_name, folder_entity, task_entity, variant, host_name=None, instance=None, project_entity=None)
Return product name for passed context.
Method is also called on product name update. In that case origin instance is passed in.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_name | str | Project name. | required |
folder_entity | dict | Folder entity. | required |
task_entity | dict | Task entity. | required |
variant | str | Product name variant. In most of cases user input. | required |
host_name | Optional[str] | Which host creates product. Defaults to host name on create context. | None |
instance | Optional[CreatedInstance] | Object of 'CreatedInstance' for which is product name updated. Passed only on product name update. | None |
project_entity | Optional[dict[str, Any]] | Project entity. | None |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
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 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 |
|
register_callbacks()
Register callbacks for creator.
Default implementation does nothing. It can be overridden to register callbacks for creator.
Source code in client/ayon_core/pipeline/create/creator_plugins.py
296 297 298 299 300 301 302 |
|
remove_instances(instances)
abstractmethod
Method called on instance removal.
Can also remove instance metadata from context but should return 'True' if did so.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instances | list[CreatedInstance] | Instance objects which should be removed. | required |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
482 483 484 485 486 487 488 489 490 491 492 493 494 |
|
set_instance_thumbnail_path(instance_id, thumbnail_path=None)
Set path to thumbnail for instance.
Source code in client/ayon_core/pipeline/create/creator_plugins.py
622 623 624 625 626 627 |
|
update_instances(update_list)
abstractmethod
Store changes of existing instances so they can be recollected.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
update_list | list[UpdateData] | Gets list of tuples. Each item contain changed instance and it's changes. | required |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
471 472 473 474 475 476 477 478 479 480 |
|
CreatedInstance
Instance entity with data that will be stored to workfile.
I think data
must be required argument containing all minimum information about instance like "folderPath" and "task" and all data used for filling product name as creators may have custom data for product name filling.
Notes
Object have 2 possible initialization. One using 'creator' object which is recommended for api usage. Second by passing information about creator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
product_type | str | Product type that will be created. | required |
product_name | str | Name of product that will be created. | required |
data | Dict[str, Any] | Data used for filling product name or override data from already existing instance. | required |
creator | BaseCreator | Creator responsible for instance. | required |
Source code in client/ayon_core/pipeline/create/structures.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 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 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 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 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 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 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 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 797 798 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 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 |
|
creator_attribute_defs
property
Attribute definitions defined by creator plugin.
Returns:
Type | Description |
---|---|
List[AbstractAttrDef]: Attribute definitions. |
data
property
Legacy access to data.
Access to data is needed to modify values.
Returns:
Name | Type | Description |
---|---|---|
CreatedInstance | Object can be used as dictionary but with validations of immutable keys. |
has_promised_context
property
Get context data that are promised to be set by creator.
Returns:
Name | Type | Description |
---|---|---|
bool | bool | Has context that won't bo validated. Artist can't change value when set to True. |
id
property
Instance identifier.
Returns:
Name | Type | Description |
---|---|---|
str | UUID of instance. |
transient_data
property
Data stored for lifetime of instance object.
These data are not stored to scene and will be lost on object deletion.
Can be used to store objects. In some host implementations is not possible to reference to object in scene with some unique identifier (e.g. node in Fusion.). In that case it is handy to store the object here. Should be used that way only if instance data are stored on the node itself.
Returns:
Type | Description |
---|---|
Dict[str, Any]: Dictionary object where you can store data related to instance for lifetime of instance object. |
add_members(members)
Currently unused method.
Source code in client/ayon_core/pipeline/create/structures.py
878 879 880 881 882 883 |
|
attribute_value_changed(key, changes)
A value changed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key | str | Key of attribute values. | required |
changes | Dict[str, Any] | Changes in values. | required |
Source code in client/ayon_core/pipeline/create/structures.py
836 837 838 839 840 841 842 843 844 |
|
changes()
Calculate and return changes.
Source code in client/ayon_core/pipeline/create/structures.py
684 685 686 687 |
|
data_to_store()
Collect data that contain json parsable types.
It is possible to recreate the instance using these data.
Todos
We probably don't need OrderedDict. When data are loaded they are not ordered anymore.
Returns:
Name | Type | Description |
---|---|---|
OrderedDict | Ordered dictionary with instance data. |
Source code in client/ayon_core/pipeline/create/structures.py
737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 |
|
from_existing(instance_data, creator, transient_data=None)
classmethod
Convert instance data from workfile to CreatedInstance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance_data | Dict[str, Any] | Data in a structure ready for 'CreatedInstance' object. | required |
creator | BaseCreator | Creator plugin which is creating the instance of for which the instance belongs. | required |
transient_data | Optional[dict[str, Any]] | Instance transient data. | None |
Returns:
Name | Type | Description |
---|---|---|
CreatedInstance | CreatedInstance | Instance object. |
Source code in client/ayon_core/pipeline/create/structures.py
796 797 798 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 |
|
mark_as_stored()
Should be called when instance data are stored.
Origin data are replaced by current data so changes are cleared.
Source code in client/ayon_core/pipeline/create/structures.py
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 |
|
publish_attribute_value_changed(plugin_name, value)
Method called from PublishAttributes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plugin_name | str | Plugin name. | required |
value | Dict[str, Any] | Changes in values for the plugin. | required |
Source code in client/ayon_core/pipeline/create/structures.py
861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 |
|
set_create_attr_defs(attr_defs, value=None)
Create plugin updates create attribute definitions.
Method called by create plugin when attribute definitions should be changed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
attr_defs | List[AbstractAttrDef] | Attribute definitions. | required |
value | Optional[Dict[str, Any]] | Values of attribute definitions. Current values are used if not passed in. | None |
Source code in client/ayon_core/pipeline/create/structures.py
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 |
|
set_publish_plugin_attr_defs(plugin_name, attr_defs)
Set attribute definitions for publish plugin.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plugin_name(str) | Name of publish plugin. | required | |
attr_defs(List[AbstractAttrDef]) | Attribute definitions. | required |
Source code in client/ayon_core/pipeline/create/structures.py
846 847 848 849 850 851 852 853 854 855 856 857 858 859 |
|
Creator
Bases: BaseCreator
Creator that has more information for artist to show in UI.
Creation requires prepared product name and instance data.
Source code in client/ayon_core/pipeline/create/creator_plugins.py
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 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 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 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 797 798 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 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 |
|
show_order
property
Order in which is creator shown in UI.
Returns:
Name | Type | Description |
---|---|---|
int | Order in which is creator shown (less == earlier). By default is using Creator's 'order' or processing. |
apply_staging_dir(instance)
Apply staging dir with persistence to instance's transient data.
Method is called on instance creation and on instance update.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance | CreatedInstance | Instance for which should be staging dir applied. | required |
Returns:
Type | Description |
---|---|
Optional[str]: Staging dir path or None if not applied. |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 |
|
create(product_name, instance_data, pre_create_data)
abstractmethod
Create new instance and store it.
Ideally should be stored to workfile using host implementation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
product_name(str) | Product name of created instance. | required | |
instance_data(dict) | Base data for instance. | required | |
pre_create_data(dict) | Data based on pre creation attributes. Those may affect how creator works. | required |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 |
|
get_default_variant(only_explicit=False)
Default variant value that will be used to prefill variant input.
This is for user input and value may not be content of result from get_default_variants
.
Note
This method does not allow to have empty string as default variant.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
only_explicit | Optional[bool] | If True, only explicit default variant from '_default_variant' will be returned. | False |
Returns:
Name | Type | Description |
---|---|---|
str | Variant value. |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 |
|
get_default_variants()
Default variant values for UI tooltips.
Replacement of default_variants
attribute. Using method gives ability to have some "logic" other than attribute values.
By default, returns default_variants
value.
Returns:
Type | Description |
---|---|
list[str]: Whisper variants for user input. |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
753 754 755 756 757 758 759 760 761 762 763 764 765 |
|
get_description()
Short description of product type and plugin.
Returns:
Name | Type | Description |
---|---|---|
str | Short description of product type. |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
733 734 735 736 737 738 739 740 |
|
get_detail_description()
Description of product type and plugin.
Can be detailed with markdown or html tags.
Returns:
Name | Type | Description |
---|---|---|
str | Detailed description of product type for artist. |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
742 743 744 745 746 747 748 749 750 751 |
|
get_pre_create_attr_defs()
Plugin attribute definitions needed for creation. Attribute definitions of plugin that define how creation will work. Values of these definitions are passed to create
method.
Note
Convert method should be implemented which should care about updating keys/values when plugin attributes change.
Returns:
Type | Description |
---|---|
list[AbstractAttrDef]: Attribute definitions that can be tweaked for created instance. |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
825 826 827 828 829 830 831 832 833 834 835 836 837 838 |
|
get_staging_dir(instance)
Return the staging dir and persistence from instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance | CreatedInstance | Instance for which should be staging dir gathered. | required |
Returns:
Type | Description |
---|---|
Optional[StagingDir] | Optional[namedtuple]: Staging dir path and persistence or None |
Source code in client/ayon_core/pipeline/create/creator_plugins.py
840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 |
|
CreatorError
Bases: Exception
Should be raised when creator failed because of known issue.
Message of error should be artist friendly.
Source code in client/ayon_core/pipeline/create/exceptions.py
63 64 65 66 67 68 |
|
IncompatibleLoaderError
Bases: ValueError
Error when Loader is incompatible with a representation.
Source code in client/ayon_core/pipeline/load/utils.py
58 59 60 |
|
InventoryAction
Bases: object
A custom action for the scene inventory tool
If registered the action will be visible in the Right Mouse Button menu under the submenu "Actions".
Source code in client/ayon_core/pipeline/actions.py
350 351 352 353 354 355 356 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 |
|
is_compatible(container)
staticmethod
Override function in a custom class
This method is specifically used to ensure the action can operate on the container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
container(dict) | the data of a loaded asset, see host.ls() | required |
Returns:
Type | Description |
---|---|
bool |
Source code in client/ayon_core/pipeline/actions.py
366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
|
process(containers)
Override function in a custom class
This method will receive all containers even those which are incompatible. It is advised to create a small filter along the lines of this example:
valid_containers = filter(self.is_compatible(c) for c in containers)
The return value will need to be a True-ish value to trigger the data_changed signal in order to refresh the view.
You can return a list of container names to trigger GUI to select treeview items.
You can return a dict to carry extra GUI options. For example: { "objectNames": [container names...], "options": {"mode": "toggle", "clear": False} } Currently workable GUI options are: - clear (bool): Clear current selection before selecting by action. Default True
. - mode (str): selection mode, use one of these: "select", "deselect", "toggle". Default is "select".
Parameters:
Name | Type | Description | Default |
---|---|---|---|
containers | list | list of dictionaries | required |
Return
bool, list or dict
Source code in client/ayon_core/pipeline/actions.py
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 |
|
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 |
|
LauncherAction
Bases: object
A custom action available
Source code in client/ayon_core/pipeline/actions.py
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 |
|
is_compatible(selection)
Return whether the class is compatible with the Session.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selection | LauncherActionSelection | Data with selection. | required |
Source code in client/ayon_core/pipeline/actions.py
330 331 332 333 334 335 336 337 |
|
process(selection, **kwargs)
Process the action.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selection | LauncherActionSelection | Data with selection. | required |
**kwargs | Additional arguments. | {} |
Source code in client/ayon_core/pipeline/actions.py
339 340 341 342 343 344 345 346 347 |
|
LegacyCreator
Determine how assets are created
Source code in client/ayon_core/pipeline/create/legacy_create.py
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 |
|
apply_settings(project_settings)
classmethod
Apply AYON settings to a plugin class.
Source code in client/ayon_core/pipeline/create/legacy_create.py
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 |
|
get_dynamic_data(project_name, folder_entity, task_entity, variant, host_name)
classmethod
Return dynamic data for current Creator plugin.
By default return keys from dynamic_product_name_keys
attribute as mapping to keep formatted template unchanged.
dynamic_product_name_keys = ["my_key"]
---
output = {
"my_key": "{my_key}"
}
Dynamic keys may override default Creator keys (productType, task, folderPath, ...) but do it wisely if you need.
All of keys will be converted into 3 variants unchanged, capitalized and all upper letters. Because of that are all keys lowered.
This method can be modified to prefill some values just keep in mind it is class method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_name | str | Context's project name. | required |
folder_entity | dict[str, Any] | Folder entity. | required |
task_entity | dict[str, Any] | Task entity. | required |
variant | str | What is entered by user in creator tool. | required |
host_name | str | Name of host. | required |
Returns:
Name | Type | Description |
---|---|---|
dict | Fill data for product name template. |
Source code in client/ayon_core/pipeline/create/legacy_create.py
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 |
|
get_product_name(project_name, folder_entity, task_entity, variant, host_name=None)
classmethod
Return product name created with entered arguments.
Logic extracted from Creator tool. This method should give ability to get product name without the tool.
TODO: Maybe change variant
variable.
By default is output concatenated product type with variant.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_name | str | Context's project name. | required |
folder_entity | dict[str, Any] | Folder entity. | required |
task_entity | dict[str, Any] | Task entity. | required |
variant | str | What is entered by user in creator tool. | required |
host_name | str | Name of host. | None |
Returns:
Name | Type | Description |
---|---|---|
str | Formatted product name with entered arguments. Should match config's logic. |
Source code in client/ayon_core/pipeline/create/legacy_create.py
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 |
|
LoaderPlugin
Bases: list
Load representation into host application
Source code in client/ayon_core/pipeline/load/plugins.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 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 |
|
fname
property
Backwards compatibility with deprecation warning
get_options(contexts)
classmethod
Returns static (cls) options or could collect from 'contexts'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
contexts | list | of repre or product contexts | required |
Returns: (list)
Source code in client/ayon_core/pipeline/load/plugins.py
212 213 214 215 216 217 218 219 220 221 222 |
|
get_representation_name_aliases(representation_name)
classmethod
Return representation names to which switching is allowed from the input representation name, like an alias replacement of the input representation_name
.
For example, to allow an automated switch on update from representation ma
to mb
or abc
, then when representation_name
is ma
return: ["mb", "abc"]
The order of the names in the returned representation names is important, because the first one existing under the new version will be chosen.
Returns:
Type | Description |
---|---|
List[str]: Representation names switching to is allowed on update if the input representation name is not found on the new version. |
Source code in client/ayon_core/pipeline/load/plugins.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
|
get_representations()
classmethod
Representation names with which is plugin compatible.
Empty set makes the plugin incompatible with any representation. To allow compatibility with all representations use '{"*"}'.
Returns:
Type | Description |
---|---|
set[str]: Names with which is plugin compatible. |
Source code in client/ayon_core/pipeline/load/plugins.py
155 156 157 158 159 160 161 162 163 164 165 166 |
|
has_valid_extension(repre_entity)
classmethod
Has representation document valid extension for loader.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
repre_entity | dict[str, Any] | Representation entity. | required |
Returns:
Name | Type | Description |
---|---|---|
bool | Representation has valid extension |
Source code in client/ayon_core/pipeline/load/plugins.py
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 |
|
is_compatible_loader(context)
classmethod
Return whether a loader is compatible with a context.
On override make sure it is overridden as class or static method.
This checks the product type and the representation for the given loader plugin.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
context | dict[str, Any] | Documents of context for which should be loader used. | required |
Returns:
Name | Type | Description |
---|---|---|
bool | Is loader compatible for context. |
Source code in client/ayon_core/pipeline/load/plugins.py
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 |
|
load(context, name=None, namespace=None, options=None)
Load asset via database
Parameters:
Name | Type | Description | Default |
---|---|---|---|
context | dict | Full parenthood of representation to load | required |
name | str | Use pre-defined name | None |
namespace | str | Use pre-defined namespace | None |
options | dict | Additional settings dictionary | None |
Source code in client/ayon_core/pipeline/load/plugins.py
172 173 174 175 176 177 178 179 180 181 182 183 |
|
remove(container)
Remove a container
Parameters:
Name | Type | Description | Default |
---|---|---|---|
container | avalon - core | container-1.0): Container to remove, from | required |
Returns:
Name | Type | Description |
---|---|---|
bool | Whether the container was deleted |
Source code in client/ayon_core/pipeline/load/plugins.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
|
update(container, context)
Update container
to representation
Parameters:
Name | Type | Description | Default |
---|---|---|---|
container | avalon - core | container-1.0): Container to update, from | required |
context | dict | Update the container to this representation. | required |
Source code in client/ayon_core/pipeline/load/plugins.py
185 186 187 188 189 190 191 192 193 194 195 |
|
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 |
|
ProductLoaderPlugin
Bases: LoaderPlugin
Load product into host application Arguments: context (dict): avalon-core:context-1.0 name (str, optional): Use pre-defined name namespace (str, optional): Use pre-defined namespace
Source code in client/ayon_core/pipeline/load/plugins.py
258 259 260 261 262 263 264 |
|
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 |
|
get_current_host_name()
Current host name.
Function is based on currently registered host integration or environment variable 'AYON_HOST_NAME'.
Returns:
Type | Description |
---|---|
Union[str, None]: Name of host integration in current process or None. |
Source code in client/ayon_core/pipeline/context_tools.py
295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
|
get_global_context()
Global context defined in environment variables.
Values here may not reflect current context of host integration. The function can be used on startup before a host is registered.
Use 'get_current_context' to make sure you'll get current host integration context info.
Example::
{
"project_name": "Commercial",
"folder_path": "Bunny",
"task_name": "Animation",
}
Returns:
Type | Description |
---|---|
dict[str, Union[str, None]]: Context defined with environment variables. |
Source code in client/ayon_core/pipeline/context_tools.py
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 |
|
get_process_id()
Fake process id created on demand using uuid.
Can be used to create process specific folders in temp directory.
Returns:
Name | Type | Description |
---|---|---|
str | Process id. |
Source code in client/ayon_core/pipeline/context_tools.py
569 570 571 572 573 574 575 576 577 578 579 580 581 |
|
get_repres_contexts(representation_ids, project_name=None)
Return parenthood context for representation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
representation_ids | list | The representation ids. | required |
project_name | Optional[str] | Project name. | None |
Returns:
Name | Type | Description |
---|---|---|
dict | The full representation context by representation id. keys are repre_id, value is dictionary with entities of folder, product, version and representation. |
Source code in client/ayon_core/pipeline/load/utils.py
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 |
|
get_representation_context(project_name, representation)
Return parenthood context for representation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_name | str | Project name. | required |
representation | Union[dict[str, Any], str] | Representation entity or representation id. | required |
Returns:
Type | Description |
---|---|
dict[str, dict[str, Any]]: The full representation context. |
Raises:
Type | Description |
---|---|
ValueError | When representation is invalid or parents were not found. |
Source code in client/ayon_core/pipeline/load/utils.py
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 |
|
get_representation_path(representation, root=None)
Get filename from representation document
There are three ways of getting the path from representation which are tried in following sequence until successful. 1. Get template from representation['data']['template'] and data from representation['context']. Then format template with the data. 2. Get template from project['config'] and format it with default data set 3. Get representation['data']['path'] and use it directly
Parameters:
Name | Type | Description | Default |
---|---|---|---|
representation(dict) | representation document from the database | required |
Returns:
Name | Type | Description |
---|---|---|
str | fullpath of the representation |
Source code in client/ayon_core/pipeline/load/utils.py
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 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 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 |
|
get_staging_dir_info(project_entity, folder_entity, task_entity, product_type, product_name, host_name, anatomy=None, project_settings=None, template_data=None, always_return_path=True, force_tmp_dir=False, logger=None, prefix=None, suffix=None, username=None)
Get staging dir info data.
If force_temp
is set, staging dir will be created as tempdir. If always_get_some_dir
is set, staging dir will be created as tempdir if no staging dir profile is found. If prefix
or suffix
is not set, default values will be used.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_entity | Dict[str, Any] | Project entity. | required |
folder_entity | Optional[Dict[str, Any]] | Folder entity. | required |
task_entity | Optional[Dict[str, Any]] | Task entity. | required |
product_type | str | Type of product. | required |
product_name | str | Name of product. | required |
host_name | str | Name of host. | required |
anatomy | Optional[Anatomy] | Anatomy object. | None |
project_settings | Optional[Dict[str, Any]] | Prepared project settings. | None |
template_data | Optional[Dict[str, Any]] | Additional data for formatting staging dir template. | None |
always_return_path | Optional[bool] | If True, staging dir will be created as tempdir if no staging dir profile is found. Input value False will return None if no staging dir profile is found. | True |
force_tmp_dir | Optional[bool] | If True, staging dir will be created as tempdir. | False |
logger | Optional[Logger] | Logger instance. | None |
suffix | Optional[str] | Optional suffix for staging dir name. | None |
username | Optional[str] | AYON Username. | None |
Returns:
Type | Description |
---|---|
Optional[StagingDir] | Optional[StagingDir]: Staging dir info data |
Source code in client/ayon_core/pipeline/staging_dir.py
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 |
|
get_temp_dir(project_name, anatomy=None, prefix=None, suffix=None, use_local_temp=False)
Get temporary dir path.
If use_local_temp
is set, tempdir will be created in local tempdir. If anatomy
is not set, default anatomy will be used. If prefix
or suffix
is not set, default values will be used.
It also supports AYON_TMPDIR
, so studio can define own temp shared repository per project or even per more granular context. Template formatting is supported also with optional keys. Folder is created in case it doesn't exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_name | str | Name of project. | required |
anatomy | Optional[Anatomy] | Project Anatomy object. | None |
suffix | Optional[str] | Suffix for tempdir. | None |
prefix | Optional[str] | Prefix for tempdir. | None |
use_local_temp | Optional[bool] | If True, temp dir will be created in local tempdir. | False |
Returns:
Name | Type | Description |
---|---|---|
str | Path to staging dir of instance. |
Source code in client/ayon_core/pipeline/tempdir.py
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 |
|
install_ayon_plugins(project_name=None, host_name=None)
Install AYON core plugins and make sure the core is initialized.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_name | Optional[str] | Name of project to install plugins for. | None |
host_name | Optional[str] | Name of host to install plugins for. | None |
Source code in client/ayon_core/pipeline/context_tools.py
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 |
|
install_host(host)
Install host
into the running Python session.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host | HostBase | A host interface object. | required |
Source code in client/ayon_core/pipeline/context_tools.py
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 |
|
is_installed()
Return state of installation
Returns:
Type | Description |
---|---|
True if installed, False otherwise |
Source code in client/ayon_core/pipeline/context_tools.py
261 262 263 264 265 266 267 268 269 |
|
load_container(Loader, representation, namespace=None, name=None, options=None, **kwargs)
Use Loader to load a representation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Loader | Loader | The loader class to trigger. | required |
representation | str or dict | The representation id or full representation as returned by the database. | required |
namespace | (str, Optional) | The namespace to assign. Defaults to None. | None |
name | (str, Optional) | The name to assign. Defaults to product name. | None |
options | (dict, Optional) | Additional options to pass on to the loader. | None |
Returns:
Type | Description |
---|---|
The return of the |
Raises:
Type | Description |
---|---|
IncompatibleLoaderError | When the loader is not compatible with the representation. |
Source code in client/ayon_core/pipeline/load/utils.py
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 |
|
loaders_from_representation(loaders, representation)
Return all compatible loaders for a representation.
Source code in client/ayon_core/pipeline/load/utils.py
910 911 912 913 914 915 916 917 918 |
|
register_host(host)
Register a new host for the current process
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host | ModuleType | A module implementing the Host API interface. See the Host API documentation for details on what is required, or browse the source code. | required |
Source code in client/ayon_core/pipeline/context_tools.py
272 273 274 275 276 277 278 279 280 281 282 283 |
|
register_root(path)
Register currently active root
Source code in client/ayon_core/pipeline/context_tools.py
76 77 78 79 |
|
registered_host()
Return currently registered host
Source code in client/ayon_core/pipeline/context_tools.py
286 287 288 |
|
registered_root()
Return registered roots from current project anatomy.
Consider this does return roots only for current project and current platforms, only if host was installer using 'install_host'.
Deprecated
Please use project 'Anatomy' to get roots. This function is still used at current core functions of load logic, but that will change in future and this function will be removed eventually. Using this function at new places can cause problems in the future.
Returns:
Type | Description |
---|---|
dict[str, str]: Root paths. |
Source code in client/ayon_core/pipeline/context_tools.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
remove_container(container)
Remove a container
Source code in client/ayon_core/pipeline/load/utils.py
450 451 452 453 454 455 456 457 458 459 460 |
|
switch_container(container, representation, loader_plugin=None)
Switch a container to representation
Parameters:
Name | Type | Description | Default |
---|---|---|---|
container | dict | container information | required |
representation | dict | representation entity | required |
Returns:
Type | Description |
---|---|
function call |
Source code in client/ayon_core/pipeline/load/utils.py
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 |
|
uninstall_host()
Undo all of what install()
did
Source code in client/ayon_core/pipeline/context_tools.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
update_container(container, version=-1)
Update a container
Source code in client/ayon_core/pipeline/load/utils.py
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 552 553 554 555 556 557 558 559 |
|