LayerInstance class¶
A layer instance is a frame where there is a drawing. It only has a start frame.
Note
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 |
Source code in 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.
Source code in 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.
Source code in 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.
Source code in 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 |
Source code in pytvpaint/layer.py
165 166 167 168 169 170 171 172 173 174 175 |
|
select() -> None
¶
Select all frames in this instance.
Source code in pytvpaint/layer.py
177 178 179 |
|