Camera class¶
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.
Source code in pytvpaint/camera.py
27 28 29 30 31 | |
clip: Clip
property
¶
The camera's clip.
layer: Layer | None
property
¶
The layer associated to this camera.
Note
This function is only available in TVPaint version 12 and above.
Raises:
| Type | Description |
|---|---|
NotImplemented
|
if used in tvpaint version inferior to 12 |
points: Iterator[CameraPoint]
property
¶
Iterator for the CameraPoint objects of the camera.
Warning
Property Camera.points usually only returns the first camera point and nothing else,
this is a TVPaint limitation, we advise using Camera.get_point_data_at() to get more accurate results.
refresh_on_call = True
instance-attribute
¶
refresh() -> None
¶
Refreshes the camera data.
Source code in pytvpaint/camera.py
33 34 35 36 37 | |
make_current() -> None
¶
Makes the parent clip the current one, thereby making sure the correct camera will be set.
Source code in pytvpaint/camera.py
48 49 50 | |
width(value: int) -> None
¶
The sensor width of the camera.
Source code in pytvpaint/camera.py
58 59 60 61 62 | |
height(value: int) -> None
¶
The sensor height of the camera.
Source code in pytvpaint/camera.py
70 71 72 73 74 | |
fps(value: float) -> None
¶
The framerate of the camera.
Warning
DEPRECATED: Property Camera.fps is not recommended for use in TVP 12, use Project.fps instead.
For now, in TVP 12, it always returns 1.0 but will be removed in future versions.
Source code in pytvpaint/camera.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
pixel_aspect_ratio(value: float) -> None
¶
The pixel aspect ratio of the camera.
Source code in pytvpaint/camera.py
117 118 119 120 121 122 123 124 125 126 127 | |
anti_aliasing() -> int
¶
The antialiasing value of the camera.
Warning
DEPRECATED: Property Camera.anti_aliasing not longer exists in TVP 12.
For now, in TVP 12, it always returns 1 but will be removed in future versions.
Source code in pytvpaint/camera.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
field_order(value: george.FieldOrder) -> None
¶
The field order of the camera.
Source code in pytvpaint/camera.py
150 151 152 153 154 | |
insert_point(index: int, x: int, y: int, angle: int, scale: float) -> CameraPoint
¶
Insert a new point in the camera path.
Source code in pytvpaint/camera.py
170 171 172 173 174 175 176 177 178 179 180 | |
get_point_data_at(position: float) -> InterpolationCameraPoint
¶
Get the points data interpolated at the provided position (between 0 and 1).
Source code in pytvpaint/camera.py
201 202 203 204 | |
get_point_data_at_frame(frame: int) -> FrameCameraPoint
¶
Get the points data interpolated at the specified frame in the clip.
Source code in pytvpaint/camera.py
206 207 208 209 210 | |
remove_point(index: int) -> None
¶
Remove a point at the provided index.
Source code in pytvpaint/camera.py
212 213 214 215 216 217 218 219 | |
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.
Source code in pytvpaint/camera.py
228 229 230 231 232 233 234 235 236 237 | |
index: int
property
¶
The index of the point in the path.
camera: Camera
property
¶
The camera instance it belongs to.
width: float
property
¶
The width of the camera at the point.
height: float
property
¶
The height of the camera at the point.
refresh_on_call = True
instance-attribute
¶
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
¶
Refreshes the camera point data.
Source code in pytvpaint/camera.py
239 240 241 242 243 244 | |
data() -> george.TVPCameraPoint
¶
Returns the raw data of the point.
Source code in pytvpaint/camera.py
258 259 260 261 | |
x(value: float) -> None
¶
The x coordinate of the point.
Source code in pytvpaint/camera.py
278 279 280 281 282 283 284 285 286 287 288 | |
y(value: float) -> None
¶
The y coordinate of the point.
Source code in pytvpaint/camera.py
295 296 297 298 299 300 301 302 303 304 305 | |
angle(value: float) -> None
¶
The angle of the camera at the point.
Source code in pytvpaint/camera.py
312 313 314 315 316 317 318 319 320 321 322 | |
scale(value: float) -> None
¶
Source code in pytvpaint/camera.py
329 330 331 332 333 334 335 336 337 338 | |
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 the provided index.
Source code in pytvpaint/camera.py
350 351 352 353 354 355 356 357 358 359 360 361 362 | |
remove() -> None
¶
Remove the camera point.
Warning
the point instance won't be usable after this call
Source code in pytvpaint/camera.py
364 365 366 367 368 369 370 371 | |
mark_removed() -> None
¶
Marks the object as removed and is therefor not usable.
Source code in pytvpaint/utils.py
98 99 100 | |
InterpolationCameraPoint(interpolation_point: float, camera: Camera, data: george.TVPCameraPoint | None = None)
¶
Bases: pytvpaint.camera.CameraPoint
A Read-Only CameraPoint.
You can use them to animate the camera movement.
Source code in pytvpaint/camera.py
380 381 382 383 384 385 386 387 | |
interpolation_point: float
property
¶
Interpolation point (between 0 and 1) for this CameraPoint.
refresh_on_call = True
instance-attribute
¶
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 |
index: int
property
¶
The index of the point in the path.
camera: Camera
property
¶
The camera instance it belongs to.
width: float
property
¶
The width of the camera at the point.
height: float
property
¶
The height of the camera at the point.
get_point_data_at(position: float) -> george.TVPCameraPoint
classmethod
¶
Get the points data interpolated at the provided position (between 0 and 1).
Source code in pytvpaint/camera.py
398 399 400 401 402 | |
refresh() -> None
¶
Refreshes the camera point data at the interpolation point.
Source code in pytvpaint/camera.py
404 405 406 407 408 | |
remove() -> None
¶
Remove the camera point.
Warning
the FrameCameraPoint instance is read-only and cannot be removed as it doesn't really exist
Source code in pytvpaint/camera.py
410 411 412 413 414 415 416 417 418 419 | |
mark_removed() -> None
¶
Marks the object as removed and is therefor not usable.
Source code in pytvpaint/utils.py
98 99 100 | |
data() -> george.TVPCameraPoint
¶
Returns the raw data of the point.
Source code in pytvpaint/camera.py
258 259 260 261 | |
x(value: float) -> None
¶
The x coordinate of the point.
Source code in pytvpaint/camera.py
278 279 280 281 282 283 284 285 286 287 288 | |
y(value: float) -> None
¶
The y coordinate of the point.
Source code in pytvpaint/camera.py
295 296 297 298 299 300 301 302 303 304 305 | |
angle(value: float) -> None
¶
The angle of the camera at the point.
Source code in pytvpaint/camera.py
312 313 314 315 316 317 318 319 320 321 322 | |
scale(value: float) -> None
¶
Source code in pytvpaint/camera.py
329 330 331 332 333 334 335 336 337 338 | |
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 the provided index.
Source code in pytvpaint/camera.py
350 351 352 353 354 355 356 357 358 359 360 361 362 | |
FrameCameraPoint(frame: int, camera: Camera, data: george.TVPCameraPoint | None = None)
¶
Bases: pytvpaint.camera.CameraPoint
A Read-Only CameraPoint.
You can use them to animate the camera movement.
Source code in pytvpaint/camera.py
428 429 430 431 432 433 434 435 | |
frame: float
property
¶
Frame for this CameraPoint.
refresh_on_call = True
instance-attribute
¶
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 |
index: int
property
¶
The index of the point in the path.
camera: Camera
property
¶
The camera instance it belongs to.
width: float
property
¶
The width of the camera at the point.
height: float
property
¶
The height of the camera at the point.
get_point_data_at(clip: Clip, frame: int) -> george.TVPCameraPoint
classmethod
¶
Get the points data interpolated at the specified frame in the clip.
Source code in pytvpaint/camera.py
446 447 448 449 450 | |
refresh() -> None
¶
Refreshes the camera point data at the frame.
Source code in pytvpaint/camera.py
452 453 454 455 456 | |
remove() -> None
¶
Remove the camera point.
Warning
the FrameCameraPoint instance is read-only and cannot be removed as it doesn't really exist
Source code in pytvpaint/camera.py
458 459 460 461 462 463 464 465 | |
mark_removed() -> None
¶
Marks the object as removed and is therefor not usable.
Source code in pytvpaint/utils.py
98 99 100 | |
data() -> george.TVPCameraPoint
¶
Returns the raw data of the point.
Source code in pytvpaint/camera.py
258 259 260 261 | |
x(value: float) -> None
¶
The x coordinate of the point.
Source code in pytvpaint/camera.py
278 279 280 281 282 283 284 285 286 287 288 | |
y(value: float) -> None
¶
The y coordinate of the point.
Source code in pytvpaint/camera.py
295 296 297 298 299 300 301 302 303 304 305 | |
angle(value: float) -> None
¶
The angle of the camera at the point.
Source code in pytvpaint/camera.py
312 313 314 315 316 317 318 319 320 321 322 | |
scale(value: float) -> None
¶
Source code in pytvpaint/camera.py
329 330 331 332 333 334 335 336 337 338 | |
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 the provided index.
Source code in pytvpaint/camera.py
350 351 352 353 354 355 356 357 358 359 360 361 362 | |