pipeline
Pipeline tools for AYON Zbrush integration.
ZbrushHost
Bases: HostBase, IWorkfileHost, ILoadHost, IPublishHost
Source code in client/ayon_zbrush/api/pipeline.py
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 | |
application_exit()
Logic related to TimerManager.
Todo
This should be handled out of Zbrush integration logic.
Source code in client/ayon_zbrush/api/pipeline.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
get_containers()
Get the data of the containers
Returns:
| Name | Type | Description |
|---|---|---|
list | the list which stores the data of the containers |
Source code in client/ayon_zbrush/api/pipeline.py
140 141 142 143 144 145 146 | |
get_current_folder_path()
Returns:
| Type | Description |
|---|---|
| Union[str, None]: Current folder path. |
Source code in client/ayon_zbrush/api/pipeline.py
63 64 65 66 67 68 69 | |
get_current_project_name()
Returns:
| Type | Description |
|---|---|
| Union[str, None]: Current project name. |
Source code in client/ayon_zbrush/api/pipeline.py
55 56 57 58 59 60 61 | |
get_current_task_name()
Returns:
| Type | Description |
|---|---|
| Union[str, None]: Current task name. |
Source code in client/ayon_zbrush/api/pipeline.py
71 72 73 74 75 76 77 | |
initial_app_launch()
Triggers on launch of the communication server for Zbrush.
Usually this aligns roughly with the start of Zbrush.
Source code in client/ayon_zbrush/api/pipeline.py
148 149 150 151 152 153 154 | |
list_instances()
Get all AYON instances.
Source code in client/ayon_zbrush/api/pipeline.py
131 132 133 134 | |
write_instances(data)
Write all AYON instances
Source code in client/ayon_zbrush/api/pipeline.py
136 137 138 | |
copy_ayon_data(filepath)
Copy any ayon-related data( such as instances, create-context, cotnainers) from the previous workfile to the new one when incrementing and saving workfile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath | str | the workfile path to be saved | required |
Source code in client/ayon_zbrush/api/pipeline.py
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 | |
get_containers()
Function to get the container data
Returns:
| Name | Type | Description |
|---|---|---|
list | list of container data |
Source code in client/ayon_zbrush/api/pipeline.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
get_current_workfile_context()
Function to get the current context data from the related json file in .zbrush_metadata/context folder
The current context data includes thing like project name, folder path and task name.
Returns:
| Name | Type | Description |
|---|---|---|
list | list of context data |
Source code in client/ayon_zbrush/api/pipeline.py
277 278 279 280 281 282 283 284 285 286 287 | |
get_instance_workfile_metadata()
Get instance data from the related metadata json("instances.json") which stores in .zbrush_metadata/{workfile}/instances folder in the project work directory.
Instance data includes the info like the workfile instance and any instances created by the users for publishing.
Returns:
| Name | Type | Description |
|---|---|---|
dict | instance data |
Source code in client/ayon_zbrush/api/pipeline.py
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 | |
get_load_context_metadata()
Get the context data from the related json file ("context.json") which stores in .zbrush_metadata/context folder in the project work directory.
The context data includes the project name, folder path and task name.
Returns:
| Name | Type | Description |
|---|---|---|
list | context data |
Source code in client/ayon_zbrush/api/pipeline.py
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 | |
get_load_workfile_metadata(metadata_key)
Get to load the workfile json metadata(such as creator's context data and container data) which stores in zbrush_metadata/{workfile}/{metadata_key} folder in the project work directory. It mainly supports to the metadata_key below: ZBRUSH_METADATA_CREATE_CONTEXT: loading create_context.json where stores the data with publish_attributes(e.g. whether the optional validator is enabled.) ZBRUSH_SECTION_NAME_CONTAINERS: loading {subset_name}.json where includes all the loaded asset data to the zbrush scene.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata_key | str | name of the metadata key | required |
Returns:
| Name | Type | Description |
|---|---|---|
list | list of metadata(create-context data or container data) |
Source code in client/ayon_zbrush/api/pipeline.py
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 | |
imprint(container, representation_id)
Function to update the container data from the related json file in .zbrushmetadata/{workfile}/container when updating or switching asset(s)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
container | str | container | required |
representation_id | str | representation id | required |
Source code in client/ayon_zbrush/api/pipeline.py
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 | |
remove_container_data(name)
Function to remove the specific container data from {subset_name}.json in .zbrush_metadata/{workfile}/containers folder
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | object name stored in the container | required |
Source code in client/ayon_zbrush/api/pipeline.py
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 | |
remove_tmp_data()
Remove all temporary data which is created by AYON without saving changes when launching Zbrush without enabling skip opening last workfile
Source code in client/ayon_zbrush/api/pipeline.py
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | |
save_current_workfile_context(context)
Save current workfile context data to .zbrush_metadata/{workfile}/key
This persists the current in-memory context to be set for a specific workfile on disk. Usually used on save to persist the local sessions' workfile context on save.
The context data includes things like the project name, folder path, etc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context | dict | context data | required |
Source code in client/ayon_zbrush/api/pipeline.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
tmp_current_file_check()
Function to find the latest .zpr file used by the user in Zbrush.
Returns:
| Name | Type | Description |
|---|---|---|
file_content | str | the filepath in .zpr format. If the filepath does not end with '.zpr' format, it returns None. |
Source code in client/ayon_zbrush/api/pipeline.py
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 | |
write_context_metadata(metadata_key, context)
Write context data into the related json which stores in .zbrush_metadata/key folder in the project work directory.
The context data includes the project name, folder path and task name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata_key | str | metadata key | required |
context | dict | context data | required |
Source code in client/ayon_zbrush/api/pipeline.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 242 243 244 | |
write_load_metadata(data)
Write/Edit the container data into the related json file("{subset_name}.json") which stores in .zbrush_metadata/{workfile}/containers folder. This persists the current in-memory containers data to be set for updating and switching assets in scene inventory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata_key | str | metadata key for container | required |
data | list | list of container data | required |
Source code in client/ayon_zbrush/api/pipeline.py
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 | |
write_workfile_metadata(metadata_key, data=None)
Function to write workfile metadata(such as creator's context data and instance data) in .zbrushmetadata/{workfile}/{metadata_key} folder This persists the current in-memory instance/creator's context data to be set for a specific workfile on disk. Usually used on save to persist updating instance data and context data used in publisher.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata_key | str | metadata key | required |
data | list | metadata. Defaults to None. | None |
Source code in client/ayon_zbrush/api/pipeline.py
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 | |