A layer in the current sketch
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 |
Creates a new layer
Returns: Layer (The new layer)
myLayer = Layer:New()
Selects all strokes and widgets on this layer
Returns: nil
myLayer:SelectAll()
Move the pivot point of the layer to the average center of it's contents
Returns: nil
myLayer:CenterPivot()
Shows a visible widget indicating the pivot point of the layer
Returns: nil
myLayer:ShowPivot()
Hides the visible widget indicating the pivot point of the layer
Returns: nil
myLayer:HidePivot()
Deletes all content from the layer
Returns: nil
myLayer:Clear()
Deletes the layer and all it's content
Returns: nil
myLayer:Delete()
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)
combinedLayer = myLayer:Squash()
Combines this layer with the specified layer
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
destinationLayer | Layer | The destination layer |
myLayer:SquashTo(otherLayer)
Shows the layer
Returns: nil
myLayer:Show()
Hides the layer
Returns: nil
myLayer:Hide()
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) |
myLayer:SetShaderClipping(0.1, 0.9)
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) |
myLayer:SetShaderClipping("Ink", 0.1, 0.9)
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 |
myLayer:SetShaderFloat("_EmissionGain", 0.5)
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 |
myLayer:SetShaderFloat("Light", "_EmissionGain", 0.5)
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 | Color | The new color |
myLayer:SetShaderColor("_TintColor", Color.red)
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 | Color | The new color |
myLayer:SetShaderColor("Embers", "_TintColor", Color.red)
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 | Image | The new image to use as a texture |
myLayer:SetShaderTexture("_MainTex", myImage)
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 | Image | The new image to use as a texture |
myLayer:SetShaderTexture("Ink", "_MainTex", myImage)
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 |
myLayer:SetShaderVector("_TimeOverrideValue", 0.5, 0, 0, 0)
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 |
myLayer:SetShaderVector("NeonPulse", "_TimeOverrideValue", 0.5, 0, 0, 0)