The DrawingTools JavaScript global object. Get information about the currently selected drawing. More...
Classes | |
class | vectorize |
Public Slots | |
void | setCurrentArt (int currentArt) |
Sets the current art to be one of the following : underlayArt, colourArt, lineArt or overlayArt. More... | |
bool | setCurrentDrawingFromColumnName (String columnName, int frame=1) |
bool | setCurrentDrawingFromNodeName (String nodeName, int frame=1) |
Sets the current drawing to be from node nodeName at frame frame. More... | |
void | convertPencilToBrush (int art=LineArtMask, DrawingToolParams *params=0) |
Converts the selected pencil lines in layer of the current drawing using params. More... | |
void | extractCenterline (int srcArt=LineArtMask, int dstArt=ColourArtMask, DrawingToolParams *params=0) |
Extracts the centerline from srcArt and puts the extracted line in dstArt using params. More... | |
void | computeBreakingTriangles (DrawingToolParams *params=0) |
Computes the breaking triangles of the current layer using params. More... | |
void | recolorDrawing (QScriptValue drawingKey, QScriptValue colorMap) |
Recolours the drawing identified by a drawing key. More... | |
void | changeDrawingVectorLayerResolution (QScriptValue drawingKey, double pixelPerModelUnit, QScriptValue options=QScriptValue()) |
Changes the vector layer resolution of a given drawing. More... | |
void | changeDrawingBitmapLayerResolution (QScriptValue drawingKey, double pixelPerModelUnit, QScriptValue options=QScriptValue()) |
Changes the bitmap layer resolution of a given drawing. More... | |
QScriptValue | getDrawingUsedColors (QScriptValue drawingKey) |
Returns an array containing the set of colour ids used by the drawing. More... | |
QScriptValue | getDrawingUsedColorsWithSource (QScriptValue drawingKey) |
Returns an array of objects describing the set of colour ids used by the drawing along with the source of the colour. More... | |
QScriptValue | getMultipleDrawingsUsedColors (QScriptValue drawingKeyArray) |
Return an array containing the set of colour ids used by all drawings in the array. More... | |
Public Member Functions | |
QVariant | vectorize (...) |
bool | optimize (QVariant config) |
Performs the same operation as Drawing->Optimize->Optimize menu item. More... | |
bool | flatten (QVariant config) |
Performs the same operation as Drawing->Optimize->Flatten menu item. More... | |
bool | clearArt (QVariant config) |
Clears an art of a drawing. More... | |
Properties | |
int | underlayArt |
Returns the underlayArt mask. More... | |
int | colourArt |
Returns the colourArt mask. More... | |
int | lineArt |
Returns the lineArt mask. More... | |
int | overlayArt |
Returns the overlayArt mask. More... | |
int | allArts |
Returns the mask for all 4 art layers. More... | |
The DrawingTools JavaScript global object. Get information about the currently selected drawing.
|
slot |
Changes the bitmap layer resolution of a given drawing.
The example below uses DrawingTools.changeDrawingBitmapLayerResolution(..) to change all art layers (0=underlay, 1=line art, 2=color art, 3=overlay) resolutions of the 2nd drawing associated with a given node timing column.
drawingKey | : The drawing identifier |
pixelPerModelUnit | : The new normalized pixel density (1.0 = 100%) |
options | : Optional parameters. The following properties are supported : |
Property | Type | Default Value | Description |
---|---|---|---|
resampleBitmap | bool | true | Will only resample existing bitmaps if set to true. |
art | Array | [0,1,2,3] | Controls which art layers are targeted by the function call (0=underlay, 1=line art, 2=color art, 3=overlay) |
|
slot |
Changes the vector layer resolution of a given drawing.
The example below uses DrawingTools.changeDrawingVectorLayerResolution(..) to change all art layers (0=underlay, 1=line art, 2=color art, 3=overlay) resolutions of the first drawing associated with a given node timing column.
drawingKey | : The drawing identifier |
pixelPerModelUnit | : The new normalized pixel density (1.0 = 100%) |
options | : Optional parameters. The following properties are supported : |
Property | Type | Default Value | Description |
---|---|---|---|
applyToExistingStrokes | bool | true | Will only apply the resolution to new strokes if set to false. |
art | Numeric Array | [0,1,2,3] | Controls which art layers are targeted by the function call (0=underlay, 1=line art, 2=color art, 3=overlay) |
bool DrawingTools::clearArt | ( | QVariant | config | ) |
Clears an art of a drawing.
Takes an object that can contain: drawing : Drawing Key art : int The art to clear. 0 = Underlay, 1 = Colour Art, 2 = Line Art, 3 = Overlay
|
slot |
Computes the breaking triangles of the current layer using params.
params | : The DrawingToolParams. |
|
slot |
Converts the selected pencil lines in layer of the current drawing using params.
art | : The current drawing. |
params | : The DrawingToolParams. |
|
slot |
Extracts the centerline from srcArt and puts the extracted line in dstArt using params.
srcArt | : The source art. |
dstArt | : The destination art layer. |
params | : The DrawingToolParams. |
bool DrawingTools::flatten | ( | QVariant | config | ) |
Performs the same operation as Drawing->Optimize->Flatten menu item.
Takes an object that can contain: drawing : Drawing Key removeInvisibleLines : bool default false
|
slot |
Returns an array containing the set of colour ids used by the drawing.
drawingKey | : A key identifying a drawing from a file, an exposure on an element node or drawing of an element. |
|
slot |
Returns an array of objects describing the set of colour ids used by the drawing along with the source of the colour.
drawingKey | : A key identifying a drawing from a file, an exposure on an element node or drawing of an element. |
|
slot |
Return an array containing the set of colour ids used by all drawings in the array.
drawingKeyArray | : An array of keys identifying a drawing from a file, an exposure on an element node or drawing of an element. |
bool DrawingTools::optimize | ( | QVariant | config | ) |
Performs the same operation as Drawing->Optimize->Optimize menu item.
Takes an object that can contain: drawing : Drawing Key removeInvisibleLines : bool default false
|
slot |
Recolours the drawing identified by a drawing key.
DrawingKey : A drawing key, built from { ElementID : id, exposure : "drawingName"}, or {node: "Qualified_name", frame : i}
ColorMap : An array of colour mappings of the format [ {from : "colorId", to : "colorId"}, ... ,{...} ].
|
slot |
Sets the current art to be one of the following : underlayArt, colourArt, lineArt or overlayArt.
|
slot |
columnName | : The name of the column to start the drawing at. |
frame | : The frame number to set the current drawing at. |
|
slot |
Sets the current drawing to be from node nodeName at frame frame.
nodeName | : The name of the node to start the drawing at. |
frame | : The frame number to set the current drawing at. |
QVariant DrawingTools::vectorize | ( | ... | ) |
vectorize function; Can be called with a variable list of arguments.
The list of options available for the vectorize method can be obtained by calling DrawingTools.vectorize.help();
|
read |
Returns the mask for all 4 art layers.
|
read |
Returns the colourArt mask.
|
read |
Returns the lineArt mask.
|
read |
Returns the overlayArt mask.
|
read |
Returns the underlayArt mask.