pipeline
TVPAINT_CHUNK_LENGTH = 500
module-attribute
TVPaint's Metadata
Metadata are stored to TVPaint's workfile.
Workfile works similar to .ini file but has few limitation. Most important limitation is that value under key has limited length. Due to this limitation each metadata section/key stores number of "subkeys" that are related to the section.
Example: Metadata key "instances"
may have stored value "2". In that case it is expected that there are also keys ["instances0", "instances1"]
.
Workfile data looks like:
[avalon]
instances0=[{{__dq__}id{__dq__}: {__dq__}ayon.create.instance{__dq__...
instances1=...more data...
instances=2
TVPaintHost
Bases: HostBase
, IWorkfileHost
, ILoadHost
, IPublishHost
Source code in client/ayon_tvpaint/api/pipeline.py
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 |
|
application_exit()
Logic related to TimerManager.
Todo
This should be handled out of TVPaint integration logic.
Source code in client/ayon_tvpaint/api/pipeline.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
|
get_current_folder_path()
Returns:
Type | Description |
---|---|
Union[str, None]: Current folder path. |
Source code in client/ayon_tvpaint/api/pipeline.py
100 101 102 103 104 105 106 |
|
get_current_project_name()
Returns:
Type | Description |
---|---|
Union[str, None]: Current project name. |
Source code in client/ayon_tvpaint/api/pipeline.py
92 93 94 95 96 97 98 |
|
get_current_task_name()
Returns:
Type | Description |
---|---|
Union[str, None]: Current task name. |
Source code in client/ayon_tvpaint/api/pipeline.py
108 109 110 111 112 113 114 |
|
install()
Install TVPaint-specific functionality.
Source code in client/ayon_tvpaint/api/pipeline.py
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 |
|
list_instances()
List all created instances from current workfile.
Source code in client/ayon_tvpaint/api/pipeline.py
139 140 141 |
|
containerise(name, namespace, members, context, loader, current_containers=None)
Add new container to metadata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | Container name. | required |
namespace | str | Container namespace. | required |
members | list | List of members that were loaded and belongs to the container (layer names). | required |
current_containers | list | Preloaded containers. Should be used only on update/switch when containers were modified during the process. | None |
Returns:
Name | Type | Description |
---|---|---|
dict | Container data stored to workfile metadata. |
Source code in client/ayon_tvpaint/api/pipeline.py
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 |
|
get_current_workfile_context()
Return context in which was workfile saved.
Source code in client/ayon_tvpaint/api/pipeline.py
467 468 469 |
|
get_workfile_metadata(metadata_key, default=None)
Read and parse metadata for specific key from current project workfile.
Pipeline use function to store loaded and created instances within keys stored in SECTION_NAME_INSTANCES
and SECTION_NAME_CONTAINERS
constants.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata_key | str | Key defying which key should read. It is expected value contain json serializable string. | required |
Source code in client/ayon_tvpaint/api/pipeline.py
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 |
|
get_workfile_metadata_string(metadata_key)
Read metadata for specific key from current project workfile.
Source code in client/ayon_tvpaint/api/pipeline.py
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 |
|
get_workfile_metadata_string_for_keys(metadata_keys)
Read metadata for specific keys from current project workfile.
All values from entered keys are stored to single string without separator.
Function is designed to help get all values for one metadata key at once. So order of passed keys matteres.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata_keys | (list, str) | Metadata keys for which data should be retrieved. Order of keys matters! It is possible to enter only single key as string. | required |
Source code in client/ayon_tvpaint/api/pipeline.py
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 |
|
list_instances()
List all created instances from current workfile.
Source code in client/ayon_tvpaint/api/pipeline.py
477 478 479 |
|
save_current_workfile_context(context)
Save context which was used to create a workfile.
Source code in client/ayon_tvpaint/api/pipeline.py
472 473 474 |
|
set_context_settings(context_entity)
Set workfile settings by folder entity attributes.
Change fps, resolution and frame start/end.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
context_entity | dict[str, Any] | Task or folder entity. | required |
Source code in client/ayon_tvpaint/api/pipeline.py
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 |
|
split_metadata_string(text, chunk_length=None)
Split string by length.
Split text to chunks by entered length. Example: python text = "ABCDEFGHIJKLM" result = split_metadata_string(text, 3) print(result) >>> ['ABC', 'DEF', 'GHI', 'JKL']
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text | str | Text that will be split into chunks. | required |
chunk_length | int | Single chunk size. Default chunk_length is set to global variable | None |
Returns:
Name | Type | Description |
---|---|---|
list | List of strings with at least one item. |
Source code in client/ayon_tvpaint/api/pipeline.py
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 |
|
write_workfile_metadata(metadata_key, value)
Write metadata for specific key into current project workfile.
George script has specific way how to work with quotes which should be solved automatically with this function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
metadata_key | str | Key defying under which key value will be stored. | required |
value | (dict, list, str) | Data to store they must be json serializable. | required |
Source code in client/ayon_tvpaint/api/pipeline.py
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 |
|