Harmony
Scripting Interface Documentation
DrawingTools Class Reference

The DrawingTools JavaScript global object. Get information about the currently selected drawing. More...

Public Slots

void setCurrentArt (int)
 sets the current art to be one of the following : underlayArt, colourArt, lineArt or overlayArt More...
 
bool setCurrentDrawingFromColumnName (String columnName, int frame=1)
 sets the current drawing to be from column columnName at frame frame More...
 
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 srcLayer and puts the extracted line in dstLayer using params. More...
 
void computeBreakingTriangles (DrawingToolParams *params=0)
 computes the breaking triangles of the current layer using params. More...
 
void recolorDrawing ()
 
QScriptValue getDrawingUsedColors ()
 
QScriptValue getDrawingUsedColorsWithSource ()
 
QScriptValue getMultipleDrawingsUsedColors ()
 

Public Member Functions

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...
 

Properties

int underlayArt
 readonly property - returns underlayArt mask More...
 
int colourArt
 readonly property - returns colourArt mask More...
 
int lineArt
 readonly property - returns lineArt mask More...
 
int overlayArt
 readonly property - returns overlayArt mask More...
 
int allArts
 readonly property - returns mask for all 4 art layers More...
 

Detailed Description

The DrawingTools JavaScript global object. Get information about the currently selected drawing.

Member Function Documentation

◆ computeBreakingTriangles

void DrawingTools::computeBreakingTriangles ( DrawingToolParams params = 0)
slot

computes the breaking triangles of the current layer using params.

◆ convertPencilToBrush

void DrawingTools::convertPencilToBrush ( int  art = LineArtMask,
DrawingToolParams params = 0 
)
slot

converts the selected pencil lines in layer of the current drawing using params

◆ extractCenterline

void DrawingTools::extractCenterline ( int  srcArt = LineArtMask,
int  dstArt = ColourArtMask,
DrawingToolParams params = 0 
)
slot

extracts the centerline from srcLayer and puts the extracted line in dstLayer using params.

◆ flatten()

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

◆ getDrawingUsedColors

QScriptValue DrawingTools::getDrawingUsedColors ( )
slot

Return an array containing the set of color ids used by the drawing.

◆ getDrawingUsedColorsWithSource

QScriptValue DrawingTools::getDrawingUsedColorsWithSource ( )
slot

Returns an array of objects describing the set of color ids used by the drawing along with the source of the color. The returned objects are formatted as follows: { "colorId": <string>, "colorSource": <"COLOR"|"PENCIL_TEXTURE"> } If the colorSource is "COLOR", the colorId is compatible with a Colour palette. If the colorSource is "PENCIL_TEXTURE", the colorId is compatible with a Pencil palette.

◆ getMultipleDrawingsUsedColors

QScriptValue DrawingTools::getMultipleDrawingsUsedColors ( )
slot

Return an array containing the set of color ids used by all drawings in the array.

◆ optimize()

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

◆ recolorDrawing

void DrawingTools::recolorDrawing ( )
slot

Take an array of color mappings of the format [ {from : "colorId", to : "colorId"}, ... ,{...} ] Recolor the drawing identified by a SCR_DrawingKey, built from { ElementID : id, exposure : "drawingName"}, or {node: "Qualified_name", frame : i} /params

◆ setCurrentArt

void DrawingTools::setCurrentArt ( int  )
slot

sets the current art to be one of the following : underlayArt, colourArt, lineArt or overlayArt

◆ setCurrentDrawingFromColumnName

bool DrawingTools::setCurrentDrawingFromColumnName ( String  columnName,
int  frame = 1 
)
slot

sets the current drawing to be from column columnName at frame frame

◆ setCurrentDrawingFromNodeName

bool DrawingTools::setCurrentDrawingFromNodeName ( String  nodeName,
int  frame = 1 
)
slot

sets the current drawing to be from node nodeName at frame frame

Property Documentation

◆ allArts

int DrawingTools::allArts
read

readonly property - returns mask for all 4 art layers

◆ colourArt

int DrawingTools::colourArt
read

readonly property - returns colourArt mask

◆ lineArt

int DrawingTools::lineArt
read

readonly property - returns lineArt mask

◆ overlayArt

int DrawingTools::overlayArt
read

readonly property - returns overlayArt mask

◆ underlayArt

int DrawingTools::underlayArt
read

readonly property - returns underlayArt mask