Scripting Interface |
The LayerManager JavaScript class. Access the layers of a given panel. More...
Panel Layer Manipulation | |
int | numberOfLayers (String &panelId) |
Return the number of layers in a panel. More... | |
bool | addVectorLayer (String &panelId, int targetLayerIdx, bool before, String &suggestedName) |
Add a vector layer. More... | |
bool | addBitmapLayer (String &panelId, int targetLayerIdx, bool before, String &suggestedName) |
Add a bitmap layer. More... | |
bool | isVectorLayer (String &panelId, int index) |
Return true if a layer is a vector layer. More... | |
bool | is3DLayer (String &panelId, int index) |
Return true if a layer is a 3D layer. More... | |
bool | isBitmapLayer (String &panelId, int index) |
Return true if a layer is a bitmap. More... | |
bool | deleteLayer (String &panelId, int index) |
Delete a given layer. More... | |
bool | renameLayer (String &panelId, int index, String &suggestedName) |
Rename a given layer. More... | |
String | layerName (String &panelId, int index) |
Return the name of a layer. More... | |
bool | importImageAsLayer (String &panelId, String &fullPathAndFileName) |
Import image and creates a new layer at index 0, returns if successful. More... | |
bool | setLayerVisible (String &panelId, int index, bool visible) |
Set the visibility flag of the layers of a panel. More... | |
bool | layerVisibility (String &panelId, int index) |
Get the visibility flag of the layers of a panel. More... | |
bool | setLayerOpacity (String &panelId, int index, double opacity) |
Set a layer's opacity. More... | |
double | layerOpacity (String &panelId, int index) |
Get layers opacity value. More... | |
bool | setLayerAlignment (String &panelId, int index, String &alignment) |
Set a layer's alignment value. More... | |
String | layerAlignment (String &panelId, int index) |
Get a layer's alignment value. More... | |
String | getLayerDrawingName (String &panelId, int index, bool fullPath) |
Get the path to a layer's drawing. More... | |
int | getLayerElementId (String &panelId, int index) |
Return the element id of the layer. May be useful when using the element and Drawing global objects. More... | |
bool | generateMatteLayer (String &panelId, int index, double radius, bool copyStrokes, bool replaceLayer) |
Generate a new drawing layer making a matte from the given layer. The matte will be of the current selected color. More... | |
bool | generateMatteLayer (String &panelId, int index, double radius, bool copyStrokes, bool replaceLayer, unsigned int red, unsigned int green, unsigned int blue) |
Generate a new drawing layer making a matte from the given layer. The matte will be of the given color. More... | |
bool | generateMatte (String &panelId, int index, QScriptValue options) |
Generate matte from a given layer to a new drawing layer or directly on the source layer. More... | |
bool | isShared (QScriptValue layer) |
Look at the the given Layer and return if it is shared. More... | |
QScriptValue | mergeLayers (QScriptValue layers, String &newLayerName) |
Merge the given Layers into a single panel. More... | |
bool | isEmpty (QScriptValue layer) |
Look at the given layer and return if it is empty or not. A layer is empty if it has no drawing. More... | |
The LayerManager JavaScript class. Access the layers of a given panel.
|
slot |
Add a bitmap layer.
panelId | - unique id of the panel |
targetLayerIdx | - index of sibling layer |
before | - whether new layer is before or after sibling layer |
suggestedName | - suggested Name |
|
slot |
Add a vector layer.
panelId | - unique id of the panel |
targetLayerIdx | - index of sibling layer |
before | - whether new layer is before or after sibling layer |
suggestedName | - suggested Name |
|
slot |
Delete a given layer.
panelId | - uniqueId of the panel |
index | - index of the layer |
|
slot |
Generate matte from a given layer to a new drawing layer or directly on the source layer.
panelId | - The unique id of the panel | ||||||||||||||||||
index | - The index of the layer | ||||||||||||||||||
options | - Options used to generate the matte. The option object has the following properties:
|
|
slot |
Generate a new drawing layer making a matte from the given layer. The matte will be of the current selected color.
panelId | - The unique id of the panel |
index | - The index of the layer |
radius | - The matte radius |
copyStrokes | - Set to true to copy the strokes |
replaceLayer | - Set to true to replace the existing layer by one with the same name, false to keep both |
|
slot |
Generate a new drawing layer making a matte from the given layer. The matte will be of the given color.
panelId | - The unique id of the panel |
index | - The index of the layer |
radius | - The matte radius |
copyStrokes | - Set to true to copy the strokes |
replaceLayer | - Set to true to replace the existing layer by one with the same name, false to keep both |
red | - The red channel value (0..255) for the matte. A value higher than 255 will be clamped. |
green | - The green channel value (0..255) for the matte. A value higher than 255 will be clamped. |
blue | - The blue channel value (0..255) for the matte. A value higher than 255 will be clamped. |
|
slot |
Get the path to a layer's drawing.
panelId | - unique id of the panel |
index | - index of the layer |
fullPath | - boolean to determine if the returned path is the full path or the file name |
|
slot |
Return the element id of the layer. May be useful when using the element and Drawing global objects.
panelId | - unique id of the panel |
index | - index of the layer |
|
slot |
Import image and creates a new layer at index 0, returns if successful.
panelId | - unique id of the panel |
fullPathAndFileName | - absolute path to image file |
|
slot |
Return true if a layer is a 3D layer.
panelId | - unique id of the panel |
index | - index of the layer |
|
slot |
Return true if a layer is a bitmap.
panelId | - unique id of the panel |
index | - index of the layer |
|
slot |
Look at the given layer and return if it is empty or not. A layer is empty if it has no drawing.
layer | - an object with the name [String] and panelId properties [String]. |
|
slot |
Look at the the given Layer and return if it is shared.
layer | a layer is defined by those properties: frame, panelId, name. |
|
slot |
Return true if a layer is a vector layer.
panelId | - unique id of the panel |
index | - index of the layer |
|
slot |
Get a layer's alignment value.
panelId | - unique id of the panel |
index | - index of the layer |
|
slot |
Return the name of a layer.
panelId | - unique id of the panel |
index | - index of the layer |
|
slot |
Get layers opacity value.
panelId | - unique id of the panel |
index | - index of the layer |
|
slot |
Get the visibility flag of the layers of a panel.
panelId | - unique id of the panel |
index | - index of the layer |
|
slot |
Merge the given Layers into a single panel.
layers | - an array of objects with the name [String] and panelId properties [String]. |
newLayerName | - new name of the layer created from the merge. |
|
slot |
Return the number of layers in a panel.
panelId | - unique id of the panel |
|
slot |
Rename a given layer.
panelId | - unique id of the panel |
index | - index of the layer |
suggestedName | - suggested name |
|
slot |
Set a layer's alignment value.
panelId | - unique id of the panel |
index | - index of the layer |
alignment | - value between 0 and 100 |
|
slot |
Set a layer's opacity.
panelId | - unique id of the panel |
index | - index of the layer |
opacity | - value between 0 and 100 |
|
slot |
Set the visibility flag of the layers of a panel.
panelId | - unique id of the panel |
index | - index of the layer |
visible | - boolean flag |