pipeline
BlenderHost
Bases: HostBase, IWorkfileHost, IPublishHost, ILoadHost
Source code in client/ayon_blender/api/pipeline.py
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 | |
get_containers()
List containers from active Blender scene.
Source code in client/ayon_blender/api/pipeline.py
88 89 90 | |
get_context_data()
Override abstract method from IPublishHost. Get global data related to creation-publishing from workfile.
Returns:
| Name | Type | Description |
|---|---|---|
dict | dict | Context data stored using 'update_context_data'. |
Source code in client/ayon_blender/api/pipeline.py
151 152 153 154 155 156 157 158 159 160 161 | |
get_current_workfile()
Override get_current_workfile method from IWorkfileHost. Retrieve currently opened workfile path.
Returns:
| Name | Type | Description |
|---|---|---|
str | str | Path to currently opened workfile. |
Source code in client/ayon_blender/api/pipeline.py
120 121 122 123 124 125 126 127 | |
get_workfile_extensions()
Override get_workfile_extensions method from IWorkfileHost. Get workfile possible extensions.
Returns:
| Type | Description |
|---|---|
List[str] | List[str]: Workfile extensions. |
Source code in client/ayon_blender/api/pipeline.py
92 93 94 95 96 97 98 99 | |
install()
Override install method from HostBase. Install Blender host functionality.
Source code in client/ayon_blender/api/pipeline.py
83 84 85 86 | |
open_workfile(filepath)
Override open_workfile method from IWorkfileHost. Open workfile at specified filepath in the host.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath | str | Path to workfile. | required |
Source code in client/ayon_blender/api/pipeline.py
111 112 113 114 115 116 117 118 | |
save_workfile(dst_path=None)
Override save_workfile method from IWorkfileHost. Save currently opened workfile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dst_path | str | Where the current scene should be saved. Or use current path if | None |
Source code in client/ayon_blender/api/pipeline.py
101 102 103 104 105 106 107 108 109 | |
update_context_data(data, changes)
Override abstract method from IPublishHost. Store global context data to workfile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data | dict | New data as are. | required |
changes | dict | Only data that has been changed. Each value has tuple with '( | required |
Source code in client/ayon_blender/api/pipeline.py
163 164 165 166 167 168 169 170 171 172 | |
work_root(session)
Override work_root method from IWorkfileHost. Modify workdir per host.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session | dict | Session context data. | required |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | Path to new workdir. |
Source code in client/ayon_blender/api/pipeline.py
139 140 141 142 143 144 145 146 147 148 149 | |
workfile_has_unsaved_changes()
Override wokfile_has_unsaved_changes method from IWorkfileHost. Returns True if opened workfile has no unsaved changes.
Returns:
| Name | Type | Description |
|---|---|---|
bool | bool | True if scene is saved and False if it has unsaved modifications. |
Source code in client/ayon_blender/api/pipeline.py
129 130 131 132 133 134 135 136 137 | |
add_to_ayon_container(container)
Add the container (object or collection) to the AYON container.
Source code in client/ayon_blender/api/pipeline.py
531 532 533 534 535 536 537 538 539 | |
containerise(name, namespace, nodes, context, loader=None, suffix='CON')
Bundle nodes into an assembly and imprint it with metadata
Containerisation enables a tracking of version, author and origin for loaded assets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | Name of resulting assembly | required |
namespace | str | Namespace under which to host container | required |
nodes | List | Long names of nodes to containerise | required |
context | Dict | Asset information | required |
loader | Optional[str] | Name of loader used to produce this container. | None |
suffix | Optional[str] | Suffix of container, defaults to | 'CON' |
Returns:
| Type | Description |
|---|---|
Collection | The container assembly |
Source code in client/ayon_blender/api/pipeline.py
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 | |
containerise_existing(container, name, namespace, context, loader=None, suffix='CON')
Imprint or update container with metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | Name of resulting assembly | required |
namespace | str | Namespace under which to host container | required |
context | Dict | Asset information | required |
loader | Optional[str] | Name of loader used to produce this container. | None |
suffix | Optional[str] | Suffix of container, defaults to | 'CON' |
Returns:
| Type | Description |
|---|---|
Collection | The container assembly |
Source code in client/ayon_blender/api/pipeline.py
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 | |
ensure_ayon_container()
Ensure AYON_CONTAINERS exists and is ready for use.
Source code in client/ayon_blender/api/pipeline.py
567 568 569 570 571 572 573 574 575 576 577 578 | |
get_ayon_container()
Get Ayon Container
Returns:
| Type | Description |
|---|---|
Collection | bpy.types.Collection: Ayon containers collection |
Source code in client/ayon_blender/api/pipeline.py
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | |
get_container_name(name, namespace, context, suffix)
Function to get container name
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | Name of resulting assembly | required |
namespace | str | Namespace under which to host container | required |
context | Dict | Asset information | required |
suffix | str | Suffix of container | required |
Returns:
| Type | Description |
|---|---|
| The name of the container assembly |
Source code in client/ayon_blender/api/pipeline.py
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 | |
get_frame_range(task_entity=None)
Get the task entity's frame range and handles
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_entity | Optional[dict] | Task Entity. When not provided defaults to current context task. | None |
Returns:
| Type | Description |
|---|---|
Union[Dict[str, int], None] | Union[Dict[str, int], None]: Dictionary with frame start, frame end, handle start, handle end. |
Source code in client/ayon_blender/api/pipeline.py
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 | |
install()
Install Blender configuration for AYON.
Source code in client/ayon_blender/api/pipeline.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
ls()
List containers from active Blender scene.
This is the host-equivalent of api.ls(), but instead of listing assets on disk, it lists assets already loaded in Blender; once loaded they are called containers.
Source code in client/ayon_blender/api/pipeline.py
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 | |
metadata_update(node, data)
Imprint the node with metadata.
Existing metadata will be updated.
Source code in client/ayon_blender/api/pipeline.py
581 582 583 584 585 586 587 588 589 590 591 592 | |
on_before_save(event)
Handle the event before saving a Blender file.
When saving to a new scene name, e.g. on incrementing the workfile then update the render paths to match the new scene name by replacing the old scene name with the new one in all render paths.
Source code in client/ayon_blender/api/pipeline.py
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 | |
parse_container(container, validate=True)
Return the container node's full container data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
container | Collection | A container node name. | required |
validate | bool | turn the validation for the container on or off | True |
Returns:
| Type | Description |
|---|---|
Dict | The container schema data for this container node. |
Source code in client/ayon_blender/api/pipeline.py
711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 | |
publish()
Shorthand to publish from within host.
Source code in client/ayon_blender/api/pipeline.py
789 790 791 792 | |
uninstall()
Uninstall Blender configuration for AYON.
Source code in client/ayon_blender/api/pipeline.py
202 203 204 205 206 207 208 209 210 211 212 213 | |