Layer
Summary
A layer in the current sketch
Instance Properties
Name | Return Type | Description |
---|---|---|
strokes | StrokeList Read-only | All the strokes on this layer |
images | ImageList Read-only | All the images on this layer |
allowStrokeAnimation | boolean Read/Write | Sets whether or not individual strokes on this layer can be animated via |
videos | VideoList Read-only | All the videos on this layer |
models | ModelList Read-only | All the models on this layer |
guides | GuideList Read-only | All the guides on this layer |
cameraPaths | CameraPathList Read-only | All the camera paths on this layer |
groups | GroupList Read-only | All the groups on this layer |
index | number Read-only | Gets the index of the layer in the layer canvases |
active | boolean Read/Write | Is the layer the active layer. Making another layer inactive will make the main layer the active layer again. |
transform | Transform Read/Write | The transform of the layer |
position | Vector3 Read/Write | The 3D position of the Layer (specifically the position of it's anchor point |
rotation | Rotation Read/Write | The rotation of the layer in 3D space |
scale | number Read/Write | The scale of the layer |
Class Methods
Layer:New()
Creates a new layer
Returns: Layer (The new layer)
Example
Layer:SelectAll()
Selects all strokes and widgets on this layer
Returns: nil
Example
Instance Methods
layer:CenterPivot()
Move the pivot point of the layer to the average center of it's contents
Returns: nil
Example
layer:ShowPivot()
Shows a visible widget indicating the pivot point of the layer
Returns: nil
Example
layer:HidePivot()
Hides the visible widget indicating the pivot point of the layer
Returns: nil
Example
layer:Clear()
Deletes all content from the layer
Returns: nil
Example
layer:Delete()
Deletes the layer and all it's content
Returns: nil
Example
layer:Squash()
Combines this layer and the one above it. If this layer is the first layer do nothing
Returns: Layer (The layer that contains the combined content)
Example
layer:SquashTo(destinationLayer)
Combines this layer with the specified layer
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
destinationLayer | The destination layer |
Example
layer:Show()
Shows the layer
Returns: nil
Example
layer:Hide()
Hides the layer
Returns: nil
Example
layer:SetShaderClipping(clipStart, clipEnd)
Hides the section of the each batch of strokes that is outside the specified range. Affects all strokes on this layer with this brush type
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
clipStart | number | The amount of the stroke to hide from the start (0-1) | |
clipEnd | number | The amount of the stroke to hide from the end (0-1) |
Example
layer:SetShaderClipping(brushType, clipStart, clipEnd)
Hides the section of the each batch of strokes that is outside the specified range. Affects all strokes on this layer with this brush type
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
brushType | string | Only strokes of this brush type will be affected | |
clipStart | number | The amount of the stroke to hide from the start (0-1) | |
clipEnd | number | The amount of the stroke to hide from the end (0-1) |
Example
layer:SetShaderFloat(parameter, value)
Changes a shader float parameter. Affects all strokes on this layer
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
value | number | The new value |
Example
layer:SetShaderFloat(brushType, parameter, value)
Changes a shader float parameter. Affects all strokes on this layer with this brush type
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
brushType | string | Only strokes of this brush type will be affected | |
parameter | string | The shader parameter name | |
value | number | The new value |
Example
layer:SetShaderColor(parameter, color)
Changes a shader color parameter. Affects all strokes on this layer
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
color | The new color |
Example
layer:SetShaderColor(brushType, parameter, color)
Changes a shader color parameter. Affects all strokes on this layer with this brush type
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
brushType | string | Only strokes of this brush type will be affected | |
parameter | string | The shader parameter name | |
color | The new color |
Example
layer:SetShaderTexture(parameter, image)
Changes a shader texture parameter. Affects all strokes on this layer
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
image | The new image to use as a texture |
Example
layer:SetShaderTexture(brushType, parameter, image)
Changes a shader texture parameter. Affects all strokes on this layer with this brush type
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
brushType | string | Only strokes of this brush type will be affected | |
parameter | string | The shader parameter name | |
image | The new image to use as a texture |
Example
layer:SetShaderVector(parameter, x, y, z, w)
Changes a shader vector parameter. Affects all strokes on this layer
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parameter | string | The shader parameter name | |
x | number | The new x value | |
y | number | 0 | The new y value |
z | number | 0 | The new z value |
w | number | 0 | The new w value |
Example
layer:SetShaderVector(brushType, parameter, x, y, z, w)
Changes a shader vector parameter. Affects all strokes on this layer with this brush type
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
brushType | string | Only strokes of this brush type will be affected | |
parameter | string | The shader parameter name | |
x | number | The new x value | |
y | number | 0 | The new y value |
z | number | 0 | The new z value |
w | number | 0 | The new w value |
Example
Last updated