capture
Maya Capture
Playblasting with independent viewport, camera and display options
apply_scene(**options)
Apply options from scene
Example
apply_scene({"start_frame": 1009})
Parameters:
Name | Type | Description | Default |
---|---|---|---|
options | dict | Scene options | {} |
Source code in client/ayon_maya/vendor/python/capture.py
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 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 |
|
apply_view(panel, **options)
Apply options to panel
Source code in client/ayon_maya/vendor/python/capture.py
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 |
|
capture(camera=None, width=None, height=None, filename=None, start_frame=None, end_frame=None, frame=None, format='qt', compression='H.264', quality=100, off_screen=False, viewer=True, show_ornaments=True, sound=None, isolate=None, maintain_aspect_ratio=True, overwrite=False, frame_padding=4, raw_frame_numbers=False, camera_options=None, display_options=None, viewport_options=None, viewport2_options=None, complete_filename=None, log=None)
Playblast in an independent panel
Parameters:
Name | Type | Description | Default |
---|---|---|---|
camera | str | Name of camera, defaults to "persp" | None |
width | int | Width of output in pixels | None |
height | int | Height of output in pixels | None |
filename | str | Name of output file. If none is specified, no files are saved. | None |
start_frame | float | Defaults to current start frame. | None |
end_frame | float | Defaults to current end frame. | None |
frame | float or tuple | A single frame or list of frames. Use this to capture a single frame or an arbitrary sequence of frames. | None |
format | str | Name of format, defaults to "qt". | 'qt' |
compression | str | Name of compression, defaults to "H.264" | 'H.264' |
quality | int | The quality of the output, defaults to 100 | 100 |
off_screen | bool | Whether or not to playblast off screen | False |
viewer | bool | Display results in native player | True |
show_ornaments | bool | Whether or not model view ornaments (e.g. axis icon, grid and HUD) should be displayed. | True |
sound | str | Specify the sound node to be used during playblast. When None (default) no sound will be used. | None |
isolate | list | List of nodes to isolate upon capturing | None |
maintain_aspect_ratio | bool | Modify height in order to maintain aspect ratio. | True |
overwrite | bool | Whether or not to overwrite if file already exists. If disabled and file exists and error will be raised. | False |
frame_padding | bool | Number of zeros used to pad file name for image sequences. | 4 |
raw_frame_numbers | bool | Whether or not to use the exact frame numbers from the scene or capture to a sequence starting at zero. Defaults to False. When set to True | False |
camera_options | dict | Supplied camera options, using | None |
display_options | dict | Supplied display options, using | None |
viewport_options | dict | Supplied viewport options, using | None |
viewport2_options | dict | Supplied display options, using | None |
complete_filename | str | Exact name of output file. Use this to override the output of | None |
log | logger | pass logger for logging messages. | None |
Example
Launch default capture
capture()
Launch capture with custom viewport settings
capture('persp', 800, 600, ... viewport_options={ ... "displayAppearance": "wireframe", ... "grid": False, ... "polymeshes": True, ... }, ... camera_options={ ... "displayResolution": True ... } ... )
Source code in client/ayon_maya/vendor/python/capture.py
24 25 26 27 28 29 30 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 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 |
|
parse_active_panel()
Parse the active modelPanel.
Raises RuntimeError: When no active modelPanel an error is raised.
Returns:
Name | Type | Description |
---|---|---|
str | Name of modelPanel |
Source code in client/ayon_maya/vendor/python/capture.py
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
|
parse_active_scene()
Parse active scene for arguments for capture()
*Resolution taken from render settings.
Source code in client/ayon_maya/vendor/python/capture.py
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 |
|
parse_active_view()
Parse the current settings from the active view
Source code in client/ayon_maya/vendor/python/capture.py
446 447 448 449 |
|
parse_view(panel)
Parse the scene, panel and camera for their current settings
Example
parse_view("modelPanel1")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
panel | str | Name of modelPanel | required |
Source code in client/ayon_maya/vendor/python/capture.py
452 453 454 455 456 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 |
|
snap(*args, **kwargs)
Single frame playblast in an independent panel.
The arguments of capture
are all valid here as well, except for start_frame
and end_frame
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
frame | float | The frame to snap. If not provided current frame is used. | required |
clipboard | bool | Whether to add the output image to the global clipboard. This allows to easily paste the snapped image into another application, eg. into Photoshop. | required |
Keywords
See capture
.
Source code in client/ayon_maya/vendor/python/capture.py
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 277 278 279 280 281 282 |
|