Scene class¶
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.
Source code in 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).
Source code in pytvpaint/scene.py
34 35 36 37 |
|
current_scene() -> Scene
staticmethod
¶
Returns the current scene of the current project.
Source code in 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.
Source code in pytvpaint/scene.py
47 48 49 50 51 52 53 |
|
make_current() -> None
¶
Make this scene the current one.
Source code in 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.
Source code in 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.
Source code in pytvpaint/scene.py
122 123 124 125 126 |
|
duplicate() -> Scene
¶
Duplicate the scene and return it.
Source code in pytvpaint/scene.py
128 129 130 131 132 133 134 |
|
remove() -> None
¶
Remove the scene and all the clips inside.
Warning
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.
Source code in pytvpaint/scene.py
136 137 138 139 140 141 142 143 144 |
|