From 9acdc52fd7d4be90ea6d88215256ff01c4163fef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 18:43:10 +0000 Subject: [PATCH] Deployed 0a83fda with MkDocs version: 1.5.3 --- .nojekyll | 0 404.html | 1402 +++ api/client/communication/index.html | 2096 ++++ api/client/parsing/index.html | 2883 +++++ api/client/rpc/index.html | 2371 ++++ api/george/camera/index.html | 2046 ++++ api/george/clip/index.html | 5504 ++++++++++ api/george/exceptions/index.html | 1675 +++ api/george/layer/index.html | 9543 +++++++++++++++++ api/george/misc/index.html | 8653 +++++++++++++++ api/george/project/index.html | 4728 ++++++++ api/george/scene/index.html | 1850 ++++ api/objects/camera/index.html | 2407 +++++ api/objects/clip/index.html | 6508 +++++++++++ api/objects/clip_sound/index.html | 1749 +++ api/objects/layer/index.html | 6892 ++++++++++++ api/objects/layer_color/index.html | 2065 ++++ api/objects/layer_instance/index.html | 2319 ++++ api/objects/project/index.html | 5048 +++++++++ api/objects/project_sound/index.html | 1747 +++ api/objects/scene/index.html | 2332 ++++ api/utils/index.html | 3766 +++++++ assets/_mkdocstrings.css | 109 + assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.bd41221c.min.js | 29 + assets/javascripts/bundle.bd41221c.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 ++++++++++++ .../workers/search.b8dbb3d2.min.js | 42 + .../workers/search.b8dbb3d2.min.js.map | 7 + assets/logo_alphee.png | Bin 0 -> 176128 bytes assets/logo_brunch_white.svg | 1 + assets/logo_milo.png | Bin 0 -> 91316 bytes assets/logo_pierre_yves.png | Bin 0 -> 46439 bytes assets/pytvpaint_code_banner.png | Bin 0 -> 445955 bytes assets/pytvpaint_logo.png | Bin 0 -> 88134 bytes assets/range1.png | Bin 0 -> 5041 bytes assets/range10.png | Bin 0 -> 7511 bytes assets/range11.png | Bin 0 -> 5921 bytes assets/range2.png | Bin 0 -> 7968 bytes assets/range3.png | Bin 0 -> 7788 bytes assets/range4.png | Bin 0 -> 2987 bytes assets/range5.png | Bin 0 -> 8181 bytes assets/range6.png | Bin 0 -> 8655 bytes assets/range7.png | Bin 0 -> 10158 bytes assets/range8.png | Bin 0 -> 9571 bytes assets/range9.png | Bin 0 -> 4864 bytes assets/stylesheets/main.10ba22f1.min.css | 1 + assets/stylesheets/main.10ba22f1.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + contributing/developer_setup/index.html | 1719 +++ contributing/internals/index.html | 1471 +++ contributing/modify_objects/index.html | 1645 +++ contributing/wrap_george/index.html | 1778 +++ cpp/building/index.html | 1631 +++ cpp/index.html | 1464 +++ credits/index.html | 1646 +++ index.html | 1621 +++ installation/index.html | 1579 +++ limitations/index.html | 1664 +++ objects.inv | Bin 0 -> 6373 bytes overrides/partials/copyright.html | 16 + search/search_index.json | 1 + sitemap.xml | 163 + sitemap.xml.gz | Bin 0 -> 448 bytes stylesheets/extra.css | 18 + usage/rendering/index.html | 2078 ++++ usage/usage/index.html | 2008 ++++ 101 files changed, 105486 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 api/client/communication/index.html create mode 100644 api/client/parsing/index.html create mode 100644 api/client/rpc/index.html create mode 100644 api/george/camera/index.html create mode 100644 api/george/clip/index.html create mode 100644 api/george/exceptions/index.html create mode 100644 api/george/layer/index.html create mode 100644 api/george/misc/index.html create mode 100644 api/george/project/index.html create mode 100644 api/george/scene/index.html create mode 100644 api/objects/camera/index.html create mode 100644 api/objects/clip/index.html create mode 100644 api/objects/clip_sound/index.html create mode 100644 api/objects/layer/index.html create mode 100644 api/objects/layer_color/index.html create mode 100644 api/objects/layer_instance/index.html create mode 100644 api/objects/project/index.html create mode 100644 api/objects/project_sound/index.html create mode 100644 api/objects/scene/index.html create mode 100644 api/utils/index.html create mode 100644 assets/_mkdocstrings.css create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.bd41221c.min.js create mode 100644 assets/javascripts/bundle.bd41221c.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js.map create mode 100644 assets/logo_alphee.png create mode 100644 assets/logo_brunch_white.svg create mode 100644 assets/logo_milo.png create mode 100644 assets/logo_pierre_yves.png create mode 100644 assets/pytvpaint_code_banner.png create mode 100644 assets/pytvpaint_logo.png create mode 100644 assets/range1.png create mode 100644 assets/range10.png create mode 100644 assets/range11.png create mode 100644 assets/range2.png create mode 100644 assets/range3.png create mode 100644 assets/range4.png create mode 100644 assets/range5.png create mode 100644 assets/range6.png create mode 100644 assets/range7.png create mode 100644 assets/range8.png create mode 100644 assets/range9.png create mode 100644 assets/stylesheets/main.10ba22f1.min.css create mode 100644 assets/stylesheets/main.10ba22f1.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 contributing/developer_setup/index.html create mode 100644 contributing/internals/index.html create mode 100644 contributing/modify_objects/index.html create mode 100644 contributing/wrap_george/index.html create mode 100644 cpp/building/index.html create mode 100644 cpp/index.html create mode 100644 credits/index.html create mode 100644 index.html create mode 100644 installation/index.html create mode 100644 limitations/index.html create mode 100644 objects.inv create mode 100644 overrides/partials/copyright.html create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 stylesheets/extra.css create mode 100644 usage/rendering/index.html create mode 100644 usage/usage/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..e14a8f8 --- /dev/null +++ b/404.html @@ -0,0 +1,1402 @@ + + + +
+ + + + + + + + + + + + + + + + +This modules handles the WebSocket client and automatically connect to the server running in TVPaint.
+It also has crucial functions like send_cmd
that send George commands and get the result.
try_cmd(raise_exc: type[Exception] = GeorgeError, catch_exc: type[Exception] = GeorgeError, exception_msg: str | None = None) -> Callable[[T], T]
+
+¶Decorator that does a try/except with GeorgeError by default.
+It raises the error with the custom exception message provided.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
raise_exc |
+
+ type[Exception]
+ |
+
+
+
+ the exception to raise. Defaults to GeorgeError. + |
+
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
catch_exc |
+
+ type[Exception]
+ |
+
+
+
+ the exception to catch. Defaults to GeorgeError. + |
+
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
exception_msg |
+
+ str | None
+ |
+
+
+
+ Custom exception message. Defaults to None. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ typing.Callable[[pytvpaint.george.client.T], pytvpaint.george.client.T]
+ |
+
+
+
+ the decorated function + |
+
pytvpaint/george/client/__init__.py
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 |
|
send_cmd(command: str, *args: Any, error_values: list[Any] | None = None, handle_string: bool = True) -> str
+
+¶Send a George command with the provided arguments to TVPaint.
+Catch basic ERROR XX
errors returned from George, but you can provide your own error values.
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
command |
+
+ str
+ |
+
+
+
+ the George command to send + |
+ + required + | +
*args |
+
+ typing.Any
+ |
+
+
+
+ pass any arguments you want to that function + |
+
+ ()
+ |
+
error_values |
+
+ list[typing.Any] | None
+ |
+
+
+
+ a list of error values to catch from George. Defaults to None. + |
+
+ None
+ |
+
handle_string |
+
+ bool
+ |
+
+
+
+ control the quote wrapping of string with spaces. Defaults to True. + |
+
+ True
+ |
+
Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if we received |
+
Returns:
+Type | +Description | +
---|---|
+ str
+ |
+
+
+
+ the George return string + |
+
pytvpaint/george/client/__init__.py
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 |
|
run_script(script: Path | str) -> None
+
+¶Execute a George script from a .grg file.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
script |
+
+ pathlib.Path | str
+ |
+
+
+
+ the path to the script + |
+ + required + | +
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if the script was not found + |
+
pytvpaint/george/client/__init__.py
153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 |
|
Parsing functions used to handle data coming from TVPaint and also preparing arguments for them to be sent.
+The two main functions are tv_parse_dict
and tv_parse_list
which handle the return values of George functions.
George can either return a list of values or a list of key/value pairs which are consecutive.
+ + + +DataclassInstance
+
+
+¶
+ Bases: typing_extensions.Protocol
Protocol that describes a Dataclass instance.
+ + + + +tv_handle_string(s: str) -> str
+
+¶String handling for George arguments. It wraps the string into quotes if it has spaces.
+See an example here: https://www.tvpaint.com/doc/tvpaint-animation-11/george-commands#tv_projectnew
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
s |
+
+ str
+ |
+
+
+
+ the input string + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ str
+ |
+
+
+
+ the "escaped" string + |
+
pytvpaint/george/client/parse.py
33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 |
|
camel_to_pascal(s: str) -> str
+
+¶Convert a camel case string to pascal case.
+ +this_is_a_text -> ThisIsAText
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
s |
+
+ str
+ |
+
+
+
+ the input string + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ str
+ |
+
+
+
+ the string in pascal case + |
+
pytvpaint/george/client/parse.py
50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 |
|
tv_cast_to_type(value: str, cast_type: type[T]) -> T
+
+¶Cast a value to the provided type using George's convention for values.
+ +"1" and "on"/"ON" values are considered True when parsing a boolean
+Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
value |
+
+ str
+ |
+
+
+
+ the input value + |
+ + required + | +
cast_type |
+
+ type[pytvpaint.george.client.parse.T]
+ |
+
+
+
+ the type to cast to + |
+ + required + | +
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if given an enum, and it can't find the value or the enum index is invalid + |
+
Returns:
+Type | +Description | +
---|---|
+ pytvpaint.george.client.parse.T
+ |
+
+
+
+ the value cast to the provided type + |
+
pytvpaint/george/client/parse.py
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 |
|
tv_parse_dict(input_text: str, with_fields: FieldTypes | type[DataclassInstance]) -> dict[str, Any]
+
+¶Parse a list of values as key value pairs returned from TVPaint commands.
+Cast the values to a provided dataclass type or list of key/types pairs.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
input_text |
+
+ str
+ |
+
+
+
+ the George string result + |
+ + required + | +
with_fields |
+
+ pytvpaint.george.client.parse.FieldTypes | type[pytvpaint.george.client.parse.DataclassInstance]
+ |
+
+
+
+ the field types (can be a dataclass) + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ dict[str, typing.Any]
+ |
+
+
+
+ a dict with the values cast to the given types + |
+
pytvpaint/george/client/parse.py
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 |
|
tv_parse_list(output: str, with_fields: FieldTypes | type[DataclassInstance], unused_indices: list[int] | None = None) -> dict[str, Any]
+
+¶Parse a list of values returned from TVPaint commands.
+Cast the values to a provided dataclass type or list of key/types pairs.
+You can specify unused indices to exclude positional values from being parsed. +This is useful because some George commands have unused return values.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
output |
+
+ str
+ |
+
+
+
+ the input string + |
+ + required + | +
with_fields |
+
+ pytvpaint.george.client.parse.FieldTypes | type[pytvpaint.george.client.parse.DataclassInstance]
+ |
+
+
+
+ the field types (can be a dataclass) + |
+ + required + | +
unused_indices |
+
+ list[int] | None
+ |
+
+
+
+ Some George functions return positional arguments that are unused. Defaults to None. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ dict[str, typing.Any]
+ |
+
+
+
+ a dict with the values cast to the given types + |
+
pytvpaint/george/client/parse.py
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 +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 |
|
args_dict_to_list(args: dict[str, Any]) -> list[Any]
+
+¶Converts a dict of named arguments to a flat list of key/values.
+It also filters pairs with None values
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
args |
+
+ dict[str, typing.Any]
+ |
+
+
+
+ dict of arguments + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ list[typing.Any]
+ |
+
+
+
+ key/values list + |
+
pytvpaint/george/client/parse.py
274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 |
|
validate_args_list(optional_args: Sequence[Value | tuple[Value, ...]]) -> list[Any]
+
+¶Some George functions only accept a list of values and not key:value pairs, so to set the last positional argument for instance, you need to give all the previous ones.
+This function allows you to give a list of argument or key:value pairs (as tuples) and check that they are not None.
+For example, for tv_camerainfo [<iWidth> <iHeight> [<field_order>]]
+you can't give [500, None, "upper"]
because <iHeight>
is not defined.
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
optional_args |
+
+ collections.abc.Sequence[pytvpaint.george.client.parse.Value | tuple[pytvpaint.george.client.parse.Value, ...]]
+ |
+
+
+
+ list of values or tuple of values (args block) + |
+ + required + | +
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if not all the parameters were given + |
+
Returns:
+Type | +Description | +
---|---|
+ list[typing.Any]
+ |
+
+
+
+ the list of parameters + |
+
pytvpaint/george/client/parse.py
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 |
|
JSON-RPC client and data models.
+ + + +JSONRPCPayload
+
+
+¶
+ Bases: typing_extensions.TypedDict
A rpc call is represented by sending a Request object to a Server.
+See: https://www.jsonrpc.org/specification#request_object
+ + + + +JSONRPCResponse
+
+
+¶
+ Bases: typing_extensions.TypedDict
When a rpc call is made, the Server MUST reply with a Response.
+See: https://www.jsonrpc.org/specification#response_object
+ + + + +JSONRPCError
+
+
+¶
+ Bases: typing_extensions.TypedDict
When a rpc call encounters an error.
+See: https://www.jsonrpc.org/specification#error_object
+ + + + +JSONRPCResponseError(error: JSONRPCError)
+
+¶
+ Bases: Exception
Exception used when a rpc call encounters an error.
+ +pytvpaint/george/client/rpc.py
58 +59 |
|
JSONRPCClient(url: str, timeout: int = 60, version: str = '2.0')
+
+¶Simple JSON-RPC 2.0 client over websockets with automatic reconnection.
+See: https://www.jsonrpc.org/specification#notification
+ +Initialize a new JSON-RPC client with a WebSocket url endpoint.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
url |
+
+ str
+ |
+
+
+
+ the WebSocket url endpoint + |
+ + required + | +
timeout |
+
+ int
+ |
+
+
+
+ the reconnection timeout + |
+
+ 60
+ |
+
version |
+
+ str
+ |
+
+
+
+ The JSON-RPC version. Defaults to "2.0". + |
+
+ '2.0'
+ |
+
pytvpaint/george/client/rpc.py
68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 |
|
is_connected: bool
+
+
+ property
+
+
+¶Returns True if the client is connected.
+connect(timeout: float | None = None) -> None
+
+¶Connects to the WebSocket endpoint.
+ +pytvpaint/george/client/rpc.py
116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 |
|
disconnect() -> None
+
+¶Disconnects from the server.
+ +pytvpaint/george/client/rpc.py
128 +129 +130 +131 +132 +133 +134 |
|
increment_rpc_id() -> None
+
+¶Increments the internal RPC id until it reaches sys.maxsize
.
pytvpaint/george/client/rpc.py
136 +137 +138 |
|
execute_remote(method: str, params: list[JSONValueType] | None = None) -> JSONRPCResponse
+
+¶Executes a remote procedure call.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
method |
+
+ str
+ |
+
+
+
+ the name of the method to be invoked + |
+ + required + | +
params |
+
+ list[pytvpaint.george.client.rpc.JSONValueType] | None
+ |
+
+
+
+ the parameter values to be used during the invocation of the method. Defaults to None. + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ ConnectionError
+ |
+
+
+
+ if the client is not connected + |
+
+ pytvpaint.george.client.rpc.JSONRPCResponseError
+ |
+
+
+
+ if there was an error server-side + |
+
Returns:
+Name | Type | +Description | +
---|---|---|
JSONRPCResponse |
+ pytvpaint.george.client.rpc.JSONRPCResponse
+ |
+
+
+
+ the JSON-RPC response payload + |
+
pytvpaint/george/client/rpc.py
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 |
|
Camera related George functions.
+ + + +TVPCamera(width: int, height: int, field_order: FieldOrder, frame_rate: float, pixel_aspect_ratio: float, anti_aliasing: int)
+
+
+ dataclass
+
+
+¶TVPaint camera info values.
+ + + + +TVPCameraPoint(x: float, y: float, angle: float, scale: float)
+
+
+ dataclass
+
+
+¶camera 2D point info.
+ + + + +tv_camera_info_get() -> TVPCamera
+
+¶Get the information of the camera.
+ +pytvpaint/george/grg_camera.py
37 +38 +39 |
|
tv_camera_info_set(width: int | None = None, height: int | None = None, field_order: FieldOrder | None = None, frame_rate: float | None = None, pixel_aspect_ratio: float | None = None) -> TVPCamera
+
+¶Set the information of the camera.
+ +pytvpaint/george/grg_camera.py
42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 |
|
tv_camera_enum_points(index: int) -> TVPCameraPoint
+
+¶Get the position/angle/scale values of the n-th point of the camera path.
+ +pytvpaint/george/grg_camera.py
63 +64 +65 +66 |
|
tv_camera_interpolation(position: float) -> TVPCameraPoint
+
+¶Get the position/angle/scale values at the given position on the camera path (between 0 and 1).
+ +pytvpaint/george/grg_camera.py
69 +70 +71 +72 +73 +74 +75 |
|
tv_camera_insert_point(index: int, x: float, y: float, angle: float, scale: float) -> None
+
+¶Add a point to the camera path before the given index.
+ +pytvpaint/george/grg_camera.py
78 +79 +80 +81 +82 +83 +84 +85 +86 |
|
tv_camera_remove_point(index: int) -> None
+
+¶Remove a point at the given index.
+ +pytvpaint/george/grg_camera.py
89 +90 +91 |
|
tv_camera_set_point(index: int, x: float, y: float, angle: float, scale: float) -> None
+
+¶Set position/angle/scale value of a point at the given index and make it current.
+ +pytvpaint/george/grg_camera.py
94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 |
|
Clip related George functions.
+ + + +TVPClip(id: int, name: str, is_current: bool, is_hidden: bool, is_selected: bool, storyboard_start_frame: int, first_frame: int, last_frame: int, frame_count: int, mark_in: int, mark_out: int, color_idx: int)
+
+
+ dataclass
+
+
+¶TVPaint clip info values.
+ + + + +PSDSaveMode
+
+
+¶tv_clip_info(clip_id: int) -> TVPClip
+
+¶Get the information of the given clip.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid clip id + |
+
pytvpaint/george/grg_clip.py
59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 |
|
tv_clip_enum_id(scene_id: int, clip_position: int) -> int
+
+¶Get the id of the clip at the given position inside the given scene.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if given an invalid scene id or clip position or elements have been removed + |
+
pytvpaint/george/grg_clip.py
75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 |
|
tv_clip_current_id() -> int
+
+¶Get the id of the current clip.
+ +pytvpaint/george/grg_clip.py
94 +95 +96 |
|
tv_clip_new(name: str) -> None
+
+¶Create a new clip.
+ +pytvpaint/george/grg_clip.py
99 +100 +101 |
|
tv_clip_duplicate(clip_id: int) -> None
+
+¶Duplicate the given clip.
+ +pytvpaint/george/grg_clip.py
104 +105 +106 |
|
tv_clip_close(clip_id: int) -> None
+
+¶Remove the given clip.
+ +pytvpaint/george/grg_clip.py
109 +110 +111 |
|
tv_clip_name_get(clip_id: int) -> str
+
+¶Get the clip name.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid clip id + |
+
pytvpaint/george/grg_clip.py
114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 |
|
tv_clip_name_set(clip_id: int, name: str) -> None
+
+¶Set the clip name.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid clip id + |
+
pytvpaint/george/grg_clip.py
127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 |
|
tv_clip_move(clip_id: int, scene_id: int, position: int) -> None
+
+¶Manage clip position.
+ +pytvpaint/george/grg_clip.py
140 +141 +142 |
|
tv_clip_hidden_get(clip_id: int) -> bool
+
+¶Get clip visibility.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid clip id + |
+
pytvpaint/george/grg_clip.py
145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 |
|
tv_clip_hidden_set(clip_id: int, new_state: bool) -> None
+
+¶Set clip visibility.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid clip id + |
+
pytvpaint/george/grg_clip.py
159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 |
|
tv_clip_select(clip_id: int) -> None
+
+¶Activate/Make current the given clip.
+ +pytvpaint/george/grg_clip.py
174 +175 +176 |
|
tv_clip_selection_get(clip_id: int) -> bool
+
+¶Get the clip's selection state.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid clip id + |
+
pytvpaint/george/grg_clip.py
179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 |
|
tv_clip_selection_set(clip_id: int, new_state: bool) -> None
+
+¶Set the clip's selection state.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid clip id + |
+
pytvpaint/george/grg_clip.py
193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 |
|
tv_first_image() -> int
+
+¶Get the first image of the clip.
+ +pytvpaint/george/grg_clip.py
206 +207 +208 |
|
tv_last_image() -> int
+
+¶Get the last image of the clip.
+ +pytvpaint/george/grg_clip.py
211 +212 +213 |
|
tv_load_sequence(seq_path: Path | str, offset_count: tuple[int, int] | None = None, field_order: FieldOrder | None = None, stretch: bool = False, time_stretch: bool = False, preload: bool = False) -> int
+
+¶Load a sequence of images or movie in a new layer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
seq_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ the first file of the sequence to load + |
+ + required + | +
offset_count |
+
+ tuple[int, int] | None
+ |
+
+
+
+ the start and number of images in the sequence to load. Defaults to None. + |
+
+ None
+ |
+
field_order |
+
+ pytvpaint.george.grg_base.FieldOrder | None
+ |
+
+
+
+ the field order. Defaults to None. + |
+
+ None
+ |
+
stretch |
+
+ bool
+ |
+
+
+
+ Stretch each image to the size of the layer. Defaults to None. + |
+
+ False
+ |
+
time_stretch |
+
+ bool
+ |
+
+
+
+ Once loaded, the layer will have a new number of images corresponding to the project framerate. Defaults to None. + |
+
+ False
+ |
+
preload |
+
+ bool
+ |
+
+
+
+ Load all the images in memory, no more reference on the files. Defaults to None. + |
+
+ False
+ |
+
Raises:
+Type | +Description | +
---|---|
+ FileNotFoundError
+ |
+
+
+
+ if the sequence file doesn't exist + |
+
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if the input file is in an invalid format + |
+
Returns:
+Type | +Description | +
---|---|
+ int
+ |
+
+
+
+ the number of images of the new layer + |
+
pytvpaint/george/grg_clip.py
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 +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 |
|
tv_save_sequence(export_path: Path | str, mark_in: int | None = None, mark_out: int | None = None) -> None
+
+¶Save the current clip.
+ + + +Raises:
+Type | +Description | +
---|---|
+ NotADirectoryError
+ |
+
+
+
+ if the export directory doesn't exist + |
+
pytvpaint/george/grg_clip.py
272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 |
|
tv_bookmarks_enum(position: int) -> int
+
+¶Get the frame (in the clip) corresponding to the bookmark at the given position.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if no bookmark found at provided position + |
+
pytvpaint/george/grg_clip.py
298 +299 +300 +301 +302 +303 +304 +305 +306 +307 |
|
tv_bookmark_set(frame: int) -> None
+
+¶Set a bookmark at the given frame.
+ +pytvpaint/george/grg_clip.py
310 +311 +312 |
|
tv_bookmark_clear(frame: int) -> None
+
+¶Remove a bookmark at the given frame.
+ +pytvpaint/george/grg_clip.py
315 +316 +317 |
|
tv_bookmark_next() -> None
+
+¶Go to the next bookmarked frame.
+ +pytvpaint/george/grg_clip.py
320 +321 +322 |
|
tv_bookmark_prev() -> None
+
+¶Go to the previous bookmarked frame.
+ +pytvpaint/george/grg_clip.py
325 +326 +327 |
|
tv_clip_color_get(clip_id: int) -> int
+
+¶Get the clip color.
+ +pytvpaint/george/grg_clip.py
330 +331 +332 |
|
tv_clip_color_set(clip_id: int, color_index: int) -> None
+
+¶Set the clip color.
+ +pytvpaint/george/grg_clip.py
335 +336 +337 |
|
tv_clip_action_get(clip_id: int) -> str
+
+¶Get the action text of the clip.
+ +pytvpaint/george/grg_clip.py
340 +341 +342 +343 +344 +345 |
|
tv_clip_action_set(clip_id: int, text: str) -> None
+
+¶Set the action text of the clip.
+ +pytvpaint/george/grg_clip.py
348 +349 +350 +351 +352 |
|
tv_clip_dialog_get(clip_id: int) -> str
+
+¶Get the dialog text of the clip.
+ +pytvpaint/george/grg_clip.py
355 +356 +357 +358 +359 |
|
tv_clip_dialog_set(clip_id: int, dialog: str) -> None
+
+¶Set the dialog text of the clip.
+ +pytvpaint/george/grg_clip.py
362 +363 +364 +365 +366 |
|
tv_clip_note_get(clip_id: int) -> str
+
+¶Get the note text of the clip.
+ +pytvpaint/george/grg_clip.py
369 +370 +371 +372 +373 |
|
tv_clip_note_set(clip_id: int, note: str) -> None
+
+¶Set the note text of the clip.
+ +pytvpaint/george/grg_clip.py
376 +377 +378 +379 +380 |
|
tv_save_clip(export_path: Path | str) -> None
+
+¶Save the current clip in .tvp format.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if file couldn't be saved + |
+
pytvpaint/george/grg_clip.py
383 +384 +385 +386 +387 +388 +389 +390 +391 |
|
tv_save_display(export_path: Path | str) -> None
+
+¶Save the display.
+ +pytvpaint/george/grg_clip.py
394 +395 +396 +397 |
|
tv_clip_save_structure_json(export_path: Path | str, file_format: SaveFormat, fill_background: bool = False, folder_pattern: str | None = None, file_pattern: str | None = None, visible_layers_only: bool = True, all_images: bool = False, ignore_duplicates: bool = False, exclude_names: list[str] | None = None) -> None
+
+¶Save the current clip structure in json.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ the JSON export path + |
+ + required + | +
file_format |
+
+ pytvpaint.george.grg_base.SaveFormat
+ |
+
+
+
+ file format to use for rendering + |
+ + required + | +
fill_background |
+
+ bool
+ |
+
+
+
+ add a background. Defaults to None. + |
+
+ False
+ |
+
folder_pattern |
+
+ str | None
+ |
+
+
+
+ the folder name pattern (%li: layer index, %ln: layer name, %fi: file index (added in 11.0.8)). Defaults to None. + |
+
+ None
+ |
+
file_pattern |
+
+ str | None
+ |
+
+
+
+ the file name pattern (%li: layer index, %ln: layer name, %ii: image index, %in: image name, %fi: file index (added in 11.0.8)). Defaults to None. + |
+
+ None
+ |
+
visible_layers_only |
+
+ bool
+ |
+
+
+
+ export only visible layers. Defaults to None. + |
+
+ True
+ |
+
all_images |
+
+ bool
+ |
+
+
+
+ export all images. Defaults to None. + |
+
+ False
+ |
+
ignore_duplicates |
+
+ bool
+ |
+
+
+
+ Ignore duplicates images. Defaults to None. + |
+
+ False
+ |
+
exclude_names |
+
+ list[str] | None
+ |
+
+
+
+ the instances names which won't be processed/exported. Defaults to None. + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ the parent folder doesn't exist + |
+
pytvpaint/george/grg_clip.py
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 |
|
tv_clip_save_structure_psd(export_path: Path | str, mode: PSDSaveMode, image: int | None = None, mark_in: int | None = None, mark_out: int | None = None) -> None
+
+¶Save the current clip as a PSD.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ description + |
+ + required + | +
mode |
+
+ pytvpaint.george.grg_clip.PSDSaveMode
+ |
+
+
+
+ all will export all layers to a single PSD + |
+ + required + | +
image |
+
+ int | None
+ |
+
+
+
+ will only export the given image. Defaults to None. + |
+
+ None
+ |
+
mark_in |
+
+ int | None
+ |
+
+
+
+ start frame to render. Defaults to None. + |
+
+ None
+ |
+
mark_out |
+
+ int | None
+ |
+
+
+
+ end frame to render. Defaults to None. + |
+
+ None
+ |
+
pytvpaint/george/grg_clip.py
451 +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 |
|
tv_clip_save_structure_csv(export_path: Path | str, all_images: bool | None = None, exposure_label: str | None = None) -> None
+
+¶Save the current clip as a CSV.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ the .csv export path + |
+ + required + | +
all_images |
+
+ bool | None
+ |
+
+
+
+ export all images or only instances. Defaults to None. + |
+
+ None
+ |
+
exposure_label |
+
+ str | None
+ |
+
+
+
+ give a label when the image is an exposure. Defaults to None. + |
+
+ None
+ |
+
pytvpaint/george/grg_clip.py
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 |
|
tv_clip_save_structure_sprite(export_path: Path | str, layout: SpriteLayout | None = None, space: int | None = None) -> None
+
+¶Save the current clip as sprites in one image.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ the export path of the sprite image + |
+ + required + | +
layout |
+
+ pytvpaint.george.grg_base.SpriteLayout | None
+ |
+
+
+
+ the sprite layout. Defaults to None. + |
+
+ None
+ |
+
space |
+
+ int | None
+ |
+
+
+
+ the space between each sprite in the image. Defaults to None. + |
+
+ None
+ |
+
pytvpaint/george/grg_clip.py
528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 |
|
tv_clip_save_structure_flix(export_path: Path | str, mark_in: int | None = None, mark_out: int | None = None, parameters_import: str | None = None, parameters_file: str | None = None, send: bool | None = None, original_file: str | Path | None = None) -> None
+
+¶Save the current clip for Flix.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ the .xml export path + |
+ + required + | +
mark_in |
+
+ int | None
+ |
+
+
+
+ the start frame to render. Defaults to None. + |
+
+ None
+ |
+
mark_out |
+
+ int | None
+ |
+
+
+
+ the end frame to render. Defaults to None. + |
+
+ None
+ |
+
parameters_import |
+
+ str | None
+ |
+
+
+
+ the attribute(s) of the global |
+
+ None
+ |
+
parameters_file |
+
+ str | None
+ |
+
+
+
+ the attribute(s) of each |
+
+ None
+ |
+
send |
+
+ bool | None
+ |
+
+
+
+ open a browser with the prefilled url. Defaults to None. + |
+
+ None
+ |
+
original_file |
+
+ str | pathlib.Path | None
+ |
+
+
+
+ the original reference tvpp file path. Defaults to None. + |
+
+ None
+ |
+
pytvpaint/george/grg_clip.py
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 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 |
|
tv_sound_clip_info(clip_id: int, track_index: int) -> TVPSound
+
+¶Get information about a soundtrack.
+ +pytvpaint/george/grg_clip.py
600 +601 +602 +603 +604 |
|
tv_sound_clip_new(sound_path: Path | str) -> None
+
+¶Add a new soundtrack.
+ +pytvpaint/george/grg_clip.py
607 +608 +609 +610 +611 +612 |
|
tv_sound_clip_remove(track_index: int) -> None
+
+¶Remove a soundtrack.
+ +pytvpaint/george/grg_clip.py
615 +616 +617 |
|
tv_sound_clip_reload(clip_id: int, track_index: int) -> None
+
+¶Reload a soundtrack from its file.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
clip_id |
+
+ int
+ |
+
+
+
+ the clip id (only works with |
+ + required + | +
track_index |
+
+ int
+ |
+
+
+
+ the sound clip track index + |
+ + required + | +
this doesn't accept a proper clip id, only 0
seem to work for the current clip
pytvpaint/george/grg_clip.py
620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 |
|
tv_sound_clip_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 a soundtracks settings.
+ +pytvpaint/george/grg_clip.py
633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 |
|
tv_layer_image_get() -> int
+
+¶Get the current frame of the current clip.
+ +pytvpaint/george/grg_clip.py
664 +665 +666 |
|
tv_layer_image(frame: int) -> None
+
+¶Set the current frame of the current clip.
+ +pytvpaint/george/grg_clip.py
669 +670 +671 |
|
Custom George exceptions.
+ + + +GeorgeError(message: str | None = None, error_value: Any | None = None)
+
+¶
+ Bases: Exception
George error exception.
+Used for return values in the [ERROR]
section of functions in TVPaint's documentation.
pytvpaint/george/exceptions.py
14 +15 +16 +17 +18 |
|
NoObjectWithIdError(obj_id: int)
+
+¶
+ Bases: pytvpaint.george.exceptions.GeorgeError
Exception raised when a TVPaint was not found given its id.
+ +pytvpaint/george/exceptions.py
24 +25 |
|
Layer related George functions and enums.
+ + + +LayerColorAction
+
+
+¶tv_layercolor
actions.
Attributes:
+Name | +Type | +Description | +
---|---|---|
GETCOLOR |
+ + | +
+
+
+
+ |
+
SETCOLOR |
+ + | +
+
+
+
+ |
+
GET |
+ + | +
+
+
+
+ |
+
SET |
+ + | +
+
+
+
+ |
+
LOCK |
+ + | +
+
+
+
+ |
+
UNLOCK |
+ + | +
+
+
+
+ |
+
SHOW |
+ + | +
+
+
+
+ |
+
HIDE |
+ + | +
+
+
+
+ |
+
VISIBLE |
+ + | +
+
+
+
+ |
+
SELECT |
+ + | +
+
+
+
+ |
+
UNSELECT |
+ + | +
+
+
+
+ |
+
LayerColorDisplayOpt
+
+
+¶tv_layercolorshow
display options.
Attributes:
+Name | +Type | +Description | +
---|---|---|
DISPLAY |
+ + | +
+
+
+ Activate the layers to show them in the display + |
+
TIMELINE |
+ + | +
+
+
+ Uncollpase layers from maximum collapse (2px height) in the timeline + |
+
InstanceNamingMode
+
+
+¶InstanceNamingProcess
+
+
+¶LayerType
+
+
+¶StencilMode
+
+
+¶LayerBehavior
+
+
+¶LayerTransparency
+
+
+¶InsertDirection
+
+
+¶TVPClipLayerColor(clip_id: int, color_index: int, color_r: int, color_g: int, color_b: int, name: str)
+
+
+ dataclass
+
+
+¶Clip layer color values.
+ + + + +TVPLayer(id: int, visibility: bool, position: int, density: int, name: str, type: LayerType, first_frame: int, last_frame: int, selected: bool, editable: bool, stencil_state: StencilMode)
+
+
+ dataclass
+
+
+¶TVPaint layer info values.
+ + + + +tv_layer_current_id() -> int
+
+¶Get the id of the current layer.
+ +pytvpaint/george/grg_layer.py
198 +199 +200 |
|
tv_layer_get_id(position: int) -> int
+
+¶Get the id of the layer at the given position.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if no layer found at the provided position + |
+
pytvpaint/george/grg_layer.py
203 +204 +205 +206 +207 +208 +209 +210 +211 |
|
tv_layer_get_pos(layer_id: int) -> int
+
+¶Get the position of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 |
|
tv_layer_info(layer_id: int) -> TVPLayer
+
+¶Get information of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 |
|
tv_layer_move(position: int) -> None
+
+¶Move the current layer to a new position in the layer stack.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if layer could not be moved + |
+
pytvpaint/george/grg_layer.py
243 +244 +245 +246 +247 +248 +249 +250 |
|
tv_layer_set(layer_id: int) -> None
+
+¶Make the given layer the current one.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 |
|
tv_layer_selection_get(layer_id: int) -> bool
+
+¶Get the selection state of a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
266 +267 +268 +269 +270 +271 +272 +273 +274 |
|
tv_layer_selection_set(layer_id: int, new_state: bool) -> None
+
+¶Set the selection state of a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
277 +278 +279 +280 +281 +282 +283 +284 |
|
tv_layer_select(start_frame: int, frame_count: int) -> int
+
+¶Select frames in the current layer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
start_frame |
+
+ int
+ |
+
+
+
+ selection start + |
+ + required + | +
frame_count |
+
+ int
+ |
+
+
+
+ number of frames to select + |
+ + required + | +
Returns:
+Name | Type | +Description | +
---|---|---|
int |
+ int
+ |
+
+
+
+ number of frames selected + |
+
If the start position is before the beginning of the layer, the selection will only start at the beginning of +the layer, but its length will be measured from the start position. +This means that if you ask for a selection of 15 frames starting from position 0 in a layer that actually +starts at position 5, only the first 10 frames in the layer will be selected. +If the selection goes beyond the end of the layer, it will only include the frames between the start and end of +the layer. No frames will be selected if the start position is beyond the end of the layer
+pytvpaint/george/grg_layer.py
287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 |
|
tv_layer_select_info(full: bool = False) -> tuple[int, int]
+
+¶Get Selected frames in a layer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
full |
+
+ bool
+ |
+
+
+
+ Always get the selection range, even on a non anim/ctg layer + |
+
+ False
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
frame |
+ int
+ |
+
+
+
+ the start frame of the selection + |
+
count |
+ int
+ |
+
+
+
+ the number of frames in the selection + |
+
The official documentation states that this functions selects the layer frames, it does not, it simply
+returns the frames selected. This will also return all frames in the layer even if they are not selected if the
+argument full
is set to True. We advise using tv_layer_select
to select your frames and only using this
+function to get the selected frames.
pytvpaint/george/grg_layer.py
308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 |
|
tv_layer_create(name: str) -> int
+
+¶Create a new image layer with the given name.
+ +pytvpaint/george/grg_layer.py
330 +331 +332 |
|
tv_layer_duplicate(name: str) -> int
+
+¶Duplicate the current layer and make it the current one.
+ +pytvpaint/george/grg_layer.py
335 +336 +337 |
|
tv_layer_rename(layer_id: int, name: str) -> None
+
+¶Rename a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 |
|
tv_layer_kill(layer_id: int) -> None
+
+¶Delete the layer with provided id.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 |
|
tv_layer_density_get() -> int
+
+¶Get the current layer density (opacity).
+ +pytvpaint/george/grg_layer.py
366 +367 +368 |
|
tv_layer_density_set(new_density: int) -> None
+
+¶Set the current layer density (opacity ranging from 0 to 100).
+ +pytvpaint/george/grg_layer.py
371 +372 +373 |
|
tv_layer_display_get(layer_id: int) -> bool
+
+¶Get the visibility of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 |
|
tv_layer_display_set(layer_id: int, new_state: bool, light_table: bool = False) -> None
+
+¶Set the visibility of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 |
|
tv_layer_lock_get(layer_id: int) -> bool
+
+¶Get the lock state of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 |
|
tv_layer_lock_set(layer_id: int, new_state: bool) -> None
+
+¶Set the lock state of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 |
|
tv_layer_collapse_get(layer_id: int) -> bool
+
+¶Get the collapse mode of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 |
|
tv_layer_collapse_set(layer_id: int, new_state: bool) -> None
+
+¶Set the collapse mode of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 |
|
tv_layer_blending_mode_get(layer_id: int) -> BlendingMode
+
+¶Get the blending mode of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 |
|
tv_layer_blending_mode_set(layer_id: int, mode: BlendingMode) -> None
+
+¶Set the blending mode of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 |
|
tv_layer_stencil_get(layer_id: int) -> StencilMode
+
+¶Get the stencil state and mode of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 |
|
tv_layer_stencil_set(layer_id: int, mode: StencilMode) -> None
+
+¶Set the stencil state and mode of the given layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 |
|
tv_layer_show_thumbnails_get(layer_id: int) -> bool
+
+¶Get the show thumbnails state for a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 |
|
tv_layer_show_thumbnails_set(layer_id: int, state: bool) -> None
+
+¶Set the show thumbnail state for a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 |
|
tv_layer_auto_break_instance_get(layer_id: int) -> bool
+
+¶Get the layer auto break instance value for a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 |
|
tv_layer_auto_break_instance_set(layer_id: int, state: bool) -> None
+
+¶Set the layer auto break instance value for a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 |
|
tv_layer_auto_create_instance_get(layer_id: int) -> bool
+
+¶Get the layer auto create instance value for a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 |
|
tv_layer_auto_create_instance_set(layer_id: int, state: bool) -> None
+
+¶Set the layer auto create instance value for a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 |
|
tv_layer_pre_behavior_get(layer_id: int) -> LayerBehavior
+
+¶Get the pre-behavior value for a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 |
|
tv_layer_pre_behavior_set(layer_id: int, behavior: LayerBehavior) -> None
+
+¶Set the pre-behavior value for a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 |
|
tv_layer_post_behavior_get(layer_id: int) -> LayerBehavior
+
+¶Get the post-behavior value for a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 |
|
tv_layer_post_behavior_set(layer_id: int, behavior: LayerBehavior) -> None
+
+¶Set the post-behavior value for a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 |
|
tv_layer_lock_position_get(layer_id: int) -> bool
+
+¶Get the lock position state of a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 |
|
tv_layer_lock_position_set(layer_id: int, state: bool) -> None
+
+¶Set the lock position state of a layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 |
|
tv_preserve_get() -> LayerTransparency
+
+¶Get the preserve transparency state of the current layer.
+ +pytvpaint/george/grg_layer.py
721 +722 +723 +724 +725 |
|
tv_preserve_set(state: LayerTransparency) -> None
+
+¶Set the preserve transparency state of the current layer.
+ +pytvpaint/george/grg_layer.py
728 +729 +730 |
|
tv_layer_mark_get(layer_id: int, frame: int) -> int
+
+¶Get the mark color of a layer at a frame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
layer_id |
+
+ int
+ |
+
+
+
+ the layer id + |
+ + required + | +
frame |
+
+ int
+ |
+
+
+
+ the frame with a mark + |
+ + required + | +
Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
Returns:
+Name | Type | +Description | +
---|---|---|
int |
+ int
+ |
+
+
+
+ the mark color index + |
+
pytvpaint/george/grg_layer.py
733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 |
|
tv_layer_mark_set(layer_id: int, frame: int, color_index: int) -> None
+
+¶Set the mark of the layer's frame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
layer_id |
+
+ int
+ |
+
+
+
+ the layer id + |
+ + required + | +
frame |
+
+ int
+ |
+
+
+
+ the frame to set the mark (use 0 to remove it). + |
+ + required + | +
color_index |
+
+ int
+ |
+
+
+
+ the mark color + |
+ + required + | +
Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 |
|
tv_layer_anim(layer_id: int) -> None
+
+¶Convert the layer to an anim layer.
+ +pytvpaint/george/grg_layer.py
771 +772 +773 |
|
tv_layer_copy() -> None
+
+¶Copy the current image or the selected ones.
+ +pytvpaint/george/grg_layer.py
776 +777 +778 |
|
tv_layer_cut() -> None
+
+¶Cut the current image or the selected ones.
+ +pytvpaint/george/grg_layer.py
781 +782 +783 |
|
tv_layer_paste() -> None
+
+¶Paste the previously copied/cut images to the current layer.
+ +pytvpaint/george/grg_layer.py
786 +787 +788 |
|
tv_layer_insert_image(count: int = 1, direction: InsertDirection | None = None, duplicate: bool | None = None) -> None
+
+¶Add new image(s) before/after the current one and make it current.
+ +pytvpaint/george/grg_layer.py
791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 |
|
tv_layer_merge(layer_id: int, blending_mode: BlendingMode, stamp: bool = False, erase: bool = False, keep_color_grp: bool = True, keep_img_mark: bool = True, keep_instance_name: bool = True) -> None
+
+¶Merge the given layer with the current one.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
layer_id |
+
+ int
+ |
+
+
+
+ the layer id + |
+ + required + | +
blending_mode |
+
+ pytvpaint.george.grg_base.BlendingMode
+ |
+
+
+
+ the blending mode to use + |
+ + required + | +
stamp |
+
+ bool
+ |
+
+
+
+ Use stamp mode + |
+
+ False
+ |
+
erase |
+
+ bool
+ |
+
+
+
+ Remove the source layer + |
+
+ False
+ |
+
keep_color_grp |
+
+ bool
+ |
+
+
+
+ Keep the color group + |
+
+ True
+ |
+
keep_img_mark |
+
+ bool
+ |
+
+
+
+ Keep the image mark + |
+
+ True
+ |
+
keep_instance_name |
+
+ bool
+ |
+
+
+
+ Keep the instance name + |
+
+ True
+ |
+
pytvpaint/george/grg_layer.py
809 +810 +811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 |
|
tv_layer_merge_all(keep_color_grp: bool = True, keep_img_mark: bool = True, keep_instance_name: bool = True) -> None
+
+¶Merge all layers.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
keep_color_grp |
+
+ bool
+ |
+
+
+
+ Keep the color group + |
+
+ True
+ |
+
keep_img_mark |
+
+ bool
+ |
+
+
+
+ Keep the image mark + |
+
+ True
+ |
+
keep_instance_name |
+
+ bool
+ |
+
+
+
+ Keep the instance name + |
+
+ True
+ |
+
pytvpaint/george/grg_layer.py
849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 |
|
tv_layer_shift(layer_id: int, start: int) -> None
+
+¶Move the layer to a new frame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
layer_id |
+
+ int
+ |
+
+
+
+ layer id + |
+ + required + | +
start |
+
+ int
+ |
+
+
+
+ frame to shift layer to + |
+ + required + | +
pytvpaint/george/grg_layer.py
869 +870 +871 +872 +873 +874 +875 +876 |
|
tv_layer_load_dependencies(layer_id: int) -> None
+
+¶Load all dependencies of the given layer in memory.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 |
|
tv_layer_color_get_color(clip_id: int, color_index: int) -> TVPClipLayerColor
+
+¶Get a specific colors information in the clips color list.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 |
|
tv_layer_color_set_color(clip_id: int, color_index: int, color: RGBColor, name: str | None = None) -> None
+
+¶Set a specific colors information in the clips color list.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
The color with index 0 is the "Default" color, and it can't be changed
+pytvpaint/george/grg_layer.py
913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 |
|
tv_layer_color_get(layer_id: int) -> int
+
+¶Get the layer's color index from the clips color list.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 |
|
tv_layer_color_set(layer_id: int, color_index: int) -> None
+
+¶Set the layer's color index from the clips color list.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 |
|
tv_layer_color_lock(color_index: int) -> int
+
+¶Lock all layers that use the given color index.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
color_index |
+
+ int
+ |
+
+
+
+ the layer color index + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ int
+ |
+
+
+
+ the number of layers locked + |
+
pytvpaint/george/grg_layer.py
981 +982 +983 +984 +985 +986 +987 +988 +989 +990 |
|
tv_layer_color_unlock(color_index: int) -> int
+
+¶Unlock all layers that use the given color index.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
color_index |
+
+ int
+ |
+
+
+
+ the layer color index + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ int
+ |
+
+
+
+ the number of unlocked layers + |
+
pytvpaint/george/grg_layer.py
993 + 994 + 995 + 996 + 997 + 998 + 999 +1000 +1001 +1002 |
|
tv_layer_color_show(mode: LayerColorDisplayOpt, color_index: int) -> int
+
+¶Show all layers that use the given color index.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
mode |
+
+ pytvpaint.george.grg_layer.LayerColorDisplayOpt
+ |
+
+
+
+ the display mode + |
+ + required + | +
color_index |
+
+ int
+ |
+
+
+
+ the layer color index + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ int
+ |
+
+
+
+ the number of unlocked layers + |
+
pytvpaint/george/grg_layer.py
1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 |
|
tv_layer_color_hide(mode: LayerColorDisplayOpt, color_index: int) -> int
+
+¶Hide all layers that use the given color index.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
mode |
+
+ pytvpaint.george.grg_layer.LayerColorDisplayOpt
+ |
+
+
+
+ the display mode + |
+ + required + | +
color_index |
+
+ int
+ |
+
+
+
+ the layer color index + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ int
+ |
+
+
+
+ the number of unlocked layers + |
+
pytvpaint/george/grg_layer.py
1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 |
|
tv_layer_color_visible(color_index: int) -> bool
+
+¶Get the visibility of the color index (2px height) in the timeline.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 |
|
tv_layer_color_select(color_index: int) -> int
+
+¶Select all layers that use the given color index.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 |
|
tv_layer_color_unselect(color_index: int) -> int
+
+¶Unselect all layers that use the given color index.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id + |
+
pytvpaint/george/grg_layer.py
1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 |
|
tv_instance_name(layer_id: int, mode: InstanceNamingMode, prefix: str | None = None, suffix: str | None = None, process: InstanceNamingProcess | None = None) -> None
+
+¶Rename all instances.
+ +The suffix can only be added when using mode InstanceNamingMode.SMART
+Using a wrong layer_id causes a crash
+Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
layer_id |
+
+ int
+ |
+
+
+
+ the layer id + |
+ + required + | +
mode |
+
+ pytvpaint.george.grg_layer.InstanceNamingMode
+ |
+
+
+
+ the instance renaming mode + |
+ + required + | +
prefix |
+
+ str | None
+ |
+
+
+
+ the prefix to add to each name + |
+
+ None
+ |
+
suffix |
+
+ str | None
+ |
+
+
+
+ the suffix to add to each name + |
+
+ None
+ |
+
process |
+
+ pytvpaint.george.grg_layer.InstanceNamingProcess | None
+ |
+
+
+
+ the instance naming process + |
+
+ None
+ |
+
pytvpaint/george/grg_layer.py
1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 |
|
tv_instance_get_name(layer_id: int, frame: int) -> str
+
+¶Get the name of an instance.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
layer_id |
+
+ int
+ |
+
+
+
+ the layer id + |
+ + required + | +
frame |
+
+ int
+ |
+
+
+
+ the frame of the instance + |
+ + required + | +
Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.NoObjectWithIdError
+ |
+
+
+
+ if given an invalid layer id or an invalid instance frame + |
+
Returns:
+Type | +Description | +
---|---|
+ str
+ |
+
+
+
+ the instance name + |
+
pytvpaint/george/grg_layer.py
1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 |
|
tv_instance_set_name(layer_id: int, frame: int, name: str) -> str
+
+¶Set the name of an instance.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if an invalid layer id was provided or no instance was found at the given frame + |
+
pytvpaint/george/grg_layer.py
1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 |
|
tv_exposure_next() -> int
+
+¶Go to the next layer instance head.
+ + + +Returns:
+Type | +Description | +
---|---|
+ int
+ |
+
+
+
+ The next instances start frame + |
+
pytvpaint/george/grg_layer.py
1157 +1158 +1159 +1160 +1161 +1162 +1163 |
|
tv_exposure_break(frame: int) -> None
+
+¶Break a layer instance/exposure at the given frame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
frame |
+
+ int
+ |
+
+
+
+ the split frame + |
+ + required + | +
pytvpaint/george/grg_layer.py
1166 +1167 +1168 +1169 +1170 +1171 +1172 |
|
tv_exposure_add(frame: int, count: int) -> None
+
+¶Add new frames to an existing layer instance/exposure.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
frame |
+
+ int
+ |
+
+
+
+ the split frame + |
+ + required + | +
count |
+
+ int
+ |
+
+
+
+ the number of frames to add + |
+ + required + | +
pytvpaint/george/grg_layer.py
1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 |
|
tv_exposure_set(frame: int, count: int) -> None
+
+¶Set the number frames of an existing layer instance/exposure.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
frame |
+
+ int
+ |
+
+
+
+ the split frame + |
+ + required + | +
count |
+
+ int
+ |
+
+
+
+ the number of frames to add + |
+ + required + | +
pytvpaint/george/grg_layer.py
1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 |
|
tv_exposure_prev() -> int
+
+¶Go to the previous layer instance head (before the current instance).
+ + + +Returns:
+Type | +Description | +
---|---|
+ int
+ |
+
+
+
+ The previous instances start frame + |
+
pytvpaint/george/grg_layer.py
1195 +1196 +1197 +1198 +1199 +1200 +1201 |
|
tv_save_image(export_path: Path | str) -> None
+
+¶Save the current image of the current layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if the file couldn't be saved or an invalid format was provided + |
+
pytvpaint/george/grg_layer.py
1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 |
|
tv_load_image(img_path: Path | str, stretch: bool = False) -> None
+
+¶Load an image in the current image layer.
+ + + +Raises:
+Type | +Description | +
---|---|
+ FileNotFoundError
+ |
+
+
+
+ if the input file doesn't exist + |
+
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if the provided file is in an invalid format + |
+
pytvpaint/george/grg_layer.py
1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 |
|
tv_clear(fill_b_pen: bool = False) -> None
+
+¶Clear (or fill with BPen) the current image (selection) of the current layer.
+ +pytvpaint/george/grg_layer.py
1235 +1236 +1237 |
|
All George values as enum and functions which are not specific to any TVPaint element.
+ + + +GrgErrorValue
+
+
+¶Common George error values.
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
EMPTY |
+
+ str
+ |
+
+
+
+ See |
+
NONE |
+
+ str
+ |
+
+
+
+ See |
+
ERROR |
+
+ str
+ |
+
+
+
+ See |
+
GrgBoolState
+
+
+¶FieldOrder
+
+
+¶MarkType
+
+
+¶MarkReference
+
+
+¶MarkAction
+
+
+¶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
+
+
+¶Sprite layout when exporting as sprites.
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
RECTANGLE |
+ + | +
+
+
+
+ |
+
HORIZONTAL |
+ + | +
+
+
+
+ |
+
VERTICAL |
+ + | +
+
+
+
+ |
+
DIAGONAL |
+ + | +
+
+
+
+ |
+
ANTI_DIAGONAL |
+ + | +
+
+
+
+ |
+
AlphaMode
+
+
+¶The alpha load mode.
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
PREMULTIPLY |
+ + | +
+
+
+
+ |
+
NO_PREMULTIPLY |
+ + | +
+
+
+
+ |
+
NO_ALPHA |
+ + | +
+
+
+
+ |
+
ALPHA_ONLY |
+ + | +
+
+
+
+ |
+
GUESS |
+ + | +
+
+
+
+ |
+
AlphaSaveMode
+
+
+¶The alpha save mode.
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
PREMULTIPLY |
+ + | +
+
+
+
+ |
+
NO_PREMULTIPLY |
+ + | +
+
+
+
+ |
+
NO_ALPHA |
+ + | +
+
+
+
+ |
+
ALPHA_ONLY |
+ + | +
+
+
+
+ |
+
GUESS |
+ + | +
+
+
+
+ |
+
ALPHA_BINARY |
+ + | +
+
+
+
+ |
+
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.
+ +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.
+ +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
+
+
+¶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 |
+ + | +
+
+
+
+ |
+
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 |
+ + | +
+
+
+
+ |
+
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 |
+ + | +
+
+
+
+ |
+
FileMode
+
+
+¶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.
+ +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.
+ +pytvpaint/george/grg_base.py
612 +613 +614 +615 +616 +617 |
|
tv_warn(msg: str) -> None
+
+¶Display a warning message.
+ +pytvpaint/george/grg_base.py
620 +621 +622 |
|
tv_version() -> tuple[str, str, str]
+
+¶Returns the software name, version and language.
+ +pytvpaint/george/grg_base.py
625 +626 +627 +628 +629 +630 +631 +632 +633 +634 |
|
tv_quit() -> None
+
+¶Closes the TVPaint instance.
+ +pytvpaint/george/grg_base.py
637 +638 +639 |
|
tv_host2back() -> None
+
+¶Minimize the TVPaint window.
+ +pytvpaint/george/grg_base.py
642 +643 +644 |
|
tv_host2front() -> None
+
+¶Restore the TVPaint window after being minimized.
+ +pytvpaint/george/grg_base.py
647 +648 +649 |
|
tv_menu_hide() -> None
+
+¶Switch to inlay view and hide all non-docking panels.
+ +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...
+ +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.
+ +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" + |
+
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 + |
+
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 + |
+
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 + |
+
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 + |
+
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 + |
+
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 + |
+
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.
+ +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).
+ +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)
+ +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).
+ +pytvpaint/george/grg_base.py
859 +860 +861 |
|
tv_save_mode_get() -> tuple[SaveFormat, list[str]]
+
+¶Get the saving alpha mode.
+ +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.
+ +pytvpaint/george/grg_base.py
872 +873 +874 +875 +876 |
|
tv_alpha_load_mode_get() -> AlphaMode
+
+¶Set the loading alpha mode.
+ +pytvpaint/george/grg_base.py
879 +880 +881 +882 |
|
tv_alpha_load_mode_set(mode: AlphaMode) -> None
+
+¶Get the loading alpha mode.
+ +pytvpaint/george/grg_base.py
885 +886 +887 |
|
tv_alpha_save_mode_get() -> AlphaSaveMode
+
+¶Get the saving alpha mode.
+ +pytvpaint/george/grg_base.py
890 +891 +892 +893 |
|
tv_alpha_save_mode_set(mode: AlphaSaveMode) -> None
+
+¶Set the saving alpha mode.
+ +pytvpaint/george/grg_base.py
896 +897 +898 |
|
tv_mark_in_get(reference: MarkReference) -> tuple[int, MarkAction]
+
+¶Get markin of the project / clip.
+ +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.
+ +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.
+ +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.
+ +pytvpaint/george/grg_base.py
924 +925 +926 +927 +928 |
|
tv_get_active_shape() -> TVPShape
+
+¶Get the current shape.
+ +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 + |
+
+ {}
+ |
+
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.
+ +pytvpaint/george/grg_base.py
1027 +1028 +1029 |
|
tv_set_a_pen_hsl(color: HSLColor) -> HSLColor
+
+¶Set the A Pen HSL color.
+ +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.
+ +pytvpaint/george/grg_base.py
1037 +1038 +1039 |
|
tv_set_b_pen_hsl(color: HSLColor) -> HSLColor
+
+¶Set the B Pen HSL color.
+ +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.
+ +pytvpaint/george/grg_base.py
1047 +1048 +1049 +1050 |
|
tv_pen_brush_get(tool_mode: bool = False) -> TVPPenBrush
+
+¶Get pen brush parameters.
+ +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.
+ +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
+ |
+
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
+ |
+
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 + | +
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
+ |
+
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
+ |
+
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).
+ +pytvpaint/george/grg_base.py
1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 |
|
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, start_frame: int)
+
+
+ dataclass
+
+
+¶TVPaint project info values.
+ + + + +BackgroundMode
+
+
+¶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 + |
+
pytvpaint/george/grg_project.py
54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 |
|
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
+ |
+
pytvpaint/george/grg_project.py
79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 |
|
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 + |
+
pytvpaint/george/grg_project.py
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 |
|
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 + |
+
pytvpaint/george/grg_project.py
128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 |
|
tv_save_project(project_path: Path | str) -> None
+
+¶Save the current project as tvpp.
+ +pytvpaint/george/grg_project.py
149 +150 +151 +152 +153 +154 +155 +156 +157 +158 |
|
tv_project_duplicate() -> None
+
+¶Duplicate the current project.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if an error occurred during the project creation. + |
+
pytvpaint/george/grg_project.py
161 +162 +163 +164 +165 +166 +167 +168 |
|
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. + |
+
pytvpaint/george/grg_project.py
171 +172 +173 +174 +175 +176 +177 +178 |
|
tv_project_current_id() -> str
+
+¶Get the id of the current project.
+ +pytvpaint/george/grg_project.py
181 +182 +183 |
|
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 + |
+
pytvpaint/george/grg_project.py
186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 |
|
tv_get_project_name() -> str
+
+¶Returns the save path of the current project.
+ +pytvpaint/george/grg_project.py
202 +203 +204 |
|
tv_project_select(project_id: str) -> str
+
+¶Make the given project current.
+ +pytvpaint/george/grg_project.py
207 +208 +209 |
|
tv_project_close(project_id: str) -> None
+
+¶Close the given project.
+ +pytvpaint/george/grg_project.py
212 +213 +214 |
|
tv_resize_project(width: int, height: int) -> None
+
+¶Resize the current project.
+ +creates a resized copy of the project with a new id
+pytvpaint/george/grg_project.py
217 +218 +219 +220 +221 +222 +223 |
|
tv_resize_page(width: int, height: int, resize_opt: ResizeOption) -> None
+
+¶Create a new resized project and close the current one.
+ +pytvpaint/george/grg_project.py
226 +227 +228 |
|
tv_get_width() -> int
+
+¶Get the current project width.
+ +pytvpaint/george/grg_project.py
231 +232 +233 |
|
tv_get_height() -> int
+
+¶Get the current project height.
+ +pytvpaint/george/grg_project.py
236 +237 +238 |
|
tv_ratio() -> float
+
+¶Get the current project pixel aspect ratio.
+ +Doesn't work and always returns an empty string
+pytvpaint/george/grg_project.py
241 +242 +243 +244 +245 +246 +247 |
|
tv_get_field() -> FieldOrder
+
+¶Get the current project field mode.
+ +pytvpaint/george/grg_project.py
250 +251 +252 |
|
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.
+ +pytvpaint/george/grg_project.py
255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 |
|
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 + |
+
pytvpaint/george/grg_project.py
277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 |
|
tv_frame_rate_get() -> tuple[float, float]
+
+¶Get the framerate of the current project.
+ +pytvpaint/george/grg_project.py
290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 |
|
tv_frame_rate_set(frame_rate: float, time_stretch: bool = False, preview: bool = False) -> None
+
+¶Get the framerate of the current project.
+ +pytvpaint/george/grg_project.py
303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 |
|
tv_frame_rate_project_set(frame_rate: float, time_stretch: bool = False) -> None
+
+¶Set the framerate of the current project.
+ +pytvpaint/george/grg_project.py
316 +317 +318 +319 +320 +321 |
|
tv_frame_rate_preview_set(frame_rate: float) -> None
+
+¶Set the framerate of the preview (playback).
+ +pytvpaint/george/grg_project.py
324 +325 +326 |
|
tv_project_current_frame_get() -> int
+
+¶Get the current frame of the current project.
+ +pytvpaint/george/grg_project.py
329 +330 +331 |
|
tv_project_current_frame_set(frame: int) -> int
+
+¶Set the current frame of the current project.
+ +this is relative to the current clip markin
+pytvpaint/george/grg_project.py
334 +335 +336 +337 +338 +339 +340 |
|
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 + |
+
pytvpaint/george/grg_project.py
343 +344 +345 +346 +347 +348 +349 +350 +351 +352 |
|
tv_save_palette(palette_path: Path | str) -> None
+
+¶Save the current palette.
+ + + +Raises:
+Type | +Description | +
---|---|
+ FileNotFoundError
+ |
+
+
+
+ if palette save directory doesn't exist + |
+
pytvpaint/george/grg_project.py
355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 |
|
tv_project_save_video_dependencies(project_id: str, on_save: bool = True, now: bool = False) -> int
+
+¶Saves current project video dependencies.
+ +pytvpaint/george/grg_project.py
372 +373 +374 +375 +376 +377 +378 +379 +380 +381 |
|
tv_project_save_audio_dependencies(project_id: str, on_save: bool = True) -> int
+
+¶Saves current project audio dependencies.
+ +pytvpaint/george/grg_project.py
384 +385 +386 +387 +388 +389 +390 +391 +392 +393 |
|
tv_sound_project_info(project_id: str, track_index: int) -> TVPSound
+
+¶Get information about a project soundtrack.
+ +pytvpaint/george/grg_project.py
396 +397 +398 +399 +400 +401 +402 |
|
tv_sound_project_new(sound_path: Path | str) -> None
+
+¶Add a new soundtrack to the current project.
+ +pytvpaint/george/grg_project.py
405 +406 +407 +408 +409 +410 +411 |
|
tv_sound_project_remove(track_index: int) -> None
+
+¶Remove a soundtrack from the current project.
+ +pytvpaint/george/grg_project.py
414 +415 +416 |
|
tv_sound_project_reload(project_id: str, track_index: int) -> None
+
+¶Reload a project soundtracks file.
+ +pytvpaint/george/grg_project.py
419 +420 +421 +422 +423 +424 +425 +426 |
|
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.
+ +pytvpaint/george/grg_project.py
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 +455 +456 +457 |
|
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 + |
+
pytvpaint/george/grg_project.py
460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 |
|
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 + |
+
pytvpaint/george/grg_project.py
477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 |
|
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 + |
+
pytvpaint/george/grg_project.py
495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 |
|
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 + |
+
pytvpaint/george/grg_project.py
512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 |
|
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 + |
+
pytvpaint/george/grg_project.py
530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 |
|
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 + |
+
pytvpaint/george/grg_project.py
547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 |
|
tv_start_frame_get() -> int
+
+¶Get the start frame of the current project.
+ +pytvpaint/george/grg_project.py
565 +566 +567 |
|
tv_start_frame_set(start_frame: int) -> int
+
+¶Set the start frame of the current project.
+ +pytvpaint/george/grg_project.py
570 +571 +572 |
|
Scene related George functions.
+ + + +tv_scene_enum_id(position: int) -> int
+
+¶Get the id of the scene at the given position in the current project.
+ + + +Raises:
+Type | +Description | +
---|---|
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
+
+
+ if no scene found at the provided position + |
+
pytvpaint/george/grg_scene.py
9 +10 +11 +12 +13 +14 +15 +16 |
|
tv_scene_current_id() -> int
+
+¶Get the id of the current scene.
+ +pytvpaint/george/grg_scene.py
19 +20 +21 |
|
tv_scene_move(scene_id: int, position: int) -> None
+
+¶Move a scene to another position.
+ +pytvpaint/george/grg_scene.py
24 +25 +26 |
|
tv_scene_new() -> None
+
+¶Create a new scene (with a new clip) after the current scene.
+ +pytvpaint/george/grg_scene.py
29 +30 +31 |
|
tv_scene_duplicate(scene_id: int) -> None
+
+¶Duplicate the given scene.
+ +pytvpaint/george/grg_scene.py
34 +35 +36 |
|
tv_scene_close(scene_id: int) -> None
+
+¶Remove the given scene.
+ +pytvpaint/george/grg_scene.py
39 +40 +41 |
|
Camera related objects and classes.
+ + + +Camera(clip: Clip, data: george.TVPCamera | None = None)
+
+¶
+ Bases: pytvpaint.utils.Refreshable
The Camera class represents the camera in a TVPaint clip.
+There's only one camera in the clip so instantiating multiple objects of this class won't create cameras.
+ +pytvpaint/camera.py
26 +27 +28 +29 +30 |
|
clip: Clip
+
+
+ property
+
+
+¶The camera's clip.
+points: Iterator[CameraPoint]
+
+
+ property
+
+
+¶Iterator for the CameraPoint
objects of the camera.
refresh() -> None
+
+¶Refreshed the camera data.
+ +pytvpaint/camera.py
32 +33 +34 +35 +36 |
|
make_current() -> None
+
+¶Makes the parent clip the current one, thereby making sure the correct camera will be set.
+ +pytvpaint/camera.py
47 +48 +49 |
|
anti_aliasing() -> int
+
+¶The antialiasing value of the camera.
+ +pytvpaint/camera.py
106 +107 +108 +109 +110 |
|
insert_point(index: int, x: int, y: int, angle: int, scale: float) -> CameraPoint
+
+¶Insert a new point in the camera path.
+ +pytvpaint/camera.py
123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 |
|
get_point_data_at(position: float) -> george.TVPCameraPoint
+
+¶Get the points data interpolated at that position (between 0 and 1).
+ +pytvpaint/camera.py
145 +146 +147 +148 +149 |
|
remove_point(index: int) -> None
+
+¶Remove a point at that index.
+ +pytvpaint/camera.py
151 +152 +153 +154 +155 +156 +157 +158 |
|
CameraPoint(index: int, camera: Camera, data: george.TVPCameraPoint | None = None)
+
+¶
+ Bases: pytvpaint.utils.Removable
A CameraPoint is a point on the camera path.
+You can use them to animate the camera movement.
+ +pytvpaint/camera.py
167 +168 +169 +170 +171 +172 +173 +174 +175 +176 |
|
data: george.TVPCameraPoint
+
+
+ property
+
+
+¶Returns the raw data of the point.
+index: int
+
+
+ property
+
+
+¶The index of the point in the path.
+camera: Camera
+
+
+ property
+
+
+¶The camera instance it belongs to.
+refresh() -> None
+
+¶Refreshed the camera point data.
+ +pytvpaint/camera.py
178 +179 +180 +181 +182 +183 |
|
new(camera: Camera, index: int, x: int, y: int, angle: int, scale: float) -> CameraPoint
+
+
+ classmethod
+
+
+¶Create a new point and add it to the camera path at that index.
+ +pytvpaint/camera.py
276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 |
|
remove() -> None
+
+¶Remove the camera point.
+ +the point instance won't be usable after that call
+pytvpaint/camera.py
290 +291 +292 +293 +294 +295 +296 +297 |
|
Clip object class module.
+ + + +Clip(clip_id: int, project: Project | None = None)
+
+¶
+ Bases: pytvpaint.utils.Removable
, pytvpaint.utils.Renderable
A Clip is a container for layers and is part of a Scene.
+ +Constructs a Clip from an existing TVPaint clip (giving its id).
+ +You should use Clip.new
to create a new clip
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
clip_id |
+
+ int
+ |
+
+
+
+ an existing clip id + |
+ + required + | +
project |
+
+ pytvpaint.project.Project | None
+ |
+
+
+
+ the project or the current one if None + |
+
+ None
+ |
+
pytvpaint/clip.py
30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 |
|
id: int
+
+
+ property
+
+
+¶The clip id.
+project: Project
+
+
+ property
+
+
+¶The clip's project.
+scene: Scene
+
+
+ property
+ writable
+
+
+¶The clip's scene.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if clip cannot be found in the project + |
+
camera: Camera
+
+
+ property
+
+
+¶The clip camera.
+position: int
+
+
+ property
+ writable
+
+
+¶The position of the clip in the scene.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if clip cannot be found in the project + |
+
name: str
+
+
+ property
+ writable
+
+
+¶The clip name.
+duration: int
+
+
+ property
+
+
+¶The duration of the clip in frames. Takes into account the mark in/out of the clip.
+is_selected: bool
+
+
+ property
+ writable
+
+
+¶Returns True if the clip is selected.
+is_visible: bool
+
+
+ property
+ writable
+
+
+¶Returns True if the clip is visible.
+color_index: int
+
+
+ property
+ writable
+
+
+¶Get the clip color index.
+action_text: str
+
+
+ property
+ writable
+
+
+¶Get the action text of the clip.
+dialog_text: str
+
+
+ property
+ writable
+
+
+¶Get the dialog text of the clip.
+note_text: str
+
+
+ property
+ writable
+
+
+¶Get the note text of the clip.
+current_frame: int
+
+
+ property
+ writable
+
+
+¶Returns the current frame in the clip (timeline) relative to the project start frame.
+layer_ids: Iterator[int]
+
+
+ property
+
+
+¶Iterator over the layer ids.
+layers: Iterator[Layer]
+
+
+ property
+
+
+¶Iterator over the clip's layers.
+layer_names: Iterator[str]
+
+
+ property
+
+
+¶Iterator over the clip's layer names.
+current_layer: Layer
+
+
+ property
+
+
+¶Get the current layer in the clip.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if clip cannot be found in the project + |
+
selected_layers: Iterator[Layer]
+
+
+ property
+
+
+¶Iterator over the selected layers.
+visible_layers: Iterator[Layer]
+
+
+ property
+
+
+¶Iterator over the visible layers.
+mark_in: int | None
+
+
+ property
+ writable
+
+
+¶Get the mark in of the clip.
+mark_out: int | None
+
+
+ property
+ writable
+
+
+¶Get the mark out of the clip.
+layer_colors: Iterator[LayerColor]
+
+
+ property
+
+
+¶Iterator over the layer colors.
+bookmarks: Iterator[int]
+
+
+ property
+
+
+¶Iterator over the clip bookmarks.
+sounds: Iterator[ClipSound]
+
+
+ property
+
+
+¶Iterates through the clip's soundtracks.
+new(name: str, scene: Scene | None = None, project: Project | None = None) -> Clip
+
+
+ classmethod
+
+
+¶Creates a new clip.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
name |
+
+ str
+ |
+
+
+
+ the new clip name + |
+ + required + | +
scene |
+
+ pytvpaint.scene.Scene | None
+ |
+
+
+
+ the scene or the current one if None. Defaults to None. + |
+
+ None
+ |
+
project |
+
+ pytvpaint.project.Project | None
+ |
+
+
+
+ the project or the current one if None. Defaults to None. + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
Clip |
+ pytvpaint.clip.Clip
+ |
+
+
+
+ the newly created clip + |
+
pytvpaint/clip.py
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 |
|
refresh() -> None
+
+¶Refreshes the clip data.
+ +pytvpaint/clip.py
91 +92 +93 +94 +95 +96 |
|
make_current() -> None
+
+¶Make the clip the current one.
+ +pytvpaint/clip.py
98 + 99 +100 +101 +102 |
|
start() -> int
+
+¶The start frame of the clip.
+ +pytvpaint/clip.py
170 +171 +172 +173 |
|
end() -> int
+
+¶The end frame of the clip.
+ +pytvpaint/clip.py
175 +176 +177 +178 |
|
timeline_start() -> int
+
+¶The start frame of the clip relative to the project's timeline.
+ +pytvpaint/clip.py
185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 |
|
timeline_end() -> int
+
+¶The end frame of the clip relative to the project's timeline.
+ +pytvpaint/clip.py
200 +201 +202 +203 +204 +205 +206 |
|
frame_count() -> int
+
+¶The clip's frame count.
+ +pytvpaint/clip.py
208 +209 +210 +211 |
|
is_current() -> bool
+
+¶Returns True if the clip is the current one.
+ +pytvpaint/clip.py
273 +274 +275 +276 |
|
current_clip_id() -> int
+
+
+ staticmethod
+
+
+¶Returns the id of the current clip.
+ +pytvpaint/clip.py
278 +279 +280 +281 |
|
current_clip() -> Clip
+
+
+ staticmethod
+
+
+¶Returns the current clip object.
+ +pytvpaint/clip.py
283 +284 +285 +286 +287 +288 |
|
duplicate() -> Clip
+
+¶Duplicates the clip.
+ +a new unique name is choosen for the duplicated clip with get_unique_name
.
pytvpaint/clip.py
302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 |
|
remove() -> None
+
+¶Removes the clip.
+ +the instance is not usable after that call because it's marked as removed.
+pytvpaint/clip.py
314 +315 +316 +317 +318 +319 +320 +321 |
|
get_layer(by_id: int | None = None, by_name: str | None = None) -> Layer | None
+
+¶Get a specific layer by id or name.
+ +pytvpaint/clip.py
356 +357 +358 +359 +360 +361 +362 |
|
add_layer(layer_name: str) -> Layer
+
+¶Add a new layer in the layer stack.
+ +pytvpaint/clip.py
364 +365 +366 +367 |
|
load_media(media_path: Path, start_count: tuple[int, int] | None = None, stretch: bool = False, time_stretch: bool = False, preload: bool = False, with_name: str = '', field_order: george.FieldOrder = george.FieldOrder.LOWER) -> Layer
+
+¶Loads a media (single frame, video, ...) into a new Layer in the clip.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
media_path |
+
+ pathlib.Path
+ |
+
+
+
+ the path of the media. If it's a file sequence, give the path of the first image. + |
+ + required + | +
start_count |
+
+ tuple[int, int] | None
+ |
+
+
+
+ the start and number of image of sequence to load. Defaults to None. + |
+
+ None
+ |
+
stretch |
+
+ bool
+ |
+
+
+
+ Stretch each image to the size of the layer. Defaults to None. + |
+
+ False
+ |
+
time_stretch |
+
+ bool
+ |
+
+
+
+ Once loaded, the layer will have a new number of image corresponding to the project framerate. Defaults to None. + |
+
+ False
+ |
+
preload |
+
+ bool
+ |
+
+
+
+ Load all the images in memory, no more reference on the files. Defaults to None. + |
+
+ False
+ |
+
with_name |
+
+ str
+ |
+
+
+
+ the name of the new layer + |
+
+ ''
+ |
+
field_order |
+
+ pytvpaint.george.FieldOrder
+ |
+
+
+
+ the field order. Defaults to None. + |
+
+ pytvpaint.george.FieldOrder.LOWER
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
Layer |
+ pytvpaint.layer.Layer
+ |
+
+
+
+ the new layer created + |
+
pytvpaint/clip.py
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 |
|
render(output_path: Path | str | FileSequence, start: int | None = None, end: int | None = None, use_camera: bool = False, layer_selection: list[Layer] | None = None, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = None, format_opts: list[str] | None = None) -> None
+
+¶Render the clip to a single frame or frame sequence or movie.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
output_path |
+
+ pathlib.Path | str | fileseq.filesequence.FileSequence
+ |
+
+
+
+ a single file or file sequence pattern + |
+ + required + | +
start |
+
+ int | None
+ |
+
+
+
+ the start frame to render or the mark in or the clip's start if None. Defaults to None. + |
+
+ None
+ |
+
end |
+
+ int | None
+ |
+
+
+
+ the end frame to render or the mark out or the clip's end if None. Defaults to None. + |
+
+ None
+ |
+
use_camera |
+
+ bool
+ |
+
+
+
+ use the camera for rendering, otherwise render the whole canvas. Defaults to False. + |
+
+ False
+ |
+
layer_selection |
+
+ list[pytvpaint.layer.Layer] | None
+ |
+
+
+
+ list of layers to render, if None render all of them. Defaults to None. + |
+
+ None
+ |
+
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode
+ |
+
+
+
+ the alpha mode for rendering. Defaults to george.AlphaSaveMode.PREMULTIPLY. + |
+
+ pytvpaint.george.AlphaSaveMode.PREMULTIPLY
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the background mode for rendering. Defaults to None. + |
+
+ None
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ custom format options. Defaults to None. + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if requested range (start-end) not in clip range/bounds + |
+
+ ValueError
+ |
+
+
+
+ if output is a movie, and it's duration is equal to 1 frame + |
+
+ FileNotFoundError
+ |
+
+
+
+ if the render failed and no files were found on disk or missing frames + |
+
This functions uses the clip's range as a basis (start-end). This is different from a project range, which
+uses the project timeline. For more details on the differences in frame ranges and the timeline in TVPaint,
+please check the Usage/Rendering
section of the documentation.
Even tough pytvpaint does a pretty good job of correcting the frame ranges for rendering, we're still +encountering some weird edge cases where TVPaint will consider the range invalid for seemingly no reason.
+pytvpaint/clip.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 |
|
export_tvp(export_path: Path | str) -> None
+
+¶Exports the clip in .tvp format which can be imported as a project in TVPaint.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if output extension is not (.tvp) + |
+
+ FileNotFoundError
+ |
+
+
+
+ if the render failed and no files were found on disk + |
+
pytvpaint/clip.py
506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 |
|
export_json(export_path: Path | str, save_format: george.SaveFormat, folder_pattern: str = '[%3li] %ln', file_pattern: str = '[%3ii] %ln', layer_selection: list[Layer] | None = None, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = None, format_opts: list[str] | None = None, all_images: bool = False, ignore_duplicates: bool = False) -> None
+
+¶Exports the instances (or all the images) of layers in the clip and a JSON file describing the structure of that clip.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ the JSON export path + |
+ + required + | +
save_format |
+
+ pytvpaint.george.SaveFormat
+ |
+
+
+
+ file format to use for rendering + |
+ + required + | +
folder_pattern |
+
+ str
+ |
+
+
+
+ the folder name pattern (%li: layer index, %ln: layer name, %fi: file index (added in 11.0.8)). Defaults to None. + |
+
+ '[%3li] %ln'
+ |
+
file_pattern |
+
+ str
+ |
+
+
+
+ the file name pattern (%li: layer index, %ln: layer name, %ii: image index, %in: image name, %fi: file index (added in 11.0.8)). Defaults to None. + |
+
+ '[%3ii] %ln'
+ |
+
layer_selection |
+
+ list[pytvpaint.layer.Layer] | None
+ |
+
+
+
+ list of layers to render or all if None. Defaults to None. + |
+
+ None
+ |
+
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode
+ |
+
+
+
+ the export alpha mode. Defaults to george.AlphaSaveMode.PREMULTIPLY. + |
+
+ pytvpaint.george.AlphaSaveMode.PREMULTIPLY
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the export background mode. Defaults to None. + |
+
+ None
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ custom format options. Defaults to None. + |
+
+ None
+ |
+
all_images |
+
+ bool
+ |
+
+
+
+ export all images (not only the instances). Defaults to False. + |
+
+ False
+ |
+
ignore_duplicates |
+
+ bool
+ |
+
+
+
+ Ignore duplicates images. Defaults to None. + |
+
+ False
+ |
+
Raises:
+Type | +Description | +
---|---|
+ FileNotFoundError
+ |
+
+
+
+ if the export failed and no files were found on disk + |
+
pytvpaint/clip.py
527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +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 |
|
export_psd(export_path: Path | str, mode: george.PSDSaveMode, start: int | None = None, end: int | None = None, layer_selection: list[Layer] | None = None, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = None, format_opts: list[str] | None = None) -> None
+
+¶Save the current clip as a PSD.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ the PSD save path + |
+ + required + | +
mode |
+
+ pytvpaint.george.PSDSaveMode
+ |
+
+
+
+ whether to save all the images, only the instances or inside the markin + |
+ + required + | +
start |
+
+ int | None
+ |
+
+
+
+ the start frame. Defaults to None. + |
+
+ None
+ |
+
end |
+
+ int | None
+ |
+
+
+
+ the end frame. Defaults to None. + |
+
+ None
+ |
+
layer_selection |
+
+ list[pytvpaint.layer.Layer] | None
+ |
+
+
+
+ layers to render. Defaults to None (render all the layers). + |
+
+ None
+ |
+
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode
+ |
+
+
+
+ the alpha save mode. Defaults to george.AlphaSaveMode.PREMULTIPLY. + |
+
+ pytvpaint.george.AlphaSaveMode.PREMULTIPLY
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the export background mode. Defaults to None. + |
+
+ None
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ custom format options. Defaults to None. + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ FileNotFoundError
+ |
+
+
+
+ if the export failed and no files were found on disk + |
+
pytvpaint/clip.py
584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 |
|
export_csv(export_path: Path | str, save_format: george.SaveFormat, all_images: bool = False, exposure_label: str = '', layer_selection: list[Layer] | None = None, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = None, format_opts: list[str] | None = None) -> None
+
+¶Save the current clip as a CSV.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ the .csv export path + |
+ + required + | +
save_format |
+
+ pytvpaint.george.SaveFormat
+ |
+
+
+
+ file format to use for rendering + |
+ + required + | +
all_images |
+
+ bool
+ |
+
+
+
+ export all images or only instances. Defaults to None. + |
+
+ False
+ |
+
exposure_label |
+
+ str
+ |
+
+
+
+ give a label when the image is an exposure. Defaults to None. + |
+
+ ''
+ |
+
layer_selection |
+
+ list[pytvpaint.layer.Layer] | None
+ |
+
+
+
+ layers to render. Defaults to None (render all the layers). + |
+
+ None
+ |
+
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode
+ |
+
+
+
+ the alpha save mode. Defaults to george.AlphaSaveMode.PREMULTIPLY. + |
+
+ pytvpaint.george.AlphaSaveMode.PREMULTIPLY
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the export background mode. Defaults to None. + |
+
+ None
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ custom format options. Defaults to None. + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if the extension is not .csv + |
+
+ FileNotFoundError
+ |
+
+
+
+ if the render failed and no files were found on disk + |
+
pytvpaint/clip.py
642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 |
|
export_sprites(export_path: Path | str, layout: george.SpriteLayout | None = None, space: int = 0, layer_selection: list[Layer] | None = None, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = None, format_opts: list[str] | None = None) -> None
+
+¶Save the current clip as sprites in one image.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ description + |
+ + required + | +
layout |
+
+ pytvpaint.george.SpriteLayout | None
+ |
+
+
+
+ the sprite layout. Defaults to None. + |
+
+ None
+ |
+
space |
+
+ int
+ |
+
+
+
+ the space between each sprite in the image. Defaults to None. + |
+
+ 0
+ |
+
layer_selection |
+
+ list[pytvpaint.layer.Layer] | None
+ |
+
+
+
+ layers to render. Defaults to None (render all the layers). + |
+
+ None
+ |
+
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode
+ |
+
+
+
+ the alpha save mode. Defaults to george.AlphaSaveMode.PREMULTIPLY. + |
+
+ pytvpaint.george.AlphaSaveMode.PREMULTIPLY
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the export background mode. Defaults to None. + |
+
+ None
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ custom format options. Defaults to None. + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ FileNotFoundError
+ |
+
+
+
+ if the export failed and no files were found on disk + |
+
pytvpaint/clip.py
685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 |
|
export_flix(export_path: Path | str, start: int | None = None, end: int | None = None, import_parameters: str = '', file_parameters: str = '', send: bool = False, layer_selection: list[Layer] | None = None, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = None, format_opts: list[str] | None = None) -> None
+
+¶Save the current clip for Flix.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ the .xml export path + |
+ + required + | +
start |
+
+ int | None
+ |
+
+
+
+ the start frame. Defaults to None. + |
+
+ None
+ |
+
end |
+
+ int | None
+ |
+
+
+
+ the end frame. Defaults to None. + |
+
+ None
+ |
+
import_parameters |
+
+ str
+ |
+
+
+
+ the attribute(s) of the global |
+
+ ''
+ |
+
file_parameters |
+
+ str
+ |
+
+
+
+ the attribute(s) of each |
+
+ ''
+ |
+
send |
+
+ bool
+ |
+
+
+
+ open a browser with the prefilled url. Defaults to None. + |
+
+ False
+ |
+
layer_selection |
+
+ list[pytvpaint.layer.Layer] | None
+ |
+
+
+
+ layers to render. Defaults to None (render all the layers). + |
+
+ None
+ |
+
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode
+ |
+
+
+
+ the alpha save mode. Defaults to george.AlphaSaveMode.PREMULTIPLY. + |
+
+ pytvpaint.george.AlphaSaveMode.PREMULTIPLY
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the export background mode. Defaults to None. + |
+
+ None
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ custom format options. Defaults to None. + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if the extension is not .xml + |
+
+ FileNotFoundError
+ |
+
+
+
+ if the export failed and no files were found on disk + |
+
pytvpaint/clip.py
723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 |
|
set_layer_color(layer_color: LayerColor) -> None
+
+¶Set the layer color at the provided index.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
layer_color |
+
+ pytvpaint.layer.LayerColor
+ |
+
+
+
+ the layer color instance. + |
+ + required + | +
pytvpaint/clip.py
846 +847 +848 +849 +850 +851 +852 +853 +854 |
|
get_layer_color(by_index: int | None = None, by_name: str | None = None) -> LayerColor | None
+
+¶Get a layer color by index or name.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if none of the arguments |
+
pytvpaint/clip.py
856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 |
|
add_bookmark(frame: int) -> None
+
+¶Add a bookmark at that frame.
+ +pytvpaint/clip.py
888 +889 +890 |
|
remove_bookmark(frame: int) -> None
+
+¶Remove a bookmark at that frame.
+ +pytvpaint/clip.py
892 +893 +894 |
|
clear_bookmarks() -> None
+
+¶Remove all the bookmarks.
+ +pytvpaint/clip.py
896 +897 +898 +899 +900 |
|
go_to_previous_bookmark() -> None
+
+¶Go to the previous bookmarks frame.
+ +pytvpaint/clip.py
902 +903 +904 +905 |
|
go_to_next_bookmark() -> None
+
+¶Go to the next bookmarks frame.
+ +pytvpaint/clip.py
907 +908 +909 +910 |
|
get_sound(by_id: int | None = None, by_path: Path | str | None = None) -> ClipSound | None
+
+¶Get a clip sound by id or by path.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if sound object could not be found in clip + |
+
pytvpaint/clip.py
922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 |
|
add_sound(sound_path: Path | str) -> ClipSound
+
+¶Adds a new clip soundtrack.
+ +pytvpaint/clip.py
938 +939 +940 |
|
+ Bases: pytvpaint.sound.BaseSound['Clip']
A clip sound.
+ +pytvpaint/sound.py
204 +205 +206 +207 +208 +209 +210 +211 +212 |
|
clip: Clip
+
+
+ property
+
+
+¶The sound's clip.
+make_current() -> None
+
+¶Makes the sound clip current.
+ +pytvpaint/sound.py
237 +238 +239 |
|
remove() -> None
+
+¶Remove the sound from the clip.
+ +pytvpaint/sound.py
241 +242 +243 +244 +245 |
|
reload() -> None
+
+¶Reload the sound from file.
+ +pytvpaint/sound.py
247 +248 +249 +250 |
|
+ Bases: pytvpaint.utils.Removable
A Layer is inside a clip and contains drawings.
+ +pytvpaint/layer.py
334 +335 +336 +337 +338 +339 +340 |
|
id: int
+
+
+ property
+
+
+¶The layers unique identifier.
+ +layer ids are not persistent across project load/close
+project: Project
+
+
+ property
+
+
+¶The project containing this layer.
+scene: Scene
+
+
+ property
+
+
+¶The scene containing this layer.
+clip: Clip
+
+
+ property
+
+
+¶The clip containing this layer.
+position: int
+
+
+ property
+ writable
+
+
+¶The position in the layer stack.
+ +layer positions start at 0
+opacity: int
+
+
+ property
+ writable
+
+
+¶Get the layer opacity value.
+ +In George, this is called density, we renamed it to opacity
as it seems more appropriate
color: LayerColor
+
+
+ property
+ writable
+
+
+¶Get the layer color.
+is_current: bool
+
+
+ property
+
+
+¶Returns True if the layer is the current one in the clip.
+is_selected: bool
+
+
+ property
+ writable
+
+
+¶Returns True if the layer is selected.
+is_visible: bool
+
+
+ property
+ writable
+
+
+¶Returns True if the layer is visible.
+is_locked: bool
+
+
+ property
+ writable
+
+
+¶Returns True if the layer is locked.
+is_collapsed: bool
+
+
+ property
+ writable
+
+
+¶Returns True if the layer is collapsed.
+blending_mode: george.BlendingMode
+
+
+ property
+ writable
+
+
+¶Get the layer blending mode value.
+stencil: george.StencilMode
+
+
+ property
+ writable
+
+
+¶Get the layer stencil mode value.
+thumbnails_visible: bool
+
+
+ property
+ writable
+
+
+¶Returns True if thumbnails are shown on that layer.
+auto_break_instance: bool
+
+
+ property
+ writable
+
+
+¶Get the auto break instance value.
+auto_create_instance: bool
+
+
+ property
+ writable
+
+
+¶Get the auto create instance value.
+pre_behavior: george.LayerBehavior
+
+
+ property
+ writable
+
+
+¶Get the pre-behavior value.
+post_behavior: george.LayerBehavior
+
+
+ property
+ writable
+
+
+¶Get the post-behavior value.
+is_position_locked: bool
+
+
+ property
+ writable
+
+
+¶Returns True if the layer position is locked.
+preserve_transparency: george.LayerTransparency
+
+
+ property
+ writable
+
+
+¶Get the preserve transparency value.
+is_anim_layer: bool
+
+
+ property
+
+
+¶Returns True if the layer is an animation layer.
+marks: Iterator[tuple[int, LayerColor]]
+
+
+ property
+
+
+¶Iterator over the layer marks including the frame and the color.
+ + + +Yields:
+Name | Type | +Description | +
---|---|---|
frame |
+ int
+ |
+
+
+
+ the mark frame + |
+
color |
+ pytvpaint.layer.LayerColor
+ |
+
+
+
+ the mark color + |
+
selected_frames: list[int]
+
+
+ property
+
+
+¶refresh() -> None
+
+¶Refreshes the layer data.
+ +pytvpaint/layer.py
342 +343 +344 +345 +346 +347 +348 +349 +350 +351 |
|
name(value: str) -> None
+
+¶Set the layer name.
+ +it uses get_unique_name
to find a unique layer name across all the layers in the clip
pytvpaint/layer.py
420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 |
|
layer_type() -> george.LayerType
+
+¶The layer type.
+ +pytvpaint/layer.py
433 +434 +435 +436 |
|
start() -> int
+
+¶The layer start frame according to the project's start frame.
+ +pytvpaint/layer.py
454 +455 +456 +457 |
|
end() -> int
+
+¶The layer end frame according to the project's start frame.
+ +pytvpaint/layer.py
459 +460 +461 +462 |
|
make_current() -> None
+
+¶Make the layer current, it also makes the clip current.
+ +pytvpaint/layer.py
480 +481 +482 +483 +484 +485 +486 |
|
convert_to_anim_layer() -> None
+
+¶Converts the layer to an animation layer.
+ +pytvpaint/layer.py
626 +627 +628 +629 |
|
load_dependencies() -> None
+
+¶Load all dependencies of the layer in memory.
+ +pytvpaint/layer.py
636 +637 +638 |
|
current_layer_id() -> int
+
+
+ staticmethod
+
+
+¶Returns the current layer id.
+ +pytvpaint/layer.py
640 +641 +642 +643 |
|
current_layer() -> Layer
+
+
+ classmethod
+
+
+¶Returns the current layer object.
+ +pytvpaint/layer.py
645 +646 +647 +648 +649 +650 |
|
shift(new_start: int) -> None
+
+¶Move the layer to a new frame.
+ +pytvpaint/layer.py
652 +653 +654 +655 |
|
merge(layer: Layer, blending_mode: george.BlendingMode, stamp: bool = False, erase: bool = False, keep_color_grp: bool = True, keep_img_mark: bool = True, keep_instance_name: bool = True) -> None
+
+¶Merge this layer with the given one.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
layer |
+
+ pytvpaint.layer.Layer
+ |
+
+
+
+ the layer to merge with + |
+ + required + | +
blending_mode |
+
+ pytvpaint.george.BlendingMode
+ |
+
+
+
+ the blending mode to use + |
+ + required + | +
stamp |
+
+ bool
+ |
+
+
+
+ Use stamp mode + |
+
+ False
+ |
+
erase |
+
+ bool
+ |
+
+
+
+ Remove the source layer + |
+
+ False
+ |
+
keep_color_grp |
+
+ bool
+ |
+
+
+
+ Keep the color group + |
+
+ True
+ |
+
keep_img_mark |
+
+ bool
+ |
+
+
+
+ Keep the image mark + |
+
+ True
+ |
+
keep_instance_name |
+
+ bool
+ |
+
+
+
+ Keep the instance name + |
+
+ True
+ |
+
pytvpaint/layer.py
657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 |
|
merge_all(keep_color_grp: bool = True, keep_img_mark: bool = True, keep_instance_name: bool = True) -> None
+
+
+ staticmethod
+
+
+¶Merge all the layers in the stack.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
keep_color_grp |
+
+ bool
+ |
+
+
+
+ Keep the color group + |
+
+ True
+ |
+
keep_img_mark |
+
+ bool
+ |
+
+
+
+ Keep the image mark + |
+
+ True
+ |
+
keep_instance_name |
+
+ bool
+ |
+
+
+
+ Keep the instance name + |
+
+ True
+ |
+
pytvpaint/layer.py
689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 |
|
new(name: str, clip: Clip | None = None, color: LayerColor | None = None) -> Layer
+
+
+ staticmethod
+
+
+¶Create a new layer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
name |
+
+ str
+ |
+
+
+
+ the name of the new layer + |
+ + required + | +
clip |
+
+ pytvpaint.clip.Clip | None
+ |
+
+
+
+ the parent clip + |
+
+ None
+ |
+
color |
+
+ pytvpaint.layer.LayerColor | None
+ |
+
+
+
+ the layer color + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
Layer |
+ pytvpaint.layer.Layer
+ |
+
+
+
+ the new layer + |
+
The layer name is checked against all other layers to have a unique name using get_unique_name
.
+This can take a while if you have a lot of layers.
pytvpaint/layer.py
704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 |
|
new_anim_layer(name: str, clip: Clip | None = None, color: LayerColor | None = None) -> Layer
+
+
+ classmethod
+
+
+¶Create a new animation layer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
name |
+
+ str
+ |
+
+
+
+ the name of the new layer + |
+ + required + | +
clip |
+
+ pytvpaint.clip.Clip | None
+ |
+
+
+
+ the parent clip + |
+
+ None
+ |
+
color |
+
+ pytvpaint.layer.LayerColor | None
+ |
+
+
+
+ the layer color + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
Layer |
+ pytvpaint.layer.Layer
+ |
+
+
+
+ the new animation layer + |
+
It activates the thumbnail visibility
+pytvpaint/layer.py
740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 |
|
new_background_layer(name: str, clip: Clip | None = None, color: LayerColor | None = None, image: Path | str | None = None, stretch: bool = False) -> Layer
+
+
+ classmethod
+
+
+¶Create a new background layer with hold as pre- and post-behavior.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
name |
+
+ str
+ |
+
+
+
+ the name of the new layer + |
+ + required + | +
clip |
+
+ pytvpaint.clip.Clip | None
+ |
+
+
+
+ the parent clip + |
+
+ None
+ |
+
color |
+
+ pytvpaint.layer.LayerColor | None
+ |
+
+
+
+ the layer color + |
+
+ None
+ |
+
image |
+
+ pathlib.Path | str | None
+ |
+
+
+
+ the background image to load + |
+
+ None
+ |
+
stretch |
+
+ bool
+ |
+
+
+
+ whether to stretch the image to fit the view + |
+
+ False
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
Layer |
+ pytvpaint.layer.Layer
+ |
+
+
+
+ the new animation layer + |
+
pytvpaint/layer.py
766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 |
|
duplicate(name: str) -> Layer
+
+¶Duplicate this layer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
name |
+
+ str
+ |
+
+
+
+ the duplicated layer name + |
+ + required + | +
Returns:
+Name | Type | +Description | +
---|---|---|
Layer |
+ pytvpaint.layer.Layer
+ |
+
+
+
+ the duplicated layer + |
+
pytvpaint/layer.py
803 +804 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +815 +816 +817 |
|
remove() -> None
+
+¶Remove the layer from the clip.
+ +The current instance won't be usable after this call since it will be mark removed.
+pytvpaint/layer.py
819 +820 +821 +822 +823 +824 +825 +826 +827 +828 |
|
render(output_path: Path | str | FileSequence, start: int | None = None, end: int | None = None, use_camera: bool = False, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = None, format_opts: list[str] | None = None) -> None
+
+¶Render the layer to a single frame or frame sequence or movie.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
output_path |
+
+ pathlib.Path | str | fileseq.filesequence.FileSequence
+ |
+
+
+
+ a single file or file sequence pattern + |
+ + required + | +
start |
+
+ int | None
+ |
+
+
+
+ the start frame to render the layer's start if None. Defaults to None. + |
+
+ None
+ |
+
end |
+
+ int | None
+ |
+
+
+
+ the end frame to render or the layer's end if None. Defaults to None. + |
+
+ None
+ |
+
use_camera |
+
+ bool
+ |
+
+
+
+ use the camera for rendering, otherwise render the whole canvas. Defaults to False. + |
+
+ False
+ |
+
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode
+ |
+
+
+
+ the alpha mode for rendering. Defaults to george.AlphaSaveMode.PREMULTIPLY. + |
+
+ pytvpaint.george.AlphaSaveMode.PREMULTIPLY
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the background mode for rendering. Defaults to None. + |
+
+ None
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ custom format options. Defaults to None. + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if requested range (start-end) not in clip range/bounds + |
+
+ ValueError
+ |
+
+
+
+ if output is a movie + |
+
+ FileNotFoundError
+ |
+
+
+
+ if the render failed and no files were found on disk or missing frames + |
+
This functions uses the layer's range as a basis (start-end). This is different from a project range, which
+uses the project timeline. For more details on the differences in frame ranges and the timeline in TVPaint,
+please check the Usage/Rendering
section of the documentation.
Even tough pytvpaint does a pretty good job of correcting the frame ranges for rendering, we're still +encountering some weird edge cases where TVPaint will consider the range invalid for seemingly no reason.
+pytvpaint/layer.py
830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 |
|
render_frame(export_path: Path | str, frame: int | None = None, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = george.BackgroundMode.NONE, format_opts: list[str] | None = None) -> Path
+
+¶Render a frame from the layer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str
+ |
+
+
+
+ the frame export path (the extension determines the output format) + |
+ + required + | +
frame |
+
+ int | None
+ |
+
+
+
+ the frame to render or the current frame if None. Defaults to None. + |
+
+ None
+ |
+
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode
+ |
+
+
+
+ the render alpha mode + |
+
+ pytvpaint.george.AlphaSaveMode.PREMULTIPLY
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the render background mode + |
+
+ pytvpaint.george.BackgroundMode.NONE
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ custom output format options to pass when rendering + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ FileNotFoundError
+ |
+
+
+
+ if the render failed or output not found on disk + |
+
Returns:
+Name | Type | +Description | +
---|---|---|
Path |
+ pathlib.Path
+ |
+
+
+
+ render output path + |
+
pytvpaint/layer.py
879 +880 +881 +882 +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 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 |
|
render_instances(export_path: Path | str | FileSequence, start: int | None = None, end: int | None = None, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = None, format_opts: list[str] | None = None) -> FileSequence
+
+¶Render all layer instances in the provided range for the current layer.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
export_path |
+
+ pathlib.Path | str | fileseq.filesequence.FileSequence
+ |
+
+
+
+ the export path (the extension determines the output format) + |
+ + required + | +
start |
+
+ int | None
+ |
+
+
+
+ the start frame to render the layer's start if None. Defaults to None. + |
+
+ None
+ |
+
end |
+
+ int | None
+ |
+
+
+
+ the end frame to render or the layer's end if None. Defaults to None. + |
+
+ None
+ |
+
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode
+ |
+
+
+
+ the render alpha mode + |
+
+ pytvpaint.george.AlphaSaveMode.PREMULTIPLY
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the render background mode + |
+
+ None
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ custom output format options to pass when rendering + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if requested range (start-end) not in layer range/bounds + |
+
+ ValueError
+ |
+
+
+
+ if output is a movie + |
+
+ FileNotFoundError
+ |
+
+
+
+ if the render failed or output not found on disk + |
+
Returns:
+Name | Type | +Description | +
---|---|---|
FileSequence |
+ fileseq.filesequence.FileSequence
+ |
+
+
+
+ instances output sequence + |
+
pytvpaint/layer.py
926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 +940 +941 +942 +943 +944 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 |
|
load_image(image_path: str | Path, frame: int | None = None, stretch: bool = False) -> None
+
+¶Load an image in the current layer at a given frame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
image_path |
+
+ str | pathlib.Path
+ |
+
+
+
+ path to the image to load + |
+ + required + | +
frame |
+
+ int | None
+ |
+
+
+
+ the frame where the image will be loaded, if none provided, image will be loaded at current frame + |
+
+ None
+ |
+
stretch |
+
+ bool
+ |
+
+
+
+ whether to stretch the image to fit the view + |
+
+ False
+ |
+
Raises:
+Type | +Description | +
---|---|
+ FileNotFoundError
+ |
+
+
+
+ if the file doesn't exist at provided path + |
+
pytvpaint/layer.py
980 + 981 + 982 + 983 + 984 + 985 + 986 + 987 + 988 + 989 + 990 + 991 + 992 + 993 + 994 + 995 + 996 + 997 + 998 + 999 +1000 +1001 +1002 +1003 +1004 |
|
get_mark_color(frame: int) -> LayerColor | None
+
+¶Get the mark color at a specific frame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
frame |
+
+ int
+ |
+
+
+
+ frame with a mark + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ pytvpaint.layer.LayerColor | None
+ |
+
+
+
+ LayerColor | None: the layer color if there was a mark + |
+
pytvpaint/layer.py
1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 |
|
add_mark(frame: int, color: LayerColor) -> None
+
+¶Add a mark to a frame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
frame |
+
+ int
+ |
+
+
+
+ frame to put a mark on + |
+ + required + | +
color |
+
+ pytvpaint.layer.LayerColor
+ |
+
+
+
+ the color index + |
+ + required + | +
Raises:
+Type | +Description | +
---|---|
+ TypeError
+ |
+
+
+
+ if the layer is not an animation layer + |
+
pytvpaint/layer.py
1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 |
|
remove_mark(frame: int) -> None
+
+¶Remove a mark.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
frame |
+
+ int
+ |
+
+
+
+ a frame number with a mark + |
+ + required + | +
pytvpaint/layer.py
1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 |
|
clear_marks() -> None
+
+¶Clear all the marks in the layer.
+ +pytvpaint/layer.py
1062 +1063 +1064 +1065 |
|
select_frames(start: int, end: int) -> None
+
+¶Select the frames from a start and count.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
start |
+
+ int
+ |
+
+
+
+ the selection start frame + |
+ + required + | +
end |
+
+ int
+ |
+
+
+
+ the selected end frame + |
+ + required + | +
pytvpaint/layer.py
1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 |
|
select_all_frames() -> None
+
+¶Select all frames in the layer.
+ +pytvpaint/layer.py
1082 +1083 +1084 +1085 +1086 |
|
clear_selection() -> None
+
+¶Clear frame selection in the layer.
+ +pytvpaint/layer.py
1088 +1089 +1090 +1091 +1092 |
|
cut_selection() -> None
+
+¶Cut the selected instances.
+ +pytvpaint/layer.py
1104 +1105 +1106 +1107 |
|
copy_selection() -> None
+
+¶Copy the selected instances.
+ +pytvpaint/layer.py
1109 +1110 +1111 +1112 |
|
paste_selection() -> None
+
+¶Paste the previously copied instances.
+ +pytvpaint/layer.py
1114 +1115 +1116 +1117 |
|
instances() -> Iterator[LayerInstance]
+
+¶Iterates over the layer instances.
+ + + +Yields:
+Type | +Description | +
---|---|
+ pytvpaint.layer.LayerInstance
+ |
+
+
+
+ each LayerInstance present in the layer + |
+
pytvpaint/layer.py
1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 |
|
get_instance(frame: int, strict: bool = False) -> LayerInstance | None
+
+¶Get the instance at that frame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
frame |
+
+ int
+ |
+
+
+
+ the instance frame + |
+ + required + | +
strict |
+
+ bool
+ |
+
+
+
+ True will only return Instance if the given frame is the start of the instance. Default is False + |
+
+ False
+ |
+
Returns:
+Type | +Description | +
---|---|
+ pytvpaint.layer.LayerInstance | None
+ |
+
+
+
+ the instance if found else None + |
+
pytvpaint/layer.py
1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 |
|
get_instances(from_frame: int, to_frame: int) -> Iterator[LayerInstance]
+
+¶Iterates over the layer instances and returns the one in the range (from_frame-to_frame).
+ + + +Yields:
+Type | +Description | +
---|---|
+ pytvpaint.layer.LayerInstance
+ |
+
+
+
+ each LayerInstance in the range (from_frame-to_frame) + |
+
pytvpaint/layer.py
1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 |
|
add_instance(start: int | None = None, nb_frames: int = 1, direction: george.InsertDirection | None = None, split: bool = False) -> LayerInstance
+
+¶Crates a new instance.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
start |
+
+ int | None
+ |
+
+
+
+ start frame. Defaults to clip current frame if none provided + |
+
+ None
+ |
+
nb_frames |
+
+ int
+ |
+
+
+
+ number of frames in the new instance. Default is 1, this is the total number of frames created. + |
+
+ 1
+ |
+
direction |
+
+ pytvpaint.george.InsertDirection | None
+ |
+
+
+
+ direction where new frames will be added/inserted + |
+
+ None
+ |
+
split |
+
+ bool
+ |
+
+
+
+ True to make each added frame a new image + |
+
+ False
+ |
+
Raises:
+Type | +Description | +
---|---|
+ TypeError
+ |
+
+
+
+ if the layer is not an animation layer + |
+
+ ValueError
+ |
+
+
+
+ if the number of frames |
+
+ ValueError
+ |
+
+
+
+ if an instance already exists at the given range (start + nb_frames) + |
+
Returns:
+Name | Type | +Description | +
---|---|---|
LayerInstance |
+ pytvpaint.layer.LayerInstance
+ |
+
+
+
+ new layer instance + |
+
pytvpaint/layer.py
1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 |
|
rename_instances(mode: george.InstanceNamingMode, prefix: str | None = None, suffix: str | None = None, process: george.InstanceNamingProcess | None = None) -> None
+
+¶Rename all the instances.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
mode |
+
+ pytvpaint.george.InstanceNamingMode
+ |
+
+
+
+ the instance renaming mode + |
+ + required + | +
prefix |
+
+ str | None
+ |
+
+
+
+ the prefix to add to each name + |
+
+ None
+ |
+
suffix |
+
+ str | None
+ |
+
+
+
+ the suffix to add to each name + |
+
+ None
+ |
+
process |
+
+ pytvpaint.george.InstanceNamingProcess | None
+ |
+
+
+
+ the instance naming process + |
+
+ None
+ |
+
pytvpaint/layer.py
1233 +1234 +1235 +1236 +1237 +1238 +1239 +1240 +1241 +1242 +1243 +1244 +1245 +1246 +1247 +1248 |
|
+ Bases: pytvpaint.utils.Refreshable
The color of a layer identified by an index. Layer colors are specific to a clip.
+ +Construct a LayerColor from an index and a clip (if None it gets the current clip).
+ +pytvpaint/layer.py
226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 |
|
index: int
+
+
+ property
+
+
+¶The layer color index.
+clip: Clip
+
+
+ property
+
+
+¶The layer color clip.
+is_visible: bool
+
+
+ property
+
+
+¶Get the visibility of the color index.
+refresh() -> None
+
+¶Refreshes the layer color data.
+ +pytvpaint/layer.py
239 +240 +241 +242 +243 |
|
name(value: str) -> None
+
+¶Set the name of the color.
+ +pytvpaint/layer.py
270 +271 +272 +273 +274 +275 |
|
color(value: george.RGBColor) -> None
+
+¶Set the color value.
+ +pytvpaint/layer.py
286 +287 +288 +289 |
|
lock_layers(lock: bool) -> None
+
+¶Lock or unlock all layers with this color.
+ +pytvpaint/layer.py
297 +298 +299 +300 +301 +302 +303 |
|
show_layers(show: bool, mode: george.LayerColorDisplayOpt = george.LayerColorDisplayOpt.DISPLAY) -> None
+
+¶Show or hide layers with this color.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
show |
+
+ bool
+ |
+
+
+
+ whether to show the layers using this color or not + |
+ + required + | +
mode |
+
+ pytvpaint.george.LayerColorDisplayOpt
+ |
+
+
+
+ the display mode. Defaults to george.LayerColorDisplayOpt.DISPLAY. + |
+
+ pytvpaint.george.LayerColorDisplayOpt.DISPLAY
+ |
+
pytvpaint/layer.py
305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 |
|
select_layers(select: bool) -> None
+
+¶Select or unselect layers with this color.
+ +pytvpaint/layer.py
322 +323 +324 +325 +326 +327 +328 |
|
A layer instance is a frame where there is a drawing. It only has a start frame.
+ +LayerInstance
is special because we can't track their position, meaning that if the user move an instance the Python object values won't match.
name: str
+
+
+ property
+ writable
+
+
+¶Get or set the instance name.
+length: int
+
+
+ property
+ writable
+
+
+¶Get or set the instance's number of frames or length.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ If the length provided is inferior to 1 + |
+
end: int
+
+
+ property
+ writable
+
+
+¶Get or set the instance's end frame.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ If the end frame provided is inferior to the instance's start frame + |
+
next: LayerInstance | None
+
+
+ property
+
+
+¶Returns the next instance.
+ + + +Returns:
+Type | +Description | +
---|---|
+ pytvpaint.layer.LayerInstance | None
+ |
+
+
+
+ the next instance or None if at the end of the layer + |
+
previous: LayerInstance | None
+
+
+ property
+
+
+¶Get the previous instance.
+ + + +Returns:
+Type | +Description | +
---|---|
+ pytvpaint.layer.LayerInstance | None
+ |
+
+
+
+ the previous instance, None if there isn't + |
+
split(at_frame: int) -> LayerInstance
+
+¶Split the instance into two instances at the given frame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
at_frame |
+
+ int
+ |
+
+
+
+ the frame where the split will occur + |
+ + required + | +
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ If |
+
Returns:
+Name | Type | +Description | +
---|---|---|
LayerInstance |
+ pytvpaint.layer.LayerInstance
+ |
+
+
+
+ the new layer instance + |
+
pytvpaint/layer.py
110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 |
|
duplicate(direction: george.InsertDirection = george.InsertDirection.AFTER) -> None
+
+¶Duplicate the instance and insert it in the given direction.
+ +pytvpaint/layer.py
133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 |
|
cut() -> None
+
+¶Cut all the frames/images/exposures of the instance and store them in the image buffer.
+ +pytvpaint/layer.py
153 +154 +155 +156 +157 |
|
copy() -> None
+
+¶Copy all the frames/images/exposures of the instance and store them in the image buffer.
+ +pytvpaint/layer.py
159 +160 +161 +162 +163 |
|
paste(at_frame: int | None) -> None
+
+¶Paste all the frames/images/exposures stored in the image buffer to the current instance at the given frame.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
at_frame |
+
+ int | None
+ |
+
+
+
+ the frame where the stored frames will be pasted. Default is the current frame + |
+ + required + | +
pytvpaint/layer.py
165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 |
|
select() -> None
+
+¶Select all frames in this instance.
+ +pytvpaint/layer.py
177 +178 +179 |
|
Project class.
+ + + +Project(project_id: str)
+
+¶
+ Bases: pytvpaint.utils.Refreshable
, pytvpaint.utils.Renderable
A TVPaint project is the highest object that contains everything in the data hierarchy.
+It looks like this: Project -> Scene -> Clip -> Layer -> LayerInstance
+ +pytvpaint/project.py
32 +33 +34 +35 +36 |
|
id: str
+
+
+ property
+
+
+¶The project id.
+ +the id is persistent on project load/close.
+position: int
+
+
+ property
+
+
+¶The project's position in the project tabs.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if project cannot be found in open projects + |
+
the indices go from right to left in the UI
+is_closed: bool
+
+
+ property
+
+
+¶Returns True
if the project is closed.
exists: bool
+
+
+ property
+
+
+¶Checks if the project exists on disk.
+is_current: bool
+
+
+ property
+
+
+¶Returns True
if the project is the current selected one in the UI.
name: str
+
+
+ property
+
+
+¶The name of the project which is the filename without the extension.
+width: int
+
+
+ property
+
+
+¶The width of the canvas.
+height: int
+
+
+ property
+
+
+¶The height of the canvas.
+fps: float
+
+
+ property
+
+
+¶The project's framerate.
+playback_fps: float
+
+
+ property
+
+
+¶The project's playback framerate.
+field_order: george.FieldOrder
+
+
+ property
+
+
+¶The field order.
+start_frame: int
+
+
+ property
+ writable
+
+
+¶The project's start frame.
+end_frame: int
+
+
+ property
+
+
+¶The project's end frame, meaning the last frame of the last clip in the project's timeline.
+current_frame: int
+
+
+ property
+ writable
+
+
+¶Get the current frame relative to the timeline.
+background_mode: george.BackgroundMode
+
+
+ property
+ writable
+
+
+¶Get/Set the background mode.
+background_colors: tuple[george.RGBColor, george.RGBColor] | george.RGBColor | None
+
+
+ property
+ writable
+
+
+¶header_info: str
+
+
+ property
+ writable
+
+
+¶The project's header info.
+author: str
+
+
+ property
+ writable
+
+
+¶The project's author info.
+notes: str
+
+
+ property
+ writable
+
+
+¶The project's notes text.
+current_scene: Scene
+
+
+ property
+
+
+¶Get the current scene of the project.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if scene cannot be found in project + |
+
scenes: Iterator[Scene]
+
+
+ property
+
+
+¶Yields the project's scenes.
+current_clip: Clip
+
+
+ property
+
+
+¶Returns the project's current clip.
+clips: Iterator[Clip]
+
+
+ property
+
+
+¶Iterates over all the clips in the project's scenes.
+clip_names: Iterator[str]
+
+
+ property
+
+
+¶Optimized way to get the clip names. Useful for get_unique_name
.
sounds: Iterator[ProjectSound]
+
+
+ property
+
+
+¶Iterator over the project sounds.
+mark_in: int | None
+
+
+ property
+ writable
+
+
+¶Get the project mark in or None if no mark in set.
+mark_out: int | None
+
+
+ property
+ writable
+
+
+¶Get the project mark out or None if no mark out set.
+refresh() -> None
+
+¶Refreshed the project data.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if project has been closed + |
+
pytvpaint/project.py
48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 |
|
make_current() -> None
+
+¶Make the project the current one.
+ +pytvpaint/project.py
107 +108 +109 +110 +111 |
|
path() -> Path
+
+¶The project path on disk.
+ +pytvpaint/project.py
113 +114 +115 +116 |
|
resize(width: int, height: int, overwrite: bool = False, resize_opt: george.ResizeOption | None = None) -> Project
+
+¶Resize the current project and returns a new one.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
width |
+
+ int
+ |
+
+
+
+ the new width + |
+ + required + | +
height |
+
+ int
+ |
+
+
+
+ the new height + |
+ + required + | +
overwrite |
+
+ bool
+ |
+
+
+
+ overwrite the original project, default is to create a new project + |
+
+ False
+ |
+
resize_opt |
+
+ pytvpaint.george.ResizeOption | None
+ |
+
+
+
+ how to resize the project + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ pytvpaint.project.Project
+ |
+
+
+
+ the newly resized project + |
+
pytvpaint/project.py
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 |
|
set_fps(fps: float, time_stretch: bool = False, preview: bool = False) -> None
+
+¶Set the project's framerate.
+ +pytvpaint/project.py
188 +189 +190 +191 +192 +193 +194 +195 +196 |
|
pixel_aspect_ratio() -> float
+
+¶The project's pixel aspect ratio.
+ +pytvpaint/project.py
203 +204 +205 +206 +207 |
|
clear_background() -> None
+
+¶Clear the background color and set it to None.
+ +pytvpaint/project.py
278 +279 +280 +281 +282 +283 +284 +285 |
|
get_project(by_id: str | None = None, by_name: str | None = None) -> Project | None
+
+
+ classmethod
+
+
+¶Find a project by id or by name.
+ +pytvpaint/project.py
314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 |
|
current_scene_ids() -> Iterator[int]
+
+
+ staticmethod
+
+
+¶Yields the current project's scene ids.
+ +pytvpaint/project.py
327 +328 +329 +330 |
|
get_scene(by_id: int | None = None, by_name: str | None = None) -> Scene | None
+
+¶Find a scene in the project by id or name.
+ +pytvpaint/project.py
353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 |
|
add_scene() -> Scene
+
+¶Add a new scene in the project.
+ +pytvpaint/project.py
365 +366 +367 +368 +369 +370 |
|
get_clip(by_id: int | None = None, by_name: str | None = None, scene_id: int | None = None) -> Clip | None
+
+¶Find a clip by id, name or scene_id.
+ +pytvpaint/project.py
397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 |
|
add_clip(clip_name: str, scene: Scene | None = None) -> Clip
+
+¶Add a new clip in the given scene or the current one if no scene provided.
+ +pytvpaint/project.py
415 +416 +417 +418 |
|
add_sound(sound_path: Path | str) -> ProjectSound
+
+¶Add a new sound clip to the project.
+ +pytvpaint/project.py
430 +431 +432 |
|
render(output_path: Path | str | FileSequence, start: int | None = None, end: int | None = None, use_camera: bool = False, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = None, format_opts: list[str] | None = None) -> None
+
+¶Render the project to a single frame or frame sequence or movie.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
output_path |
+
+ pathlib.Path | str | fileseq.filesequence.FileSequence
+ |
+
+
+
+ a single file or file sequence pattern + |
+ + required + | +
start |
+
+ int | None
+ |
+
+
+
+ the start frame to render or the mark in or the project's start frame if None. Defaults to None. + |
+
+ None
+ |
+
end |
+
+ int | None
+ |
+
+
+
+ the end frame to render or the mark out or the project's end frame if None. Defaults to None. + |
+
+ None
+ |
+
use_camera |
+
+ bool
+ |
+
+
+
+ use the camera for rendering, otherwise render the whole canvas. Defaults to False. + |
+
+ False
+ |
+
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode
+ |
+
+
+
+ the alpha mode for rendering. Defaults to george.AlphaSaveMode.PREMULTIPLY. + |
+
+ pytvpaint.george.AlphaSaveMode.PREMULTIPLY
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the background mode for rendering. Defaults to george.BackgroundMode.NONE. + |
+
+ None
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ custom format options. Defaults to None. + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if requested range (start-end) not in project range/bounds + |
+
+ ValueError
+ |
+
+
+
+ if output is a movie, and it's duration is equal to 1 frame + |
+
+ FileNotFoundError
+ |
+
+
+
+ if the render failed and no files were found on disk or missing frames + |
+
This functions uses the project's timeline as a basis for the range (start-end). This timeline includes all
+the project's clips and is different from a clip range. For more details on the differences in frame ranges
+and the timeline in TVPaint, please check the Usage/Rendering
section of the documentation.
Even tough pytvpaint does a pretty good job of correcting the frame ranges for rendering, we're still +encountering some weird edge cases where TVPaint will consider the range invalid for seemingly no reason.
+pytvpaint/project.py
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 |
|
render_clips(clips: list[Clip], output_path: Path | str | FileSequence, use_camera: bool = False, alpha_mode: george.AlphaSaveMode = george.AlphaSaveMode.PREMULTIPLY, background_mode: george.BackgroundMode | None = None, format_opts: list[str] | None = None) -> None
+
+¶Render sequential clips as a single output.
+ +pytvpaint/project.py
508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 |
|
current_project_id() -> str
+
+
+ staticmethod
+
+
+¶Returns the current project id.
+ +pytvpaint/project.py
532 +533 +534 +535 |
|
current_project() -> Project
+
+
+ staticmethod
+
+
+¶Returns the current project.
+ +pytvpaint/project.py
537 +538 +539 +540 |
|
open_projects_ids() -> Iterator[str]
+
+
+ staticmethod
+
+
+¶Yields the ids of the currently open projects.
+ +pytvpaint/project.py
542 +543 +544 +545 |
|
open_projects() -> Iterator[Project]
+
+
+ classmethod
+
+
+¶Iterator over the currently open projects.
+ +pytvpaint/project.py
547 +548 +549 +550 +551 |
|
new(project_path: Path | str, width: int = 1920, height: int = 1080, pixel_aspect_ratio: float = 1.0, frame_rate: float = 24.0, field_order: george.FieldOrder = george.FieldOrder.NONE, start_frame: int = 1) -> Project
+
+
+ classmethod
+
+
+¶Create a new project.
+ +pytvpaint/project.py
607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 |
|
new_from_camera(export_path: Path | str | None = None) -> Project
+
+¶Create a new cropped project from the camera view.
+ +pytvpaint/project.py
630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 |
|
duplicate() -> Project
+
+¶Duplicate the project and return the new one.
+ +pytvpaint/project.py
643 +644 +645 +646 +647 +648 +649 |
|
close() -> None
+
+¶Closes the project.
+ +pytvpaint/project.py
651 +652 +653 +654 |
|
close_all(close_tvp: bool = False) -> None
+
+
+ classmethod
+
+
+¶Closes all open projects.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
close_tvp |
+
+ bool
+ |
+
+
+
+ close the TVPaint instance as well + |
+
+ False
+ |
+
pytvpaint/project.py
656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 |
|
load(project_path: Path | str, silent: bool = True) -> Project
+
+
+ classmethod
+
+
+¶Load an existing .tvpp/.tvp project or .tvpx file.
+ +pytvpaint/project.py
669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 |
|
save(save_path: Path | str | None = None) -> None
+
+¶Saves the project on disk.
+ +pytvpaint/project.py
682 +683 +684 +685 |
|
load_panel(panel_path: Path | str) -> None
+
+¶Load an external TVPaint panel.
+ +pytvpaint/project.py
687 +688 +689 +690 |
|
load_palette(palette_path: Path | str) -> None
+
+¶Load a palette.
+ +pytvpaint/project.py
692 +693 +694 +695 |
|
save_palette(save_path: Path | str | None = None) -> None
+
+¶Save a palette to the given path.
+ +pytvpaint/project.py
697 +698 +699 +700 +701 |
|
save_video_dependencies(on_save: bool = True, now: bool = True) -> None
+
+¶Saves the video dependencies.
+ +pytvpaint/project.py
703 +704 +705 +706 |
|
save_audio_dependencies(on_save: bool = True) -> None
+
+¶Saves audio dependencies.
+ +pytvpaint/project.py
708 +709 +710 +711 |
|
+ Bases: pytvpaint.sound.BaseSound['Project']
A Project sound.
+ +pytvpaint/sound.py
256 +257 +258 +259 +260 +261 +262 +263 +264 |
|
project: Project
+
+
+ property
+
+
+¶The sound's project.
+remove() -> None
+
+¶Remove the sound from the project.
+ +pytvpaint/sound.py
289 +290 +291 +292 +293 |
|
reload() -> None
+
+¶Reload the sound from file.
+ +pytvpaint/sound.py
295 +296 +297 |
|
make_current() -> None
+
+¶Makes the sound project current.
+ +pytvpaint/sound.py
299 +300 +301 |
|
Scene class.
+ + + +Scene(scene_id: int, project: Project)
+
+¶
+ Bases: pytvpaint.utils.Removable
A Scene is a collection of clips. A Scene is inside a project.
+ +pytvpaint/scene.py
19 +20 +21 +22 |
|
is_current: bool
+
+
+ property
+
+
+¶Returns True
if the scene is the current one.
id: int
+
+
+ property
+
+
+¶The scene id.
+project: Project
+
+
+ property
+
+
+¶The scene's project.
+position: int
+
+
+ property
+ writable
+
+
+¶The scene's position in the project.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if scene cannot be found in the project + |
+
clip_ids: Iterator[int]
+
+
+ property
+
+
+¶Returns an iterator over the clip ids.
+clips: Iterator[Clip]
+
+
+ property
+
+
+¶Yields the scene clips.
+current_scene_id() -> int
+
+
+ staticmethod
+
+
+¶Returns the current scene id (the current clip's scene).
+ +pytvpaint/scene.py
34 +35 +36 +37 |
|
current_scene() -> Scene
+
+
+ staticmethod
+
+
+¶Returns the current scene of the current project.
+ +pytvpaint/scene.py
39 +40 +41 +42 +43 +44 +45 |
|
new(project: Project | None = None) -> Scene
+
+
+ classmethod
+
+
+¶Creates a new scene in the provided project.
+ +pytvpaint/scene.py
47 +48 +49 +50 +51 +52 +53 |
|
make_current() -> None
+
+¶Make this scene the current one.
+ +pytvpaint/scene.py
55 +56 +57 +58 +59 +60 +61 +62 |
|
get_clip(by_id: int | None = None, by_name: str | None = None) -> Clip | None
+
+¶Find a clip by id or by name.
+ +pytvpaint/scene.py
110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 |
|
add_clip(clip_name: str) -> Clip
+
+¶Adds a new clip to the scene.
+ +pytvpaint/scene.py
122 +123 +124 +125 +126 |
|
duplicate() -> Scene
+
+¶Duplicate the scene and return it.
+ +pytvpaint/scene.py
128 +129 +130 +131 +132 +133 +134 |
|
remove() -> None
+
+¶Remove the scene and all the clips inside.
+ +All Clip
instances will be invalid after removing the scene.
+There's no protection mechanism to prevent accessing clip data that doesn't exist anymore.
pytvpaint/scene.py
136 +137 +138 +139 +140 +141 +142 +143 +144 |
|
Utility functions and classes which are not specific to anything else in the codebase.
+ + + +RefreshedProperty
+
+
+¶
+ Bases: property
Custom property that calls .refresh() before getting the actual value.
+ + + + +Refreshable()
+
+¶Abstract class that denotes an object that have data that can be refreshed (a TVPaint project for example).
+ +pytvpaint/utils.py
51 +52 |
|
refresh() -> None
+
+
+ abstractmethod
+
+
+¶Refreshes the object data.
+ +pytvpaint/utils.py
54 +55 +56 +57 |
|
Removable()
+
+¶
+ Bases: pytvpaint.utils.Refreshable
Abstract class that denotes an object that can be removed from TVPaint (a Layer for example).
+ +pytvpaint/utils.py
63 +64 +65 |
|
is_removed: bool
+
+
+ property
+
+
+¶Checks if the object is removed by trying to refresh its data.
+ + + +Returns:
+Name | Type | +Description | +
---|---|---|
bool |
+ bool
+ |
+
+
+
+ whether if it was removed or not + |
+
refresh() -> None
+
+¶Does a refresh of the object data.
+ + + +Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if the object has been mark removed + |
+
pytvpaint/utils.py
74 +75 +76 +77 +78 +79 +80 +81 |
|
remove() -> None
+
+
+ abstractmethod
+
+
+¶Removes the object in TVPaint.
+ +pytvpaint/utils.py
96 +97 +98 +99 |
|
mark_removed() -> None
+
+¶Marks the object as removed and is therefor not usable.
+ +pytvpaint/utils.py
101 +102 +103 |
|
Renderable()
+
+¶Abstract class that denotes an object that can be removed from TVPaint (a Layer for example).
+ +pytvpaint/utils.py
109 +110 |
|
current_frame: int
+
+
+ abstractmethod
+ property
+ writable
+
+
+¶Gives the current frame.
+CanMakeCurrent
+
+
+¶
+ Bases: typing_extensions.Protocol
Describes an object that can do make_current
and has an id.
HasCurrentFrame
+
+
+¶
+ Bases: typing_extensions.Protocol
Class that has a current frame property.
+ + + + +current_frame: int
+
+
+ property
+ writable
+
+
+¶The current frame, clip or project.
+get_unique_name(names: Iterable[str], stub: str) -> str
+
+¶Get a unique name from a list of names and a stub prefix. It does auto increment it.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
names |
+
+ collections.abc.Iterable[str]
+ |
+
+
+
+ existing names + |
+ + required + | +
stub |
+
+ str
+ |
+
+
+
+ the base name + |
+ + required + | +
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if the stub is empty + |
+
Returns:
+Name | Type | +Description | +
---|---|---|
str |
+ str
+ |
+
+
+
+ a unique name with the stub prefix + |
+
pytvpaint/utils.py
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 +245 +246 |
|
position_generator(fn: Callable[[int], T], stop_when: type[GeorgeError] = GeorgeError) -> Iterator[T]
+
+¶Utility generator that yields the result of a function according to a position.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
fn |
+
+ typing.Callable[[int], pytvpaint.utils.T]
+ |
+
+
+
+ the function to run at each iteration + |
+ + required + | +
stop_when |
+
+ Type[pytvpaint.george.exceptions.GeorgeError]
+ |
+
+
+
+ exception at which we stop. Defaults to GeorgeError. + |
+
+ pytvpaint.george.exceptions.GeorgeError
+ |
+
Yields:
+Type | +Description | +
---|---|
+ pytvpaint.utils.T
+ |
+
+
+
+ Iterator[T]: an generator of the resulting values + |
+
pytvpaint/utils.py
252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 |
|
set_as_current(func: Callable[Params, ReturnType]) -> Callable[Params, ReturnType]
+
+¶Decorator to apply on object methods.
+Sets the current TVPaint object as 'current'. +Useful when George functions only apply on the current project, clip, layer or scene.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
func |
+
+ typing.Callable[pytvpaint.utils.Params, pytvpaint.utils.ReturnType]
+ |
+
+
+
+ the method apply on + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ typing.Callable[pytvpaint.utils.Params, pytvpaint.utils.ReturnType]
+ |
+
+
+
+ Callable[Params, ReturnType]: the wrapped method + |
+
pytvpaint/utils.py
291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 |
|
render_context(alpha_mode: george.AlphaSaveMode | None = None, background_mode: george.BackgroundMode | None = None, save_format: george.SaveFormat | None = None, format_opts: list[str] | None = None, layer_selection: list[Layer] | None = None) -> Generator[None, None, None]
+
+¶Context used to do renders in TVPaint.
+It does the following things:
+Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
alpha_mode |
+
+ pytvpaint.george.AlphaSaveMode | None
+ |
+
+
+
+ the render alpha save mode + |
+
+ None
+ |
+
save_format |
+
+ pytvpaint.george.SaveFormat | None
+ |
+
+
+
+ the render format to use. Defaults to None. + |
+
+ None
+ |
+
background_mode |
+
+ pytvpaint.george.BackgroundMode | None
+ |
+
+
+
+ the render background mode + |
+
+ None
+ |
+
format_opts |
+
+ list[str] | None
+ |
+
+
+
+ the custom format options as strings. Defaults to None. + |
+
+ None
+ |
+
layer_selection |
+
+ list[pytvpaint.layer.Layer] | None
+ |
+
+
+
+ the layers to render. Defaults to None. + |
+
+ None
+ |
+
pytvpaint/utils.py
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 |
|
restore_current_frame(tvp_element: HasCurrentFrame, frame: int) -> Generator[None, None, None]
+
+¶Context that temporarily changes the current frame to the one provided and restores it when done.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
tvp_element |
+
+ pytvpaint.utils.HasCurrentFrame
+ |
+
+
+
+ clip to change + |
+ + required + | +
frame |
+
+ int
+ |
+
+
+
+ frame to set. Defaults to None. + |
+ + required + | +
pytvpaint/utils.py
388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 |
|
get_tvp_element(tvp_elements: Iterator[TVPElementType], by_id: int | str | None = None, by_name: str | None = None, by_path: str | Path | None = None) -> TVPElementType | None
+
+¶Search for a TVPaint element by attributes.
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
tvp_elements |
+
+ collections.abc.Iterator[pytvpaint.utils.TVPElementType]
+ |
+
+
+
+ a collection of TVPaint objects + |
+ + required + | +
by_id |
+
+ int | str | None
+ |
+
+
+
+ search by id. Defaults to None. + |
+
+ None
+ |
+
by_name |
+
+ str | None
+ |
+
+
+
+ search by name, search is case-insensitive. Defaults to None. + |
+
+ None
+ |
+
by_path |
+
+ str | pathlib.Path | None
+ |
+
+
+
+ search by path. Defaults to None. + |
+
+ None
+ |
+
Raises:
+Type | +Description | +
---|---|
+ ValueError
+ |
+
+
+
+ if bad arguments were given + |
+
Returns:
+Type | +Description | +
---|---|
+ pytvpaint.utils.TVPElementType | None
+ |
+
+
+
+ TVPElementType | None: the found element + |
+
pytvpaint/utils.py
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 |
|
handle_output_range(output_path: Path | str | FileSequence, default_start: int, default_end: int, start: int | None = None, end: int | None = None) -> tuple[FileSequence, int, int, bool, bool]
+
+¶Handle the different options for output paths and range.
+Whether the user provides a range (start-end) or a filesequence with a range or not, this functions ensures we +always end up with a valid range to render
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
output_path |
+
+ pathlib.Path | str | fileseq.filesequence.FileSequence
+ |
+
+
+
+ user provided output path + |
+ + required + | +
default_start |
+
+ int
+ |
+
+
+
+ the default start to use if none provided or found in the file sequence object + |
+ + required + | +
default_end |
+
+ int
+ |
+
+
+
+ the default end to use if none provided or found in the file sequence object + |
+ + required + | +
start |
+
+ int | None
+ |
+
+
+
+ user provided start frame or None + |
+
+ None
+ |
+
end |
+
+ int | None
+ |
+
+
+
+ user provided end frame or None + |
+
+ None
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
file_sequence |
+ fileseq.filesequence.FileSequence
+ |
+
+
+
+ output path as a FileSequence object + |
+
start |
+ int
+ |
+
+
+
+ computed start frame + |
+
end |
+ int
+ |
+
+
+
+ computed end frame + |
+
is_sequence |
+ bool
+ |
+
+
+
+ whether the output is a sequence or not + |
+
is_image |
+ bool
+ |
+
+
+
+ whether the output is an image or not (a movie) + |
+
pytvpaint/utils.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 |
|
{"use strict";/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var Va=/["'&<>]/;qn.exports=za;function za(e){var t=""+e,r=Va.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i