pipeline
BlenderHost
Bases: HostBase
, IWorkfileHost
, IPublishHost
, ILoadHost
Source code in client/ayon_blender/api/pipeline.py
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 |
|
get_containers()
List containers from active Blender scene.
Source code in client/ayon_blender/api/pipeline.py
74 75 76 |
|
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
137 138 139 140 141 142 143 144 145 146 147 |
|
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
106 107 108 109 110 111 112 113 |
|
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
78 79 80 81 82 83 84 85 |
|
install()
Override install method from HostBase. Install Blender host functionality.
Source code in client/ayon_blender/api/pipeline.py
69 70 71 72 |
|
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
97 98 99 100 101 102 103 104 |
|
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
87 88 89 90 91 92 93 94 95 |
|
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
149 150 151 152 153 154 155 156 157 158 |
|
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
125 126 127 128 129 130 131 132 133 134 135 |
|
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
115 116 117 118 119 120 121 122 123 |
|
add_to_avalon_container(container)
Add the container to the Avalon container.
Source code in client/ayon_blender/api/pipeline.py
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 |
|
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
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 |
|
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
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 |
|
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
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 |
|
install()
Install Blender configuration for Avalon.
Source code in client/ayon_blender/api/pipeline.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
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
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 |
|
metadata_update(node, data)
Imprint the node with metadata.
Existing metadata will be updated.
Source code in client/ayon_blender/api/pipeline.py
485 486 487 488 489 490 491 492 493 494 495 496 |
|
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
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 |
|
publish()
Shorthand to publish from within host.
Source code in client/ayon_blender/api/pipeline.py
658 659 660 661 |
|
uninstall()
Uninstall Blender configuration for Avalon.
Source code in client/ayon_blender/api/pipeline.py
188 189 190 191 192 193 194 195 196 197 198 199 |
|