CameraPath
Summary
A camera path and its position, speed or FOV knots
Instance Properties
Name | Return Type | Description |
---|---|---|
index | number Read-only | Returns the index of this Camera Path in Sketch.cameraPaths |
layer | Layer Read/Write | The layer the camera path is on |
group | Group Read/Write | The group this camera path is part of |
active | boolean Read/Write | Gets or sets whether this Camera Path is active |
transform | Transform Read/Write | The transform of the camera path |
position | Vector3 Read/Write | The 3D position of the Camera Path (usually but not always its first position knot) |
rotation | Rotation Read/Write | The 3D orientation of the Brush Camera Path |
scale | number Read/Write | The scale of the camera path |
Class Methods
CameraPath:RenderActivePath()
Renders the currently active path
Returns: nil
Example
CameraPath:ShowAll()
Shows all camera paths
Returns: nil
Example
CameraPath:HideAll()
Hides all camera paths
Returns: nil
Example
CameraPath:PreviewActivePath(active)
Turns previews on or off for the active path
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | On is true, off is false |
Example
CameraPath:New()
Creates a new empty camera path
Returns: CameraPath (The new CameraPath)
Example
CameraPath:FromPath(path, looped)
Creates a camera path from a Path
Returns: CameraPath (A new CameraPath)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
path | The Path to convert | ||
looped | boolean | Whether the resulting CameraPath should loop |
Example
CameraPath:RecordActivePath()
Records the active camera path
Returns: nil
Example
Instance Methods
cameraPath:Delete()
Deletes a camera path
Returns: nil
Example
cameraPath:AsPath(step)
Converts the camera path to a path by sampling it at regular time intervals
Returns: Path (The new Path)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
step | number | The time step is use for each sample |
Example
cameraPath:Duplicate()
Duplicates the camera path
Returns: CameraPath (The copy of the specied CameraPath)
Example
cameraPath:InsertPosition(position, rotation, smoothing)
Inserts a new position knot. (Position must be close to the existing path)
Returns: number (The index of the new knot, or -1 if the position is too far from the path)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
position | The position of the new knot | ||
rotation | The rotation of the new knot | ||
smoothing | number | Controls the spline curvature for this knot |
Example
cameraPath:InsertPositionAtTime(t, rotation, smoothing)
Inserts a new position knot into the path at the specified time
Returns: number (The index of the new knot)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
t | number | The time along the path to insert the new knot | |
rotation | The rotation of the new knot | ||
smoothing | number | Controls the spline curvature for this knot |
Example
cameraPath:InsertRotation(position, rotation)
Inserts a rotation knot at the specified position close to the existing path
Returns: number (The index of the new knot, or -1 if the position is too far from the path)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
position | The position of the new knot | ||
rotation | The rotation of the new knot |
Example
cameraPath:InsertRotationAtTime(t, rotation)
Inserts a rotation knot at the specified time
Returns: number (The index of the new knot)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
t | number | The time along the path to insert the new knot | |
rotation | The rotation of the new knot |
Example
cameraPath:InsertFov(position, fov)
Inserts a field of view knot at the specified position close to the existing path
Returns: number (The index of the new knot, or -1 if the position is too far from the path)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
position | The position of the new knot | ||
fov | number | The field of view of the new knot |
Example
cameraPath:InsertFovAtTime(t, fov)
Inserts a fov knot at the specified time
Returns: number (The index of the new knot)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
t | number | The time along the path to insert the new knot | |
fov | number | The field of view of the new knot |
Example
cameraPath:InsertSpeed(position, speed)
Inserts a speed knot at the specified position close to the existing path
Returns: number (The index of the new knot, or -1 if the position is too far from the path)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
position | The position of the new knot | ||
speed | number | The speed of the new knot |
Example
cameraPath:InsertSpeedAtTime(t, speed)
Inserts a speed knot at the specified time
Returns: number (The index of the new knot)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
t | number | The time along the path to insert the new knot | |
speed | number | The speed of the new knot |
Example
cameraPath:Extend(position, rotation, smoothing, atStart)
Extends the camera path
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
position | The position to extend the camera path to | ||
rotation | The rotation of the camera path at the extended position | ||
smoothing | number | The smoothing factor applied to the new point | |
atStart | boolean | false | Determines whether the extension is done at the start or end of the camera path. True=start, false=end |
Example
cameraPath:Loop()
Loops the camera path
Returns: nil
Example
cameraPath:Sample(time, loop, pingpong)
Samples the camera path at the specified time
Returns: Transform (The sampled transform of the camera at the specified time)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
time | number | The time at which to sample the camera path | |
loop | boolean | true | Determines whether the camera path should loop |
pingpong | boolean | false | Determines whether the camera path should pingpong (reverse direction every loop |
Example
cameraPath:Simplify(tolerance, smoothing)
Simplifies the camera path
Returns: CameraPath (A new simplified Camera Path)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
tolerance | number | The tolerance used for simplification | |
smoothing | number | The smoothing factor used for simplification |
Example
Last updated