A camera path and its position, speed or FOV knots
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 |
Renders the currently active path
Returns: nil
CameraPath:RenderActivePath()
Shows all camera paths
Returns: nil
CameraPath:ShowAll()
Hides all camera paths
Returns: nil
CameraPath:HideAll()
Turns previews on or off for the active path
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
active | boolean | On is true, off is false |
CameraPath:PreviewActivePath(true)
Creates a new empty camera path
Returns: CameraPath (The new CameraPath)
CameraPath:New()
Creates a camera path from a Path
Returns: CameraPath (A new CameraPath)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
path | Path | The Path to convert | |
looped | boolean | Whether the resulting CameraPath should loop |
myCameraPath = Camera:FromPath(myPath, false)
Records the active camera path
Returns: nil
CameraPath:
Deletes a camera path
Returns: nil
mycameraPath:Delete()
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 |
myPath = myCameraPath:AsPath(0.5)
Duplicates the camera path
Returns: CameraPath (The copy of the specied CameraPath)
mynewPath = myOldPath:Duplicate()
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 | Vector3 | The position of the new knot | |
rotation | Rotation | The rotation of the new knot | |
smoothing | number | Controls the spline curvature for this knot |
myCameraPath:InsertPosition(pos, rot, 0.5
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 | Rotation | The rotation of the new knot | |
smoothing | number | Controls the spline curvature for this knot |
myCameraPath:InsertPositionAtTime(1.5, rot, 0.5
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 | Vector3 | The position of the new knot | |
rotation | Rotation | The rotation of the new knot |
myCameraPath:InsertRotation(pos, rot
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 | Rotation | The rotation of the new knot |
myCameraPath:InsertRotationAtTime(1.5, rot
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 | Vector3 | The position of the new knot | |
fov | number | The field of view of the new knot |
myCameraPath:InsertFov(pos, 45
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 |
myCameraPath:InsertFovAtTime(2.5, 45
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 | Vector3 | The position of the new knot | |
speed | number | The speed of the new knot |
myCameraPath:InsertSpeed(position, 1.5
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 |
myCameraPath:InsertSpeedAtTime(2.5, 2
Extends the camera path
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
position | Vector3 | The position to extend the camera path to | |
rotation | 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 |
myCameraPath:Extend(pos, rot, 1.2, true
Loops the camera path
Returns: nil
myCameraPath:Loop
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 |
myTransform = myCameraPath:Sample(2.5, true, false)
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 |
newPath = oldPath:Simplify(1.2, 1)