worker_job
BaseCommand
Bases: ABC
Abstract TVPaint command which can be executed through worker.
Each command must have unique name and implemented 'execute' and 'from_existing' methods.
Command also have id which is created on command creation.
The idea is that command is just a data container on sender side send through server to a worker where is replicated one by one, executed and result sent back to sender through server.
Source code in client/ayon_tvpaint/worker/worker_job.py
31 32 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 |
|
communicator
property
TVPaint communicator.
Available only on worker side.
done
property
Is command done.
id
property
Command id.
name
abstractmethod
property
Command name (must be unique).
parent
property
Parent of command expected type of 'TVPaintCommands'.
command_data()
Raw command data.
Source code in client/ayon_tvpaint/worker/worker_job.py
123 124 125 |
|
execute()
abstractmethod
Execute command on worker side.
Source code in client/ayon_tvpaint/worker/worker_job.py
127 128 129 130 |
|
execute_george(george_script)
Execute george script in TVPaint.
Source code in client/ayon_tvpaint/worker/worker_job.py
138 139 140 |
|
execute_george_through_file(george_script)
Execute george script through temp file in TVPaint.
Source code in client/ayon_tvpaint/worker/worker_job.py
142 143 144 |
|
from_existing(data)
abstractmethod
classmethod
Recreate object based on passed data.
Source code in client/ayon_tvpaint/worker/worker_job.py
132 133 134 135 136 |
|
job_queue_root()
Access to job queue root.
Job queue root is shared access point to files shared across senders and workers.
Source code in client/ayon_tvpaint/worker/worker_job.py
67 68 69 70 71 72 73 74 75 |
|
response_data()
Data send as response to sender.
Source code in client/ayon_tvpaint/worker/worker_job.py
115 116 117 118 119 120 121 |
|
result()
Result of command.
Source code in client/ayon_tvpaint/worker/worker_job.py
111 112 113 |
|
set_done()
Change state of done.
Source code in client/ayon_tvpaint/worker/worker_job.py
103 104 105 |
|
set_result(result)
Set result of executed command.
Source code in client/ayon_tvpaint/worker/worker_job.py
107 108 109 |
|
CollectSceneData
Bases: BaseCommand
Helper command which will collect all useful info about workfile.
Result is dictionary with all layers data, exposure frames by layer ids pre/post behavior of layers by their ids, group information and scene data.
Source code in client/ayon_tvpaint/worker/worker_job.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 275 276 277 278 279 280 281 282 283 284 285 286 287 |
|
ExecuteGeorgeScript
Bases: BaseCommand
Execute multiline george script in TVPaint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
script_lines(list) | Lines that will be executed in george script through temp george file. | required | |
tmp_file_keys(list) | List of formatting keys in george script that require replacement with path to a temp file where result will be stored. The content of file is stored to result by the key. | required | |
root_dir_key(str) | Formatting key that will be replaced in george script with job queue root which can be different on worker side. | required | |
data(dict) | Raw data about command. | required |
Source code in client/ayon_tvpaint/worker/worker_job.py
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 242 243 244 |
|
from_existing(data)
classmethod
Recreate the object from data.
Source code in client/ayon_tvpaint/worker/worker_job.py
238 239 240 241 242 243 244 |
|
ExecuteSimpleGeorgeScript
Bases: BaseCommand
Execute simple george script in TVPaint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
script(str) | Script that will be executed. | required |
Source code in client/ayon_tvpaint/worker/worker_job.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
JobFailed
Bases: Exception
Raised when job was sent and finished unsuccessfully.
Source code in client/ayon_tvpaint/worker/worker_job.py
16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
ProcessTVPaintCommands
Bases: TVPaintCommands
Worker side of TVPaint Commands.
It is expected this object is created only on worker's side from existing data loaded from job.
Workfile path logic is based on 'SenderTVPaintCommands'.
Source code in client/ayon_tvpaint/worker/worker_job.py
457 458 459 460 461 462 463 464 465 466 467 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 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 |
|
communicator
property
Access to TVPaint communicator.
commands_from_data(commands_data)
Recreate command from passed data.
Source code in client/ayon_tvpaint/worker/worker_job.py
486 487 488 489 490 491 492 493 |
|
execute()
Execute commands.
Source code in client/ayon_tvpaint/worker/worker_job.py
522 523 524 525 526 527 528 529 530 531 532 533 |
|
execute_george(george_script)
Helper method to execute george script.
Source code in client/ayon_tvpaint/worker/worker_job.py
495 496 497 |
|
execute_george_through_file(george_script)
Helper method to execute george script through temp file.
Source code in client/ayon_tvpaint/worker/worker_job.py
499 500 501 502 503 504 505 506 507 508 |
|
SenderTVPaintCommands
Bases: TVPaintCommands
Sender implementation of TVPaint Commands.
Source code in client/ayon_tvpaint/worker/worker_job.py
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 411 412 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 442 443 444 445 446 447 448 449 450 451 452 453 454 |
|
commands_data()
Commands data to be able recreate them.
Source code in client/ayon_tvpaint/worker/worker_job.py
392 393 394 395 396 397 |
|
send_job_and_wait()
Send job to workers server and wait for response.
Result of job is stored into the object.
Raises:
Type | Description |
---|---|
JobFailed | When job was finished but not successfully. |
Source code in client/ayon_tvpaint/worker/worker_job.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
|
to_job_data()
Convert commands to job data before sending to workers server.
Source code in client/ayon_tvpaint/worker/worker_job.py
399 400 401 402 403 404 405 |
|
TVPaintCommands
Bases: ABC
Wrapper around TVPaint commands to be able send multiple commands.
Commands may send one or multiple commands at once. Also gives api access for commands info.
Base for sender and receiver which are extending the logic for their purposes. One of differences is preparation of workfile path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workfile(str) | Path to workfile. | required | |
job_queue_module(JobQueueModule) | Object of AYON module JobQueue. | required |
Source code in client/ayon_tvpaint/worker/worker_job.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 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 339 340 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 369 370 371 372 373 |
|
classes_by_name
property
Prepare commands classes for validation and recreation of commands.
It is expected that all commands are defined in this python file so we're looking for all implementation of BaseCommand in globals.
log
property
Access to logger object.
add_command(command)
Add command to process.
Source code in client/ayon_tvpaint/worker/worker_job.py
356 357 358 359 |
|
job_queue_root()
Job queue root for current platform using current settings.
Source code in client/ayon_tvpaint/worker/worker_job.py
319 320 321 |
|
response_data()
Data which should be send from worker.
Source code in client/ayon_tvpaint/worker/worker_job.py
368 369 370 371 372 373 |
|
result()
Result of commands in list in which they were processed.
Source code in client/ayon_tvpaint/worker/worker_job.py
361 362 363 364 365 366 |
|