Miscellaneous George functions¶
All George values as enum and functions which are not specific to any TVPaint element.
GrgErrorValue
¶
FieldOrder
¶
RectButton
¶
TVPShape
¶
The shape tools.
Attributes:
Name | Type | Description |
---|---|---|
B_SPLINE |
|
|
BEZIER |
|
|
BEZIER_FILL |
|
|
CAMERA |
|
|
CIRCLE |
|
|
CIRCLE_2PTS |
|
|
CIRCLE_3PTS |
|
|
CIRCLE_FILL |
|
|
CIRCLE_2PTS_FILL |
|
|
CIRCLE_3PTS_FILL |
|
|
CROP |
|
|
CUT_RECT |
|
|
CUT_POLY |
|
|
CUT_FREE_HAND |
|
|
CUT_FLOOD |
|
|
DOT |
|
|
FLOOD |
|
|
FREE_HAND_LINE |
|
|
FREE_HAND_FILL |
|
|
ELLIPSE |
|
|
ELLIPSE_FILL |
|
|
ELLIPSE_2PTS |
|
|
ELLIPSE_2PTS_FILL |
|
|
LINE |
|
|
LINE_FILL |
|
|
PLANNING |
|
|
POSITION |
|
|
RECTANGLE |
|
|
RECTANGLE_FILL |
|
|
SELECT_RECTANGLE |
|
|
SELECT_ELLIPSE |
|
|
SELECT_2PTS |
|
|
SELECT_3PTS |
|
|
SELECT_POLY |
|
|
SELECT_FREE_HAND |
|
|
SELECT_FLOOD |
|
|
SELECT_COLOR |
|
|
SELECT_BEZIER |
|
|
SELECT_B_SPLINE |
|
|
SINGLE_DOT |
|
|
SPLIT_3PTS |
|
|
SPLINE_FILL |
|
|
WARP |
|
|
WRAP |
|
|
ZOOM_IN |
|
|
ZOOM_OUT |
|
|
ZOOM_HAND |
|
|
ZOOM_RECT |
|
ResizeOption
¶
SpriteLayout
¶
AlphaMode
¶
AlphaSaveMode
¶
SaveFormat
¶
All save formats.
Attributes:
Name | Type | Description |
---|---|---|
AVI |
|
|
BMP |
|
|
CINEON |
|
|
DEEP |
|
|
DPX |
|
|
FLI |
|
|
GIF |
|
|
ILBM |
|
|
JPG |
jpeg |
|
MKV |
Mode=1017 |
|
MOV |
Mode=1015 |
|
MP4 |
Mode=1016 |
|
PCX |
|
|
PDF |
|
|
PNG |
|
|
PSD |
|
|
SGI |
Mode=16 |
|
SOFTIMAGE |
Mode=10 |
|
SUNRASTER |
sun |
|
TGA |
tga |
|
TIFF |
Mode=15 |
|
VPB |
|
|
WEBM |
Mode=1018 |
from_extension(extension: str) -> SaveFormat
classmethod
¶
Returns the correct tvpaint format value from a string extension.
Source code in pytvpaint/george/grg_base.py
340 341 342 343 344 345 346 347 348 |
|
is_image(extension: str) -> bool
classmethod
¶
Returns True if the extension correspond to an image format.
Source code in pytvpaint/george/grg_base.py
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
|
RGBColor(r: int, g: int, b: int)
dataclass
¶
RGB color with 0-255 range values.
HSLColor(h: int, s: int, l: int)
dataclass
¶
HSL color. Maximum values are (360, 100, 100) for h, s, l.
BlendingMode
¶
DrawingMode
¶
MenuElement
¶
TVPPenBrush(mode: DrawingMode, size: float, power: int, opacity: int, dry: bool, aaliasing: bool, gradient: bool, csize: str, cpower: str)
dataclass
¶
A TVPaint brush.
TVPSound(offset: float, volume: float, mute: bool, fade_in_start: float, fade_in_stop: float, fade_out_start: float, fade_out_stop: float, path: Path, sound_in: float, sound_out: float, color_index: int)
dataclass
¶
A TVPaint sound (clip and project).
undoable(func: T) -> T
¶
Decorator to register actions in the TVPaint undo stack.
Source code in pytvpaint/george/grg_base.py
600 601 602 603 604 605 606 607 608 609 |
|
undoable_stack() -> Generator[None, None, None]
¶
Context manager that creates an undo stack. Useful to undo a sequence of George actions.
Source code in pytvpaint/george/grg_base.py
612 613 614 615 616 617 |
|
tv_warn(msg: str) -> None
¶
Display a warning message.
Source code in pytvpaint/george/grg_base.py
620 621 622 |
|
tv_version() -> tuple[str, str, str]
¶
Returns the software name, version and language.
Source code in pytvpaint/george/grg_base.py
625 626 627 628 629 630 631 632 633 634 |
|
tv_quit() -> None
¶
Closes the TVPaint instance.
Source code in pytvpaint/george/grg_base.py
637 638 639 |
|
tv_host2back() -> None
¶
Minimize the TVPaint window.
Source code in pytvpaint/george/grg_base.py
642 643 644 |
|
tv_host2front() -> None
¶
Restore the TVPaint window after being minimized.
Source code in pytvpaint/george/grg_base.py
647 648 649 |
|
tv_menu_hide() -> None
¶
Switch to inlay view and hide all non-docking panels.
Source code in pytvpaint/george/grg_base.py
652 653 654 |
|
add_some_magic(i_am_a_badass: bool = False, magic_number: int | None = None) -> None
¶
Don't use ! Will change your life forever...
Source code in pytvpaint/george/grg_base.py
657 658 659 660 661 662 663 664 665 666 |
|
tv_menu_show(menu_element: MenuElement | None = None, *menu_options: Any, current: bool = False) -> None
¶
For the complete documentation, see: https://www.tvpaint.com/doc/tvpaint-animation-11/george-commands#tv_menushow.
Source code in pytvpaint/george/grg_base.py
669 670 671 672 673 674 675 676 677 678 679 680 681 |
|
tv_request(msg: str, confirm_text: str = 'Yes', cancel_text: str = 'No') -> bool
¶
Open a confirmation prompt with a message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg |
str
|
the message to display |
required |
confirm_text |
str
|
the confirm button text. Defaults to "Yes". |
'Yes'
|
cancel_text |
str
|
the cancel button text. Defaults to "No". |
'No'
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if clicked on "Yes" |
Source code in pytvpaint/george/grg_base.py
684 685 686 687 688 689 690 691 692 693 694 695 |
|
tv_req_num(value: int, min: int, max: int, title: str = 'Enter Value') -> int | None
¶
Open a prompt to request an integer (within a range).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
int
|
the initial value |
required |
min |
int
|
the minimum value |
required |
max |
int
|
the maximum value |
required |
title |
str
|
title of the prompt dialog. Defaults to "Enter Value". |
'Enter Value'
|
Returns:
Type | Description |
---|---|
int | None
|
the value or None if cancelled |
Source code in pytvpaint/george/grg_base.py
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 |
|
tv_req_angle(value: float, min: float, max: float, title: str = 'Enter Value') -> float | None
¶
Open a prompt to request an angle (in degree).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
float
|
the initial value |
required |
min |
float
|
the minimum value |
required |
max |
float
|
the maximum value |
required |
title |
str
|
title of the prompt. Defaults to "Enter Value". |
'Enter Value'
|
Returns:
Type | Description |
---|---|
float | None
|
the value or None if cancelled |
Source code in pytvpaint/george/grg_base.py
716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 |
|
tv_req_float(value: float, min: float, max: float, title: str = 'Enter value') -> float | None
¶
Open a prompt to request a float.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
float
|
the initial value |
required |
min |
float
|
the minimum value |
required |
max |
float
|
the maximum value |
required |
title |
str
|
title of the prompt. Defaults to "Enter Value". |
'Enter value'
|
Returns:
Type | Description |
---|---|
float | None
|
the value or None if cancelled |
Source code in pytvpaint/george/grg_base.py
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 |
|
tv_req_string(title: str, text: str) -> str | None
¶
Open a prompt to request a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
str
|
title of the requester. Defaults to "Enter Value". |
required |
text |
str
|
the initial value |
required |
Returns:
Type | Description |
---|---|
str | None
|
the value or None if cancelled |
Source code in pytvpaint/george/grg_base.py
752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 |
|
tv_list_request(entries: list[Entry]) -> tuple[int, str]
¶
Open a prompt to request a selection in a list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entries |
list[pytvpaint.george.grg_base.Entry]
|
the list of entries (either a single entry or sub entries) |
required |
Returns:
Type | Description |
---|---|
tuple[int, str]
|
the position, the entry |
Source code in pytvpaint/george/grg_base.py
781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 |
|
tv_req_file(mode: FileMode, title: str = '', working_dir: Path | str | None = None, default_name: str | None = None, extension_filter: str | None = None) -> Path | None
¶
Open a prompt to request a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode |
pytvpaint.george.grg_base.FileMode
|
save or load |
required |
title |
str
|
the title of the request |
''
|
working_dir |
pathlib.Path | str | None
|
the default folder to go. Defaults to None. |
None
|
default_name |
str | None
|
the default name. Defaults to None. |
None
|
extension_filter |
str | None
|
display the files with this extension. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
pathlib.Path | None
|
the choosen path or None if cancelled |
Source code in pytvpaint/george/grg_base.py
803 804 805 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 832 |
|
tv_undo() -> None
¶
Do an undo.
Source code in pytvpaint/george/grg_base.py
835 836 837 |
|
tv_update_undo() -> None
¶
Copies the contents of the current image in the current layer into the buffer undo memory.
None of the draw commands described in this section updates this buffer memory. If you click on the Undo button after executing a George program, everything that the program has drawn in your image will be deleted. With this function you can update the undo buffer memory whenever you wish (for example at the beginning of the program).
Source code in pytvpaint/george/grg_base.py
840 841 842 843 844 845 846 847 |
|
tv_undo_open_stack() -> None
¶
Open an 'undo' stack.
Surround a piece of code with tv_undoopenstack ... tv_undoclosestack, then multiple undo will be added to this stack, and closing this stack will undo everything inside. (To be sure the script returns to the expected result use tv_updateundo before tv_undoopenstack)
Source code in pytvpaint/george/grg_base.py
850 851 852 853 854 855 856 |
|
tv_undo_close_stack(name: str = '') -> None
¶
Close an 'undo' stack (See tv_undo_open_stack).
Source code in pytvpaint/george/grg_base.py
859 860 861 |
|
tv_save_mode_get() -> tuple[SaveFormat, list[str]]
¶
Get the saving alpha mode.
Source code in pytvpaint/george/grg_base.py
864 865 866 867 868 869 |
|
tv_save_mode_set(save_format: SaveFormat, *format_options: str | int | float) -> None
¶
Set the saving alpha mode.
Source code in pytvpaint/george/grg_base.py
872 873 874 875 876 |
|
tv_alpha_load_mode_get() -> AlphaMode
¶
Set the loading alpha mode.
Source code in pytvpaint/george/grg_base.py
879 880 881 882 |
|
tv_alpha_load_mode_set(mode: AlphaMode) -> None
¶
Get the loading alpha mode.
Source code in pytvpaint/george/grg_base.py
885 886 887 |
|
tv_alpha_save_mode_get() -> AlphaSaveMode
¶
Get the saving alpha mode.
Source code in pytvpaint/george/grg_base.py
890 891 892 893 |
|
tv_alpha_save_mode_set(mode: AlphaSaveMode) -> None
¶
Set the saving alpha mode.
Source code in pytvpaint/george/grg_base.py
896 897 898 |
|
tv_mark_in_get(reference: MarkReference) -> tuple[int, MarkAction]
¶
Get markin of the project / clip.
Source code in pytvpaint/george/grg_base.py
901 902 903 904 905 |
|
tv_mark_in_set(reference: MarkReference, frame: int | None, action: MarkAction) -> tuple[int, MarkAction]
¶
Set markin of the project / clip.
Source code in pytvpaint/george/grg_base.py
908 909 910 911 912 913 914 |
|
tv_mark_out_get(reference: MarkReference) -> tuple[int, MarkAction]
¶
Get markout of the project / clip.
Source code in pytvpaint/george/grg_base.py
917 918 919 920 921 |
|
tv_mark_out_set(reference: MarkReference, frame: int | None, action: MarkAction) -> tuple[int, MarkAction]
¶
Set markout of the project / clip.
Source code in pytvpaint/george/grg_base.py
924 925 926 927 928 |
|
tv_get_active_shape() -> TVPShape
¶
Get the current shape.
Source code in pytvpaint/george/grg_base.py
965 966 967 |
|
tv_set_active_shape(shape: TVPShape, **shape_kwargs: Any) -> None
¶
Set the current shape and its tool parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shape |
pytvpaint.george.grg_base.TVPShape
|
the shape to set |
required |
**shape_kwargs |
typing.Any
|
the shape specific parameters as keyword arguments |
{}
|
Source code in pytvpaint/george/grg_base.py
970 971 972 973 974 975 976 977 |
|
tv_set_a_pen_rgba(color: RGBColor, alpha: int | None = None) -> RGBColor
¶
Set the APen RGBA color.
Source code in pytvpaint/george/grg_base.py
1027 1028 1029 |
|
tv_set_a_pen_hsl(color: HSLColor) -> HSLColor
¶
Set the A Pen HSL color.
Source code in pytvpaint/george/grg_base.py
1032 1033 1034 |
|
tv_set_b_pen_rgba(color: RGBColor, alpha: int | None = None) -> RGBColor
¶
Set the B Pen RGBA color.
Source code in pytvpaint/george/grg_base.py
1037 1038 1039 |
|
tv_set_b_pen_hsl(color: HSLColor) -> HSLColor
¶
Set the B Pen HSL color.
Source code in pytvpaint/george/grg_base.py
1042 1043 1044 |
|
tv_pen(size: float) -> float
¶
Change current pen tool size. This function is most likely deprecated it is undocumented in the George reference but still works.
Source code in pytvpaint/george/grg_base.py
1047 1048 1049 1050 |
|
tv_pen_brush_get(tool_mode: bool = False) -> TVPPenBrush
¶
Get pen brush parameters.
Source code in pytvpaint/george/grg_base.py
1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 |
|
tv_pen_brush_set(mode: DrawingMode | None = None, size: int | None = None, opacity: int | None = None, tool_mode: bool = False, reset: bool = False) -> TVPPenBrush
¶
Manage pen brush.
Source code in pytvpaint/george/grg_base.py
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 |
|
tv_line(xy1: tuple[int, int], xy2: tuple[int, int], right_click: bool = False, dry: bool = False) -> None
¶
Draw a line (with the current brush).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xy1 |
tuple[int, int]
|
start position as (x, y) |
required |
xy2 |
tuple[int, int]
|
end position as (x, y) |
required |
right_click |
bool
|
True to emulate right click, False to emulate left click. Default is False |
False
|
dry |
bool
|
True for dry mode |
False
|
Source code in pytvpaint/george/grg_base.py
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 |
|
tv_text(text: str, x: int, y: int, use_b_pen: bool = False) -> None
¶
Write text in a layer instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str
|
text to write |
required |
x |
int
|
text x position |
required |
y |
int
|
text y position |
required |
use_b_pen |
bool
|
True will use b pen, False will use A pen |
False
|
Source code in pytvpaint/george/grg_base.py
1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 |
|
tv_text_brush(text: str) -> None
¶
Set the text for the text brush.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str
|
text to write |
required |
Source code in pytvpaint/george/grg_base.py
1128 1129 1130 1131 1132 1133 1134 |
|
tv_rect(tlx: float, tly: float, brx: float, bry: float, button: RectButton | None = None) -> None
¶
Draws an unfilled rectangle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tlx |
float
|
top left x coordinate |
required |
tly |
float
|
top left y coordinate |
required |
brx |
float
|
bottom right x coordinate |
required |
bry |
float
|
bottom right y coordinate |
required |
button |
pytvpaint.george.grg_base.RectButton | None
|
use left or right click button (left draws, right erases) |
None
|
Source code in pytvpaint/george/grg_base.py
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 |
|
tv_rect_fill(tlx: float, tly: float, brx: float, bry: float, grx: float = 0, gry: float = 0, erase_mode: bool = False, tool_mode: bool = False) -> None
¶
Draws a filled rectangle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tlx |
float
|
top left x coordinate |
required |
tly |
float
|
top left y coordinate |
required |
brx |
float
|
bottom right x coordinate |
required |
bry |
float
|
bottom right y coordinate |
required |
grx |
float
|
gradient vector x |
0
|
gry |
float
|
gradient vector y |
0
|
erase_mode |
bool
|
erase drawing mode |
False
|
tool_mode |
bool
|
manage drawing mode |
False
|
Source code in pytvpaint/george/grg_base.py
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 |
|
tv_fast_line(x1: float, y1: float, x2: float, y2: float, r: int = 255, b: int = 255, g: int = 0, a: int = 255) -> None
¶
Draw a line (1 pixel size and not antialiased).
Source code in pytvpaint/george/grg_base.py
1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 |
|