lib
Host specific functions where host api is connected
PublishAction
Bases: QAction
Action with is showing as menu item
Source code in client/ayon_hiero/api/lib.py
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 | |
add_path_mapping()
This function reads the path mappings from the project settings and adds them to Hiero's path mapping table.
Source code in client/ayon_hiero/api/lib.py
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 | |
apply_colorspace_project()
Apply colorspaces from settings.
Due to not being able to set the project settings through the Python API, we need to do use some dubious code to find the widgets and set them. It is possible to set the project settings without traversing through the widgets but it involves reading the hrox files from disk with XML, so no in-memory support. See https://community.foundry.com/discuss/topic/137771/change-a-project-s-default-color-transform-with-python # noqa for more details.
Source code in client/ayon_hiero/api/lib.py
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 | |
check_inventory_versions(track_items=None)
Actual version color identifier of Loaded containers
Check all track items and filter only Loader nodes for its version. It will get all versions from database and check if the node is having actual version. If not then it will color it to red.
Source code in client/ayon_hiero/api/lib.py
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 | |
create_bin(path=None, project=None)
Create bin in project. If the path is "bin1/bin2/bin3" it will create whole depth and return bin3
Source code in client/ayon_hiero/api/lib.py
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 | |
create_nuke_workfile_clips(nuke_workfiles, seq=None)
nuke_workfiles is list of dictionaries like: [{ 'path': 'P:/Jakub_testy_pipeline/test_v01.nk', 'name': 'test', 'handleStart': 15, # added asymmetrically to handles 'handleEnd': 10, # added asymmetrically to handles "clipIn": 16, "frameStart": 991, "frameEnd": 1023, 'task': 'Comp-tracking', 'work_dir': 'VFX_PR', 'shot': '00010' }]
Source code in client/ayon_hiero/api/lib.py
963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 | |
deprecated(new_destination)
Mark functions as deprecated.
It will result in a warning being emitted when the function is used.
Source code in client/ayon_hiero/api/lib.py
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 | |
get_current_sequence(name=None, new=False)
Get current sequence in context of active project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name (str)[optional] | name of sequence we want to return | required | |
new (bool)[optional] | if we want to create new one | required |
Returns:
| Type | Description |
|---|---|
| hiero.core.Sequence: the sequence object |
Source code in client/ayon_hiero/api/lib.py
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 | |
get_current_track(sequence, name, audio=False)
Get current track in context of active project.
Creates new if none is found.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sequence | Sequence | hiero sequence object | required |
name | str | name of track we want to return | required |
audio (bool)[optional] | switch to AudioTrack | required |
Returns:
| Type | Description |
|---|---|
| hiero.core.Track: the track object |
Source code in client/ayon_hiero/api/lib.py
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 | |
get_main_window()
Acquire Nuke's main window
Source code in client/ayon_hiero/api/lib.py
1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 | |
get_sequence_pattern_and_padding(file)
Return sequence pattern and padding from file
Attributes:
| Name | Type | Description |
|---|---|---|
file | string | basename form path |
Example
Can find file.0001.ext, file.%02d.ext, file.####.ext
Return
string: any matching sequence pattern int: padding of sequence numbering
Source code in client/ayon_hiero/api/lib.py
1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 | |
get_track_ayon_data(track, container_name=None)
Get track's AYON tag data.
Data of legacy (OpenPype) tag are returned if the track does not have AYON tag.
Attributes:
| Name | Type | Description |
|---|---|---|
track | VideoTrack | hiero object |
Returns:
| Name | Type | Description |
|---|---|---|
dict | data found on the AYON tag |
Source code in client/ayon_hiero/api/lib.py
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 | |
get_track_ayon_tag(track, tag_name=AYON_TAG_NAME)
Get AYON track tag created by loader plugin.
Attributes:
| Name | Type | Description |
|---|---|---|
track | VideoTrack | hiero object |
tag_name | str | The tag name. |
Returns:
| Type | Description |
|---|---|
| hiero.core.Tag: hierarchy, orig clip attributes |
Source code in client/ayon_hiero/api/lib.py
454 455 456 457 458 459 460 461 462 463 464 465 | |
get_track_item_tags(track_item)
Get track item tags excluding AYON tag
Attributes:
| Name | Type | Description |
|---|---|---|
trackItem | TrackItem | hiero object |
Returns:
| Type | Description |
|---|---|
| hiero.core.Tag: hierarchy, orig clip attributes |
Source code in client/ayon_hiero/api/lib.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | |
get_track_items(selection=False, sequence_name=None, track_item_name=None, track_name=None, track_type=None, check_enabled=True, check_locked=True, check_tagged=False)
Get all available current timeline track items.
Attribute
selection (list)[optional]: list of selected track items sequence_name (str)[optional]: return only clips from input sequence track_item_name (str)[optional]: return only item with input name track_name (str)[optional]: return only items from track name track_type (str)[optional]: return only items of given type (audio or video) default is video check_enabled (bool)[optional]: ignore disabled if True check_locked (bool)[optional]: ignore locked if True
Return
list or hiero.core.TrackItem: list of track items or single track item
Source code in client/ayon_hiero/api/lib.py
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 | |
get_trackitem_ayon_data(track_item)
Get track item's AYON tag data.
Data of legacy (OpenPype) tag are returned if the track item does not have AYON tag.
Attributes:
| Name | Type | Description |
|---|---|---|
trackItem | TrackItem | hiero object |
Returns:
| Name | Type | Description |
|---|---|---|
dict | data found on the AYON tag |
Source code in client/ayon_hiero/api/lib.py
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 | |
get_trackitem_ayon_tag(track_item, tag_name=AYON_TAG_NAME)
Get AYON track item tag created by creator or loader plugin.
Attributes:
| Name | Type | Description |
|---|---|---|
trackItem | TrackItem | hiero object |
tag_name | str | The tag name. |
Returns:
| Type | Description |
|---|---|
| hiero.core.Tag: hierarchy, orig clip attributes |
Source code in client/ayon_hiero/api/lib.py
504 505 506 507 508 509 510 511 512 513 514 515 | |
imprint(track_item, data=None)
Adding AYON data into a hiero track item tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
track_item | TrackItem | hiero track item object | required |
data | dict | Any data which needs to be imprinted | None |
Examples:
data = { 'folderPath': '/shots/sq020sh0280', 'productBaseType': 'render', 'productName': 'productMain' }
Source code in client/ayon_hiero/api/lib.py
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 | |
launch_workfiles_app(event)
Event for launching workfiles after hiero start
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event | obj | required but unused | required |
Source code in client/ayon_hiero/api/lib.py
623 624 625 626 627 628 629 630 631 | |
remove_legacy_tags(item)
Remove legacy (OpenPype) tags from track or track item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item | Union[TrackItem, VideoTrack] | hiero object | required |
Source code in client/ayon_hiero/api/lib.py
429 430 431 432 433 434 435 436 437 438 | |
set_favorites()
Add context-related favorites to Nuke's file browser.
Favorites are derived from AYON_WORKDIR (or the currently opened workfile path) and split into: - project directory - folder directory - work directory
Important limitations: - Project root detection assumes project_name is present in the path. If the project name is missing, or appears in an unexpected position, derived project paths may be incorrect. - Folder root detection assumes folder_name is present and uniquely identifiable in the path. If the folder name is missing or repeated, derived folder paths may be incorrect.
In short, path derivation is template-dependent and works best when the current context tokens are explicitly represented in the work directory.
Source code in client/ayon_hiero/api/lib.py
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 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 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 | |
set_track_ayon_tag(track, data=None)
Set AYON track tag to input track object.
Attributes:
| Name | Type | Description |
|---|---|---|
track | VideoTrack | hiero object |
Returns:
| Type | Description |
|---|---|
| hiero.core.Tag |
Source code in client/ayon_hiero/api/lib.py
441 442 443 444 445 446 447 448 449 450 451 | |
set_trackitem_ayon_tag(track_item, data=None)
Set AYON track item tag to input track item object.
Attributes:
| Name | Type | Description |
|---|---|---|
track_item | TrackItem | hiero object |
Returns:
| Type | Description |
|---|---|
| hiero.core.Tag |
Source code in client/ayon_hiero/api/lib.py
518 519 520 521 522 523 524 525 526 527 528 | |
setup(console=False, port=None, menu=True)
Setup integration
Registers Pyblish for Hiero plug-ins and appends an item to the File-menu
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
console | bool | Display console with GUI | False |
port | int | Port from which to start looking for an available port to connect with Pyblish QML, default provided by Pyblish Integration. | None |
menu | bool | Display file menu in Hiero. | True |
Source code in client/ayon_hiero/api/lib.py
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 | |
teardown()
Remove integration
Source code in client/ayon_hiero/api/lib.py
834 835 836 837 838 839 840 841 842 843 844 | |