-
Notifications
You must be signed in to change notification settings - Fork 1
virtucamera.VCBase Camera Methods
shycats edited this page May 14, 2021
·
5 revisions
- get_scene_cameras( vcserver )
- get_camera_exists( vcserver, camera_name )
- get_camera_has_keys( vcserver, camera_name )
- get_camera_focal_length( vcserver, camera_name )
- get_camera_transform( vcserver, camera_name )
- set_camera_focal_length( vcserver, camera_name, focal_length )
- set_camera_transform( vcserver, camera_name, transform_matrix )
- set_camera_flen_keys( vcserver, camera_name, keyframes, focal_length_values )
- set_camera_transform_keys( vcserver, camera_name, keyframes, transform_matrix_values )
- remove_camera_keys( vcserver, camera_name )
- create_new_camera( vcserver )
Must Return a list or tuple with the names of all the scene cameras.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
Returns
-------
tuple or list
names of all the scene cameras.
Must Return True if the specified camera exists in the scene,
False otherwise.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
camera_name : str
Name of the camera to check for.
Returns
-------
bool
'True' if the camera 'camera_name' exists, 'False' otherwise.
Must Return whether the specified camera has animation keyframes
in the transform or flocal length parameters, as a tuple or list,
in the following order: (transform_has_keys, focal_length_has_keys)
* transform_has_keys (bool) - True if the transform has keyframes.
* focal_length_has_keys (bool) - True if the flen has keyframes.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
camera_name : str
Name of the camera to check for.
Returns
-------
tuple or list of 2 bool
whether the camera 'camera_name' has keys or not as
(transform_has_keys, focal_length_has_keys)
Must Return the focal length value of the specified camera.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
camera_name : str
Name of the camera to get the data from.
Returns
-------
float
focal length value of the camera 'camera_name'.
Must return a tuple or list of 16 floats with the 4x4
transform matrix of the specified camera.
* The up axis must be Y+
* The order must be:
(rxx, rxy, rxz, 0,
ryx, ryy, ryz, 0,
rzx, rzy, rzz, 0,
tx, ty, tz, 1)
Being 'r' rotation and 't' translation,
Is your responsability to rotate or transpose the matrix if needed,
most 3D softwares offer fast APIs to do so.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
camera_name : str
Name of the camera to get the data from.
Returns
-------
tuple or list of 16 float
4x4 transform matrix as
(rxx, rxy, rxz, 0, ryx, ryy, ryz, 0, rzx, rzy, rzz, 0 , tx, ty, tz, 1)
Must set the focal length of the specified camera.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
camera_name : str
Name of the camera to set the focal length to.
focal_length : float
focal length value to be set on the camera 'camera_name'
Must set the transform of the specified camera.
The transform matrix is provided as a tuple of 16 floats
with a 4x4 transform matrix.
* The up axis is Y+
* The order is:
(rxx, rxy, rxz, 0,
ryx, ryy, ryz, 0,
rzx, rzy, rzz, 0,
tx, ty, tz, 1)
Being 'r' rotation and 't' translation,
Is your responsability to rotate or transpose the matrix if needed,
most 3D softwares offer fast APIs to do so.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
camera_name : str
Name of the camera to set the transform to.
transform_matrix : tuple of 16 floats
transformation matrix to be set on the camera 'camera_name'
Must set keyframes on the focal length of the specified camera.
The frame numbers are provided as a tuple of floats and
the focal length values are provided as a tuple of floats
with a focal length value for every keyframe.
The first element of the 'keyframes' tuple corresponds to the first
element of the 'focal_length_values' tuple, the second to the second,
and so on.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
camera_name : str
Name of the camera to set the keyframes to.
keyframes : tuple of floats
Frame numbers to create the keyframes on.
focal_length_values : tuple of floats
focal length values to be set as keyframes on the camera 'camera_name'
Must set keyframes on the transform of the specified camera.
The frame numbers are provided as a tuple of floats and
the transform matrixes are provided as a tuple of tuples of 16 floats
with 4x4 transform matrixes, with a matrix for every keyframe.
The first element of the 'keyframes' tuple corresponds to the first
element of the 'transform_matrix_values' tuple, the second to the second,
and so on.
* The up axis is Y+
* The order is:
(rxx, rxy, rxz, 0,
ryx, ryy, ryz, 0,
rzx, rzy, rzz, 0,
tx, ty, tz, 1)
Being 'r' rotation and 't' translation,
Is your responsability to rotate or transpose the matrixes if needed,
most 3D softwares offer fast APIs to do so.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
camera_name : str
Name of the camera to set the keyframes to.
keyframes : tuple of floats
Frame numbers to create the keyframes on.
transform_matrix_values : tuple of tuples of 16 floats
transformation matrixes to be set as keyframes on the camera 'camera_name'
This method must remove all transform
and focal length keyframes in the specified camera.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
camera_name : str
Name of the camera to remove the keyframes from.
This method must create a new camera in the scene
and return its name.
Parameters
----------
vcserver : virtucamera.VCServer object
Instance of virtucamera.VCServer calling this method.
Returns
-------
str
Newly created camera name.