Project related George functions¶
Project related George functions and enums.
TVPProject(id: str, path: Path, width: int, height: int, pixel_aspect_ratio: float, frame_rate: float, field_order: FieldOrder = FieldOrder.NONE, start_frame: int = 0)
dataclass
¶
TVPaint project info values.
id: str = field(metadata={'parsed': False})
class-attribute
instance-attribute
¶
path: Path
instance-attribute
¶
width: int
instance-attribute
¶
height: int
instance-attribute
¶
pixel_aspect_ratio: float
instance-attribute
¶
frame_rate: float
instance-attribute
¶
field_order: FieldOrder = FieldOrder.NONE
class-attribute
instance-attribute
¶
start_frame: int = 0
class-attribute
instance-attribute
¶
BackgroundMode
¶
tv_project_info(project_id: str) -> TVPProject
¶
Get info of the given project.
Raises:
| Type | Description |
|---|---|
pytvpaint.george.exceptions.NoObjectWithIdError
|
if given an invalid project id |
Source code in pytvpaint/george/grg_project.py
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 | |
tv_background_get() -> tuple[BackgroundMode, tuple[RGBColor, RGBColor] | RGBColor | None]
¶
Get the background mode of the project, and the color(s) if in color or check mode.
Returns:
| Name | Type | Description |
|---|---|---|
mode |
pytvpaint.george.grg_project.BackgroundMode
|
the background mode |
colors |
tuple[pytvpaint.george.grg_base.RGBColor, pytvpaint.george.grg_base.RGBColor] | pytvpaint.george.grg_base.RGBColor | None
|
the background colors if any |
Source code in pytvpaint/george/grg_project.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
tv_background_set(mode: BackgroundMode, color: tuple[RGBColor, RGBColor] | RGBColor | None = None) -> None
¶
Set the background mode of the project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
pytvpaint.george.grg_project.BackgroundMode
|
color mode (None, checker or one color) |
required |
color
|
tuple[pytvpaint.george.grg_base.RGBColor, pytvpaint.george.grg_base.RGBColor] | pytvpaint.george.grg_base.RGBColor | None
|
None for None mode, RBGColor for one color, and tuple of RGBColors for checker |
None
|
Source code in pytvpaint/george/grg_project.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
tv_project_new(project_path: Path | str, width: int = 1920, height: int = 1080, pixel_aspect_ratio: float = 1.0, frame_rate: float = 24.0, field_order: FieldOrder = FieldOrder.NONE, start_frame: int = 1) -> str
¶
Create a new project.
Raises:
| Type | Description |
|---|---|
pytvpaint.george.exceptions.GeorgeError
|
if an error occurred during the project creation |
Source code in pytvpaint/george/grg_project.py
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 | |
tv_load_project(project_path: Path | str, silent: bool = False) -> str
¶
Load a file as a project if possible or open Import panel.
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
if the project file doesn't exist |
pytvpaint.george.exceptions.GeorgeError
|
if the provided file is in an invalid format |
Source code in pytvpaint/george/grg_project.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
tv_save_project(project_path: Path | str) -> None
¶
Save the current project as tvpp.
Source code in pytvpaint/george/grg_project.py
178 179 180 181 182 183 184 185 186 187 | |
tv_project_duplicate() -> None
¶
Duplicate the current project.
Raises:
| Type | Description |
|---|---|
pytvpaint.george.exceptions.GeorgeError
|
if an error occurred during the project creation. |
Source code in pytvpaint/george/grg_project.py
190 191 192 193 194 195 196 197 | |
tv_project_enum_id(position: int) -> str
¶
Get the id of the project at the given position.
Raises:
| Type | Description |
|---|---|
pytvpaint.george.exceptions.GeorgeError
|
if no project found at the provided position. |
Source code in pytvpaint/george/grg_project.py
200 201 202 203 204 205 206 207 | |
tv_project_current_id() -> str
¶
Get the id of the current project.
Source code in pytvpaint/george/grg_project.py
210 211 212 | |
tv_get_project_name() -> str
¶
Returns the save path of the current project.
Source code in pytvpaint/george/grg_project.py
215 216 217 | |
tv_project_select(project_id: str) -> str
¶
Make the given project current.
Source code in pytvpaint/george/grg_project.py
220 221 222 | |
tv_project_close(project_id: str) -> None
¶
Close the given project.
Source code in pytvpaint/george/grg_project.py
225 226 227 | |
tv_resize_project(width: int, height: int) -> None
¶
Resize the current project.
Note
creates a resized copy of the project with a new id
Source code in pytvpaint/george/grg_project.py
230 231 232 233 234 235 236 | |
tv_resize_page(width: int, height: int, resize_opt: ResizeOption) -> None
¶
Create a new resized project and close the current one.
Source code in pytvpaint/george/grg_project.py
239 240 241 | |
tv_get_width() -> int
¶
Get the current project width.
Source code in pytvpaint/george/grg_project.py
244 245 246 | |
tv_get_height() -> int
¶
Get the current project height.
Source code in pytvpaint/george/grg_project.py
249 250 251 | |
tv_ratio() -> float
¶
Get the current project pixel aspect ratio.
Bug
Doesn't work and always returns an empty string
Source code in pytvpaint/george/grg_project.py
254 255 256 257 258 259 260 | |
tv_get_field() -> FieldOrder
¶
Get the current project field mode.
Source code in pytvpaint/george/grg_project.py
263 264 265 | |
tv_project_save_sequence(export_path: Path | str, use_camera: bool = False, start: int | None = None, end: int | None = None) -> None
¶
Save the current project.
Source code in pytvpaint/george/grg_project.py
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | |
tv_project_render_camera(project_id: str) -> str
¶
Render the given project's camera view to a new project.
Returns:
| Type | Description |
|---|---|
str
|
the new project id |
Source code in pytvpaint/george/grg_project.py
290 291 292 293 294 295 296 297 298 299 300 | |
tv_frame_rate_get() -> tuple[float, float]
¶
Get the framerate of the current project.
Source code in pytvpaint/george/grg_project.py
303 304 305 306 307 308 309 310 311 312 313 | |
tv_frame_rate_set(frame_rate: float, time_stretch: bool = False, preview: bool = False) -> None
¶
Get the framerate of the current project.
Source code in pytvpaint/george/grg_project.py
316 317 318 319 320 321 322 323 324 | |
tv_frame_rate_project_set(frame_rate: float, time_stretch: bool = False) -> None
¶
Set the framerate of the current project.
Source code in pytvpaint/george/grg_project.py
327 328 329 330 331 332 | |
tv_frame_rate_preview_set(frame_rate: float) -> None
¶
Set the framerate of the preview (playback).
Source code in pytvpaint/george/grg_project.py
335 336 337 | |
tv_project_current_frame_get() -> int
¶
Get the current frame of the current project.
Source code in pytvpaint/george/grg_project.py
340 341 342 | |
tv_project_current_frame_set(frame: int) -> int
¶
Set the current frame of the current project.
Note
this is relative to the current clip markin
Source code in pytvpaint/george/grg_project.py
345 346 347 348 349 350 351 | |
tv_load_palette(palette_path: Path | str) -> None
¶
Load a palette(s) from a file/directory.
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
if palette was not found at the provided path |
Source code in pytvpaint/george/grg_project.py
354 355 356 357 358 359 360 361 362 363 | |
tv_save_palette(palette_path: Path | str) -> None
¶
Save the current palette.
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
if palette save directory doesn't exist |
Source code in pytvpaint/george/grg_project.py
366 367 368 369 370 371 372 373 374 375 376 377 378 | |
tv_project_save_video_dependencies(project_id: str, on_save: bool = True, now: bool = False) -> int
¶
Saves current project video dependencies.
Source code in pytvpaint/george/grg_project.py
381 382 383 384 385 386 | |
tv_project_save_audio_dependencies(project_id: str, on_save: bool = True) -> int
¶
Saves current project audio dependencies.
Source code in pytvpaint/george/grg_project.py
389 390 391 392 393 394 395 396 397 398 | |
tv_sound_project_info(project_id: str, track_index: int) -> TVPSound
¶
Get information about a project soundtrack.
Source code in pytvpaint/george/grg_project.py
401 402 403 404 405 | |
tv_sound_project_new(sound_path: Path | str) -> None
¶
Add a new soundtrack to the current project.
Source code in pytvpaint/george/grg_project.py
408 409 410 411 412 413 414 | |
tv_sound_project_remove(track_index: int) -> None
¶
Remove a soundtrack from the current project.
Source code in pytvpaint/george/grg_project.py
417 418 419 | |
tv_sound_project_reload(project_id: str, track_index: int) -> None
¶
Reload a project soundtracks file.
Source code in pytvpaint/george/grg_project.py
422 423 424 425 426 427 428 429 | |
tv_sound_project_adjust(track_index: int, mute: bool | None = None, volume: float | None = None, offset: float | None = None, fade_in_start: float | None = None, fade_in_stop: float | None = None, fade_out_start: float | None = None, fade_out_stop: float | None = None, color_index: int | None = None) -> None
¶
Change the current project's soundtrack settings.
Source code in pytvpaint/george/grg_project.py
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 | |
tv_project_header_info_get(project_id: str) -> str
¶
Get the project header info.
Raises:
| Type | Description |
|---|---|
pytvpaint.george.exceptions.NoObjectWithIdError
|
if given an invalid project id |
Source code in pytvpaint/george/grg_project.py
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 | |
tv_project_header_info_set(project_id: str, text: str) -> None
¶
Set the project header info.
Raises:
| Type | Description |
|---|---|
pytvpaint.george.exceptions.NoObjectWithIdError
|
if given an invalid project id |
Source code in pytvpaint/george/grg_project.py
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 | |
tv_project_header_author_get(project_id: str) -> str
¶
Get the project author info.
Raises:
| Type | Description |
|---|---|
pytvpaint.george.exceptions.NoObjectWithIdError
|
if given an invalid project id |
Source code in pytvpaint/george/grg_project.py
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 | |
tv_project_header_author_set(project_id: str, text: str) -> None
¶
Set the project author info.
Raises:
| Type | Description |
|---|---|
pytvpaint.george.exceptions.NoObjectWithIdError
|
if given an invalid project id |
Source code in pytvpaint/george/grg_project.py
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | |
tv_project_header_notes_get(project_id: str) -> str
¶
Get the project notes.
Raises:
| Type | Description |
|---|---|
pytvpaint.george.exceptions.NoObjectWithIdError
|
if given an invalid project id |
Source code in pytvpaint/george/grg_project.py
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
tv_project_header_notes_set(project_id: str, text: str) -> None
¶
Set the project notes.
Raises:
| Type | Description |
|---|---|
pytvpaint.george.exceptions.NoObjectWithIdError
|
if given an invalid project id |
Source code in pytvpaint/george/grg_project.py
550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 | |
tv_start_frame_get() -> int
¶
Get the start frame of the current project.
Source code in pytvpaint/george/grg_project.py
568 569 570 | |
tv_start_frame_set(start_frame: int) -> int
¶
Set the start frame of the current project.
Source code in pytvpaint/george/grg_project.py
573 574 575 | |