Skip to content

Scene related George functions

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

Source code in pytvpaint/george/grg_scene.py
10
11
12
13
14
15
16
17
@try_cmd(exception_msg="No scene at provided position")
def tv_scene_enum_id(position: int) -> int:
    """Get the id of the scene at the given position in the current project.

    Raises:
        GeorgeError: if no scene found at the provided position
    """
    return int(send_cmd("tv_SceneEnumId", position, error_values=[GrgErrorValue.NONE]))

tv_scene_current_id() -> int

Get the id of the current scene.

Source code in pytvpaint/george/grg_scene.py
20
21
22
def tv_scene_current_id() -> int:
    """Get the id of the current scene."""
    return int(send_cmd("tv_SceneCurrentId"))

tv_scene_move(scene_id: int, position: int) -> None

Move a scene to another position.

Source code in pytvpaint/george/grg_scene.py
25
26
27
def tv_scene_move(scene_id: int, position: int) -> None:
    """Move a scene to another position."""
    send_cmd("tv_SceneMove", scene_id, position)

tv_scene_new() -> None

Create a new scene (with a new clip) after the current scene.

Source code in pytvpaint/george/grg_scene.py
30
31
32
def tv_scene_new() -> None:
    """Create a new scene (with a new clip) after the current scene."""
    send_cmd("tv_SceneNew")

tv_scene_duplicate(scene_id: int) -> None

Duplicate the given scene.

Source code in pytvpaint/george/grg_scene.py
35
36
37
def tv_scene_duplicate(scene_id: int) -> None:
    """Duplicate the given scene."""
    send_cmd("tv_SceneDuplicate", scene_id)

tv_scene_close(scene_id: int) -> None

Remove the given scene.

Source code in pytvpaint/george/grg_scene.py
40
41
42
def tv_scene_close(scene_id: int) -> None:
    """Remove the given scene."""
    send_cmd("tv_SceneClose", scene_id)

tv_scene_create(clips: list[str]) -> int

Create a new scene (with a list of new clips provided) after the current scene.

Parameters:

Name Type Description Default
clips list[str]

list of clip names to create alongside new scene

required

Returns:

Name Type Description
scene_id int

new scene id

Warning

function tv_scene_create doesn't seem to work in tvpaint.

Source code in pytvpaint/george/grg_scene.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@min_version_compatible(min_version="12")
def tv_scene_create(clips: list[str]) -> int:
    """Create a new scene (with a list of new clips provided) after the current scene.

    Args:
        clips: list of clip names to create alongside new scene

    Returns:
        scene_id: new scene id

    Warning:
        function `tv_scene_create` doesn't seem to work in tvpaint.
    """
    return int(send_cmd("tv_SceneCreate", *clips))

tv_scene_split(scene_id: int) -> list[int]

Splits each clips in the scene into its own scene.

Parameters:

Name Type Description Default
scene_id int

scene if

required

Returns:

Name Type Description
clip_ids list[int]

list of clip ids in the split scene

Source code in pytvpaint/george/grg_scene.py
61
62
63
64
65
66
67
68
69
70
71
72
@min_version_compatible(min_version="12")
def tv_scene_split(scene_id: int) -> list[int]:
    """Splits each clips in the scene into its own scene.

    Args:
        scene_id: scene if

    Returns:
        clip_ids: list of clip ids in the split scene

    """
    return tv_cast_to_type(send_cmd("tv_SceneSplit", scene_id), list[int])