The DrawingTools JavaScript global object. Get information about the currently selected drawing.
More...
|
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...
|
|
The DrawingTools JavaScript global object. Get information about the currently selected drawing.
◆ clearArt()
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
◆ computeBreakingTriangles
Computes the breaking triangles of the current layer using params.
- Parameters
-
◆ convertPencilToBrush
void DrawingTools::convertPencilToBrush |
( |
int |
art = LineArtMask , |
|
|
DrawingToolParams * |
params = 0 |
|
) |
| |
|
slot |
Converts the selected pencil lines in layer of the current drawing using params.
- Parameters
-
◆ extractCenterline
void DrawingTools::extractCenterline |
( |
int |
srcArt = LineArtMask , |
|
|
int |
dstArt = ColourArtMask , |
|
|
DrawingToolParams * |
params = 0 |
|
) |
| |
|
slot |
Extracts the centerline from srcArt and puts the extracted line in dstArt using params.
- Parameters
-
srcArt | : The source art. |
dstArt | : The destination art layer. |
params | : The DrawingToolParams. |
◆ 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 |
Returns an array containing the set of colour ids used by the drawing.
◆ getDrawingUsedColorsWithSource
QScriptValue DrawingTools::getDrawingUsedColorsWithSource |
( |
| ) |
|
|
slot |
Returns an array of objects describing the set of colour ids used by the drawing along with the source of the colour.
- Returns
- Returns an array of objects describing the set of colour ids used by the drawing along with the source of the colour. 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 colour 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 |
Recolours the drawing identified by a DrawingKey.
DrawingKey : A DrawingKey, 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"}, ... ,{...} ].
◆ setCurrentArt
void DrawingTools::setCurrentArt |
( |
int |
currentArt | ) |
|
|
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 |
- Parameters
-
columnName | : The name of the column to start the drawing at. |
frame | : The frame number to set the current drawing at. |
- Returns
- Returns true if successful.
◆ setCurrentDrawingFromNodeName
bool DrawingTools::setCurrentDrawingFromNodeName |
( |
String |
nodeName, |
|
|
int |
frame = 1 |
|
) |
| |
|
slot |
Sets the current drawing to be from node nodeName at frame frame.
- Parameters
-
nodeName | : The name of the node to start the drawing at. |
frame | : The frame number to set the current drawing at. |
- Returns
- Returns true if successful.
◆ vectorize()
vectorize function; Can be called with a variable list of arguments.
vectorize(
"-file",
"full_path.png",
"-outfile",
"full_path.tvg",
"-threshold 0.5" );
var descriptor =
new Drawing.Key({ elementId: 1, exposure:
"12", layer :
"eye");
var outputDescriptor = {
node:
"Top/Eye_v",
frame : 12};
vectorize( descriptor, outputDescriptor,
"-threshold 0.5" );
function vectorizeExample()
{
{
return;
}
{
return;
}
if (attrType != "Bitmap")
{
MessageLog.
trace(
"The selected node must be an Element Node with bitmap line art.");
return;
}
var destination = n + "_vect";
{
}
var options = {
no_break : true,
thresh : 0.01,
rmv_hairs : 5
};
var optionsLine = "-no_break -thresh 0.01 -rmv_hairs 5";
{
if (keySrc.isNull || keyDst.isNull)
{
continue;
}
}
}
◆ allArts
int DrawingTools::allArts |
|
read |
Returns the mask for all 4 art layers.
- Returns
- The mask for all 4 art layers.
◆ colourArt
int DrawingTools::colourArt |
|
read |
Returns the colourArt mask.
- Returns
- The colourArt mask.
◆ lineArt
int DrawingTools::lineArt |
|
read |
Returns the lineArt mask.
- Returns
- The lineArt mask.
◆ overlayArt
int DrawingTools::overlayArt |
|
read |
Returns the overlayArt mask.
- Returns
- The overlayArt mask.
◆ underlayArt
int DrawingTools::underlayArt |
|
read |
Returns the underlayArt mask.
- Returns
- The underlayArt mask.