Miscellaneous George functions¶
All George values as enum and functions which are not specific to any TVPaint element.
T = TypeVar('T', bound=(Callable[..., Any]))
module-attribute
¶
Entry: TypeAlias = 'str | tuple[str, list[Entry]]'
module-attribute
¶
GrgErrorValue
¶
GrgBoolState
¶
FieldOrder
¶
MarkType
¶
MarkReference
¶
MarkAction
¶
RectButton
¶
TVPShape
¶
The shape tools.
Attributes:
B_SPLINE = 'bspline'
class-attribute
instance-attribute
¶
BEZIER = 'bezier'
class-attribute
instance-attribute
¶
BEZIER_FILL = 'bezierfill'
class-attribute
instance-attribute
¶
CAMERA = 'camera'
class-attribute
instance-attribute
¶
CIRCLE = 'circle'
class-attribute
instance-attribute
¶
CIRCLE_2PTS = 'circle2pts'
class-attribute
instance-attribute
¶
CIRCLE_3PTS = 'circle3pts'
class-attribute
instance-attribute
¶
CIRCLE_FILL = 'circlefill'
class-attribute
instance-attribute
¶
CIRCLE_2PTS_FILL = 'circle2ptsfill'
class-attribute
instance-attribute
¶
CIRCLE_3PTS_FILL = 'circle3ptsfill'
class-attribute
instance-attribute
¶
CROP = 'crop'
class-attribute
instance-attribute
¶
CUT_RECT = 'cutrect'
class-attribute
instance-attribute
¶
CUT_POLY = 'cutpoly'
class-attribute
instance-attribute
¶
CUT_FREE_HAND = 'cutfreehand'
class-attribute
instance-attribute
¶
CUT_FLOOD = 'cutflood'
class-attribute
instance-attribute
¶
DOT = 'dot'
class-attribute
instance-attribute
¶
FLOOD = 'flood'
class-attribute
instance-attribute
¶
FREE_HAND_LINE = 'freehandline'
class-attribute
instance-attribute
¶
FREE_HAND_FILL = 'freehandfill'
class-attribute
instance-attribute
¶
ELLIPSE = 'ellipse'
class-attribute
instance-attribute
¶
ELLIPSE_FILL = 'ellipsefill'
class-attribute
instance-attribute
¶
ELLIPSE_2PTS = 'ellipse2pts'
class-attribute
instance-attribute
¶
ELLIPSE_2PTS_FILL = 'ellipse2ptsfill'
class-attribute
instance-attribute
¶
LINE = 'line'
class-attribute
instance-attribute
¶
LINE_FILL = 'linefill'
class-attribute
instance-attribute
¶
PLANNING = 'panning'
class-attribute
instance-attribute
¶
POSITION = 'position'
class-attribute
instance-attribute
¶
RECTANGLE = 'rectangle'
class-attribute
instance-attribute
¶
RECTANGLE_FILL = 'rectanglefill'
class-attribute
instance-attribute
¶
SELECT_RECTANGLE = 'selectrectangle'
class-attribute
instance-attribute
¶
SELECT_ELLIPSE = 'selectellipse'
class-attribute
instance-attribute
¶
SELECT_2PTS = 'select2pts'
class-attribute
instance-attribute
¶
SELECT_3PTS = 'select3pts'
class-attribute
instance-attribute
¶
SELECT_POLY = 'selectpoly'
class-attribute
instance-attribute
¶
SELECT_FREE_HAND = 'selectfreehand'
class-attribute
instance-attribute
¶
SELECT_FLOOD = 'selectflood'
class-attribute
instance-attribute
¶
SELECT_COLOR = 'selectcolor'
class-attribute
instance-attribute
¶
SELECT_BEZIER = 'selectbezier'
class-attribute
instance-attribute
¶
SELECT_B_SPLINE = 'selectbspline'
class-attribute
instance-attribute
¶
SINGLE_DOT = 'singledot'
class-attribute
instance-attribute
¶
SPLIT_3PTS = 'spline3pts'
class-attribute
instance-attribute
¶
SPLINE_FILL = 'splinefill'
class-attribute
instance-attribute
¶
WARP = 'warp'
class-attribute
instance-attribute
¶
WRAP = 'wrap'
class-attribute
instance-attribute
¶
ZOOM_IN = 'zoomin'
class-attribute
instance-attribute
¶
ZOOM_OUT = 'zoomout'
class-attribute
instance-attribute
¶
ZOOM_HAND = 'zoomhand'
class-attribute
instance-attribute
¶
ZOOM_RECT = 'zoomrect'
class-attribute
instance-attribute
¶
ResizeOption
¶
SpriteLayout
¶
Sprite layout when exporting as sprites.
Attributes:
| Name | Type | Description |
|---|---|---|
RECTANGLE |
|
|
HORIZONTAL |
|
|
VERTICAL |
|
|
DIAGONAL |
|
|
ANTI_DIAGONAL |
|
RECTANGLE = 'rectangle'
class-attribute
instance-attribute
¶
HORIZONTAL = 'horizontal'
class-attribute
instance-attribute
¶
VERTICAL = 'vertical'
class-attribute
instance-attribute
¶
DIAGONAL = 'diagonal'
class-attribute
instance-attribute
¶
ANTI_DIAGONAL = 'antidiagonal'
class-attribute
instance-attribute
¶
AlphaMode
¶
The alpha load mode.
Attributes:
| Name | Type | Description |
|---|---|---|
PREMULTIPLY |
|
|
NO_PREMULTIPLY |
|
|
NO_ALPHA |
|
|
ALPHA_ONLY |
|
|
GUESS |
|
PREMULTIPLY = 'premultiply'
class-attribute
instance-attribute
¶
NO_PREMULTIPLY = 'nopremultiply'
class-attribute
instance-attribute
¶
NO_ALPHA = 'noalpha'
class-attribute
instance-attribute
¶
ALPHA_ONLY = 'alphaonly'
class-attribute
instance-attribute
¶
GUESS = 'guess'
class-attribute
instance-attribute
¶
AlphaSaveMode
¶
The alpha save mode.
Attributes:
| Name | Type | Description |
|---|---|---|
PREMULTIPLY |
|
|
NO_PREMULTIPLY |
|
|
NO_ALPHA |
|
|
ALPHA_ONLY |
|
|
GUESS |
|
|
ALPHA_BINARY |
|
PREMULTIPLY = 'premultiply'
class-attribute
instance-attribute
¶
NO_PREMULTIPLY = 'nopremultiply'
class-attribute
instance-attribute
¶
NO_ALPHA = 'noalpha'
class-attribute
instance-attribute
¶
ALPHA_ONLY = 'alphaonly'
class-attribute
instance-attribute
¶
GUESS = 'guess'
class-attribute
instance-attribute
¶
ALPHA_BINARY = 'alphabinary'
class-attribute
instance-attribute
¶
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 |
AVI = 'avi'
class-attribute
instance-attribute
¶
BMP = 'bmp'
class-attribute
instance-attribute
¶
CINEON = 'cin'
class-attribute
instance-attribute
¶
DEEP = 'deep'
class-attribute
instance-attribute
¶
DPX = 'dpx'
class-attribute
instance-attribute
¶
FLI = 'flc'
class-attribute
instance-attribute
¶
GIF = 'gif'
class-attribute
instance-attribute
¶
ILBM = 'ilbm'
class-attribute
instance-attribute
¶
JPG = 'jpeg'
class-attribute
instance-attribute
¶
MKV = 'Mode=1017'
class-attribute
instance-attribute
¶
MOV = 'Mode=1015'
class-attribute
instance-attribute
¶
MP4 = 'Mode=1016'
class-attribute
instance-attribute
¶
PCX = 'pcx'
class-attribute
instance-attribute
¶
PDF = 'pdf'
class-attribute
instance-attribute
¶
PNG = 'png'
class-attribute
instance-attribute
¶
PSD = 'psd'
class-attribute
instance-attribute
¶
SGI = 'Mode=16'
class-attribute
instance-attribute
¶
SOFTIMAGE = 'Mode=10'
class-attribute
instance-attribute
¶
SUNRASTER = 'sun'
class-attribute
instance-attribute
¶
TGA = 'tga'
class-attribute
instance-attribute
¶
TIFF = 'Mode=15'
class-attribute
instance-attribute
¶
VPB = 'vpb'
class-attribute
instance-attribute
¶
WEBM = 'Mode=1018'
class-attribute
instance-attribute
¶
from_extension(extension: str) -> SaveFormat
classmethod
¶
Returns the correct tvpaint format value from a string extension.
Source code in pytvpaint/george/grg_base.py
343 344 345 346 347 348 349 | |
to_extension(save_format: SaveFormat) -> str
classmethod
¶
Returns the typical tvpaint file extension for the provided format.
Source code in pytvpaint/george/grg_base.py
351 352 353 354 355 356 357 358 359 360 361 362 363 364 | |
is_image(extension: str) -> bool
classmethod
¶
Returns True if the extension correspond to an image format.
Source code in pytvpaint/george/grg_base.py
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | |
RGBColor(r: int, g: int, b: int)
dataclass
¶
RGBAColor(r: int, g: int, b: int, a: int)
dataclass
¶
HSLColor(h: int, s: int, l: int)
dataclass
¶
BlendingMode
¶
All the blending modes.
Attributes:
| Name | Type | Description |
|---|---|---|
COLOR |
|
|
BEHIND |
|
|
ERASE |
|
|
SHADE |
|
|
LIGHT |
|
|
COLORIZE |
|
|
HUE |
|
|
SATURATION |
|
|
VALUE |
|
|
ADD |
|
|
SUB |
|
|
MULTIPLY |
|
|
SCREEN |
|
|
REPLACE |
|
|
COPY |
|
|
DIFFERENCE |
|
|
DIVIDE |
|
|
OVERLAY |
|
|
OVERLAY2 |
|
|
LIGHT2 |
|
|
SHADE2 |
|
|
HARDLIGHT |
|
|
SOFTLIGHT |
|
|
GRAIN_EXTRACT |
|
|
GRAIN_MERGE |
|
|
SUB2 |
|
|
DARKEN |
|
|
LIGHTEN |
|
COLOR = 'color'
class-attribute
instance-attribute
¶
BEHIND = 'behind'
class-attribute
instance-attribute
¶
ERASE = 'erase'
class-attribute
instance-attribute
¶
SHADE = 'shade'
class-attribute
instance-attribute
¶
LIGHT = 'light'
class-attribute
instance-attribute
¶
COLORIZE = 'colorize'
class-attribute
instance-attribute
¶
HUE = 'hue'
class-attribute
instance-attribute
¶
SATURATION = 'saturation'
class-attribute
instance-attribute
¶
VALUE = 'value'
class-attribute
instance-attribute
¶
ADD = 'add'
class-attribute
instance-attribute
¶
SUB = 'sub'
class-attribute
instance-attribute
¶
MULTIPLY = 'multiply'
class-attribute
instance-attribute
¶
SCREEN = 'screen'
class-attribute
instance-attribute
¶
REPLACE = 'replace'
class-attribute
instance-attribute
¶
COPY = 'copy'
class-attribute
instance-attribute
¶
DIFFERENCE = 'difference'
class-attribute
instance-attribute
¶
DIVIDE = 'divide'
class-attribute
instance-attribute
¶
OVERLAY = 'overlay'
class-attribute
instance-attribute
¶
OVERLAY2 = 'overlay2'
class-attribute
instance-attribute
¶
LIGHT2 = 'light2'
class-attribute
instance-attribute
¶
SHADE2 = 'shade2'
class-attribute
instance-attribute
¶
HARDLIGHT = 'hardlight'
class-attribute
instance-attribute
¶
SOFTLIGHT = 'softlight'
class-attribute
instance-attribute
¶
GRAIN_EXTRACT = 'grainextract'
class-attribute
instance-attribute
¶
GRAIN_MERGE = 'grainmerge'
class-attribute
instance-attribute
¶
SUB2 = 'sub2'
class-attribute
instance-attribute
¶
DARKEN = 'darken'
class-attribute
instance-attribute
¶
LIGHTEN = 'lighten'
class-attribute
instance-attribute
¶
DrawingMode
¶
All the drawing modes.
Attributes:
| Name | Type | Description |
|---|---|---|
COLOR |
|
|
BEHIND |
|
|
ERASE |
|
|
PANTO |
|
|
MERGE |
|
|
SHADE |
|
|
LIGHT |
|
|
COLORIZE |
|
|
TINT |
|
|
GRAIN |
|
|
BLUR |
|
|
NOISE |
|
|
NEGATIVE |
|
|
SHARP |
|
|
EMBOSS |
|
|
SOLARIZE |
|
|
SATURATE |
|
|
UNSATURATE |
|
|
ADD |
|
|
SUB |
|
|
MULTIPLY |
|
|
SCREEN |
|
|
DIFF |
|
|
HEALING |
|
|
BURN |
|
|
DODGE |
|
|
DARKEN |
|
|
LIGHTEN |
|
COLOR = 'color'
class-attribute
instance-attribute
¶
BEHIND = 'behind'
class-attribute
instance-attribute
¶
ERASE = 'erase'
class-attribute
instance-attribute
¶
PANTO = 'panto'
class-attribute
instance-attribute
¶
MERGE = 'merge'
class-attribute
instance-attribute
¶
SHADE = 'shade'
class-attribute
instance-attribute
¶
LIGHT = 'light'
class-attribute
instance-attribute
¶
COLORIZE = 'colorize'
class-attribute
instance-attribute
¶
TINT = 'tint'
class-attribute
instance-attribute
¶
GRAIN = 'grain'
class-attribute
instance-attribute
¶
BLUR = 'blur'
class-attribute
instance-attribute
¶
NOISE = 'noise'
class-attribute
instance-attribute
¶
NEGATIVE = 'negative'
class-attribute
instance-attribute
¶
SHARP = 'sharp'
class-attribute
instance-attribute
¶
EMBOSS = 'emboss'
class-attribute
instance-attribute
¶
SOLARIZE = 'solarize'
class-attribute
instance-attribute
¶
SATURATE = 'saturate'
class-attribute
instance-attribute
¶
UNSATURATE = 'unsaturate'
class-attribute
instance-attribute
¶
ADD = 'add'
class-attribute
instance-attribute
¶
SUB = 'sub'
class-attribute
instance-attribute
¶
MULTIPLY = 'multiply'
class-attribute
instance-attribute
¶
SCREEN = 'screen'
class-attribute
instance-attribute
¶
DIFF = 'diff'
class-attribute
instance-attribute
¶
HEALING = 'healing'
class-attribute
instance-attribute
¶
BURN = 'burn'
class-attribute
instance-attribute
¶
DODGE = 'dodge'
class-attribute
instance-attribute
¶
DARKEN = 'darken'
class-attribute
instance-attribute
¶
LIGHTEN = 'lighten'
class-attribute
instance-attribute
¶
MenuElement
¶
All the TVPaint menu elements.
Attributes:
| Name | Type | Description |
|---|---|---|
SHOW_UI |
|
|
HIDE_UI |
|
|
RESIZE_UI |
|
|
CENTER_DISPLAY |
|
|
FIT_DISPLAY |
|
|
FRONT |
|
|
BACK |
|
|
ASPECT_RATIO |
|
|
CLIP |
|
|
PROJECT |
|
|
XSHEET |
|
|
NOTES |
|
SHOW_UI = 'showui'
class-attribute
instance-attribute
¶
HIDE_UI = 'hideui'
class-attribute
instance-attribute
¶
RESIZE_UI = 'resizeui'
class-attribute
instance-attribute
¶
CENTER_DISPLAY = 'centerdisplay'
class-attribute
instance-attribute
¶
FIT_DISPLAY = 'fitdisplay'
class-attribute
instance-attribute
¶
FRONT = 'front'
class-attribute
instance-attribute
¶
BACK = 'back'
class-attribute
instance-attribute
¶
ASPECT_RATIO = 'aspectratio'
class-attribute
instance-attribute
¶
CLIP = 'clip'
class-attribute
instance-attribute
¶
PROJECT = 'project'
class-attribute
instance-attribute
¶
XSHEET = 'xsheet'
class-attribute
instance-attribute
¶
NOTES = 'notes'
class-attribute
instance-attribute
¶
FileMode
¶
TVPPenBrush(mode: DrawingMode, size: float, power: int, opacity: int, dry: bool, anti_aliasing: bool, gradient: bool, c_size: str, c_power: str)
dataclass
¶
A TVPaint brush.
mode: DrawingMode
instance-attribute
¶
size: float
instance-attribute
¶
power: int
instance-attribute
¶
opacity: int
instance-attribute
¶
dry: bool
instance-attribute
¶
anti_aliasing: bool = field(metadata={'alt_name': 'aaliasing'})
class-attribute
instance-attribute
¶
gradient: bool
instance-attribute
¶
c_size: str
instance-attribute
¶
c_power: str
instance-attribute
¶
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).
offset: float
instance-attribute
¶
volume: float
instance-attribute
¶
mute: bool
instance-attribute
¶
fade_in_start: float
instance-attribute
¶
fade_in_stop: float
instance-attribute
¶
fade_out_start: float
instance-attribute
¶
fade_out_stop: float
instance-attribute
¶
path: Path
instance-attribute
¶
sound_in: float
instance-attribute
¶
sound_out: float
instance-attribute
¶
color_index: int
instance-attribute
¶
undoable(func: T) -> T
¶
Decorator to register actions in the TVPaint undo stack.
Source code in pytvpaint/george/grg_base.py
623 624 625 626 627 628 629 630 631 632 | |
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
635 636 637 638 639 640 | |
tv_warn(msg: str) -> None
¶
Display a warning message.
Source code in pytvpaint/george/grg_base.py
643 644 645 | |
tv_version() -> tuple[str, str, str]
¶
Returns TVPaint version and language info.
Returns:
| Name | Type | Description |
|---|---|---|
software_name |
str
|
software full name (ex: TVPaint Animation 12.0.0 Pro) |
tvp_version |
str
|
version number (ex: 12.0.0) |
language |
str
|
language (ex: fr, en, etc...) |
Source code in pytvpaint/george/grg_base.py
648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 | |
is_tvp_version_below_12() -> bool
¶
Helper function to check if the connected tvpaint instance version is below v12.
Source code in pytvpaint/george/grg_base.py
666 667 668 669 | |
min_version_compatible(min_version: str) -> Callable[[T], T]
¶
Decorator to apply on methods.
Given a minimum version, checks if the current tvpaint version is above the minimum requirement otherwise it raises a NotImplemented error
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_version
|
str
|
minimum version required to run this version |
required |
Returns:
| Type | Description |
|---|---|
typing.Callable[[pytvpaint.george.grg_base.T], pytvpaint.george.grg_base.T]
|
the decorated function |
Source code in pytvpaint/george/grg_base.py
672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 | |
deprecated_warning(msg: str) -> Callable[[T], T]
¶
Decorator to apply on methods.
Prints a deprecation message/warning when decorated function is called
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
msg
|
str
|
deprecation message |
required |
Returns:
| Type | Description |
|---|---|
typing.Callable[[pytvpaint.george.grg_base.T], pytvpaint.george.grg_base.T]
|
the decorated function |
Source code in pytvpaint/george/grg_base.py
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 | |
tv_quit() -> None
¶
Closes the TVPaint instance.
Source code in pytvpaint/george/grg_base.py
727 728 729 | |
tv_host2back() -> None
¶
Minimize the TVPaint window.
Source code in pytvpaint/george/grg_base.py
732 733 734 | |
tv_host2front() -> None
¶
Restore the TVPaint window after being minimized.
Source code in pytvpaint/george/grg_base.py
737 738 739 | |
tv_menu_hide() -> None
¶
Switch to inlay view and hide all non-docking panels.
Source code in pytvpaint/george/grg_base.py
742 743 744 | |
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
747 748 749 750 751 752 753 754 755 756 757 | |
add_some_magic(i_am_a_badass: bool = False, magic_number: int | None = None) -> None
¶
Don't use this function ! It just might change your life forever !
Source code in pytvpaint/george/grg_base.py
760 761 762 763 764 765 766 767 | |
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
770 771 772 773 774 775 776 777 778 779 780 781 | |
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
784 785 786 787 788 789 790 791 792 793 794 795 796 797 | |
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
800 801 802 803 804 805 806 807 808 809 810 811 812 813 | |
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
816 817 818 819 820 821 822 823 824 825 826 827 828 829 | |
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
832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 | |
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
861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 | |
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
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 | |
tv_undo() -> None
¶
Do an undo.
Source code in pytvpaint/george/grg_base.py
915 916 917 | |
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
920 921 922 923 924 925 926 927 | |
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
930 931 932 933 934 935 936 | |
tv_undo_close_stack(name: str = '') -> None
¶
Close an 'undo' stack (See tv_undo_open_stack).
Source code in pytvpaint/george/grg_base.py
939 940 941 | |
tv_save_mode_get() -> tuple[SaveFormat, list[str]]
¶
Get the saving alpha mode.
Source code in pytvpaint/george/grg_base.py
944 945 946 947 948 949 | |
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
952 953 954 | |
tv_alpha_load_mode_get() -> AlphaMode
¶
Set the loading alpha mode.
Source code in pytvpaint/george/grg_base.py
957 958 959 960 | |
tv_alpha_load_mode_set(mode: AlphaMode) -> None
¶
Get the loading alpha mode.
Source code in pytvpaint/george/grg_base.py
963 964 965 | |
tv_alpha_save_mode_get() -> AlphaSaveMode
¶
Get the saving alpha mode.
Source code in pytvpaint/george/grg_base.py
968 969 970 971 | |
tv_alpha_save_mode_set(mode: AlphaSaveMode) -> None
¶
Set the saving alpha mode.
Source code in pytvpaint/george/grg_base.py
974 975 976 | |
tv_mark_in_get(reference: MarkReference) -> tuple[int, MarkAction]
¶
Get markin of the project / clip.
Source code in pytvpaint/george/grg_base.py
979 980 981 982 983 | |
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
986 987 988 989 990 991 992 | |
tv_mark_out_get(reference: MarkReference) -> tuple[int, MarkAction]
¶
Get markout of the project / clip.
Source code in pytvpaint/george/grg_base.py
995 996 997 998 999 | |
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
1002 1003 1004 | |
tv_get_active_shape() -> TVPShape
¶
Get the current shape.
Source code in pytvpaint/george/grg_base.py
1041 1042 1043 | |
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
1046 1047 1048 1049 1050 1051 1052 1053 | |
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
1101 1102 1103 | |
tv_set_a_pen_hsl(color: HSLColor) -> HSLColor
¶
Set the A Pen HSL color.
Source code in pytvpaint/george/grg_base.py
1106 1107 1108 | |
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
1111 1112 1113 | |
tv_set_b_pen_hsl(color: HSLColor) -> HSLColor
¶
Set the B Pen HSL color.
Source code in pytvpaint/george/grg_base.py
1116 1117 1118 | |
tv_pen(size: float) -> float
¶
Change current pen tool size.
Warning
DEPRECATED: Function tv_pen is deprecated, We advise using tv_penbrush instead.
Source code in pytvpaint/george/grg_base.py
1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 | |
tv_pen_brush_get(tool_mode: bool = False) -> TVPPenBrush
¶
Get pen brush parameters.
Source code in pytvpaint/george/grg_base.py
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 | |
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
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 | |
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
1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 | |
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
1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 | |
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
1210 1211 1212 1213 1214 1215 1216 | |
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
1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 | |
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
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 | |
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
1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 | |
tv_pick_color() -> tuple[int, RGBAColor]
¶
Pick a color from the UI using the mouse.
Returns:
| Name | Type | Description |
|---|---|---|
mouse_click |
int
|
mouse click (-1: cancel, 0: left button mouse, 1: right button mouse) |
color |
pytvpaint.george.grg_base.RGBAColor
|
the selected RGBA Color |
Source code in pytvpaint/george/grg_base.py
1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 | |