![]() |
Provides access to modifying Toon Boom drawings.
The OMC::DrawingAccess* provides enclosed access to a given OMC::DrawingVectorArtLayer* – once the access has been started, all modifications made to the drawing will be done at once and will be enclosed in the same operation. This allows for a drawing to be modified with a series of changes – and all changes to occur at the same time.
All drawing changes done on the Vector object directly, and not through the drawing access, are done implictly and will skip the drawing access. This can result in multiple changes being done in different operations. In order to avoid this, wrap the modifications done to a drawing with a single OMC::DrawingAccess begin and end.
Flatten a Deformation with Drawing Access [Ignoring Line Weight]
Create a new Drawing Node and Draw Some Ripples
Public Member Functions | |
void | vector_begin_operations (OMC::DrawingVectorArtLayer *) |
Begins vector operations on the drawing provided. More... | |
void | vector_end_operations () |
Ends vector operations on the drawing currently being modified. | |
void | art_layer_paste (const OMC::DrawingVectorArtLayer *toPaste, const OMC::Matrix *matrixOffset) |
Pastes the drawing object on top of the current drawing. More... | |
QList< OMC::DrawingVectorLayer * > | vector_layers_create (const QVariant &genericDrawingDefinition) |
Creates layers with a generic layer definition object. More... | |
void | vector_layer_copy (const OMC::DrawingVectorLayer *sourceLayer, const OMC::DrawingVectorLayer *targetLayer) |
Copies all the strokes from the source layer to the target layer. More... | |
void | vector_layer_move (const OMC::DrawingVectorLayer *sourceLayer, const OMC::DrawingVectorLayer *targetLayer) |
Moves all the strokes from the source layer to the target layer. More... | |
void | vector_layer_erase (const OMC::DrawingVectorLayer *layer) |
Erases all the strokes of the given layer. More... | |
void | vector_layer_erase (const QList< OMC::DrawingVectorStroke *> layers) |
Erases all the provided strokes. More... | |
void | vector_layer_erase_at (uint idx) |
Erase the node at the given position. More... | |
OMC::DrawingVectorLayer * | vector_layers_merge () |
Merge all layers in the OMC::DrawingVectorArtLayer. More... | |
OMC::DrawingVectorLayer * | vector_layers_merge (QList< OMC::DrawingVectorLayer *> layers) |
Merge the given layers in the OMC::DrawingVectorArtLayer. More... | |
OMC::DrawingLayer * | vector_layer_create (const QString &type) |
Create a layer at the top of the drawing. More... | |
OMC::DrawingLayer * | vector_layer_create_at (uint idx, const QString &type) |
Create a layer at the given index, with the given type. More... | |
void | vector_layer_paste_at (uint idx, OMC::DrawingLayer *layer) |
Copy i_node and all of its children in the current drawing at the given position. More... | |
OMC::DrawingLayer * | vector_layer_create_above (OMC::DrawingLayer *layer, const QString &type) |
Create a layer of the given type above the destination layer. More... | |
OMC::DrawingLayer * | vector_layer_create_under (OMC::DrawingLayer *layer, const QString &type) |
Create a layer of the given type under the destination layer. More... | |
OMC::DrawingVectorStroke * | stroke_create (QList< OMC::DrawingVectorStroke *> strokes, OMC::DrawingLayer *layer) |
Insert a bunch of new strokes into the layer. More... | |
OMC::DrawingVectorStroke * | stroke_create (QList< OMC::DrawingVectorStroke *> strokes, OMC::DrawingVectorStroke *stroke, OMC::DrawingVectorLineStyle *=nullptr, QString side=QString(), OMC::DrawingVectorColour *=nullptr) |
Insert a bunch of new strokes into the layer of the provided stroke. More... | |
QList< OMC::DrawingVectorStroke * > | stroke_copy (QList< OMC::DrawingVectorStroke *> strokes, OMC::DrawingLayer *layer) |
Copies the given stroke and inserts the copy at the end of the given layer. More... | |
QList< OMC::DrawingVectorStroke * > | stroke_copy (QList< OMC::DrawingVectorStroke *> strokes, OMC::DrawingVectorStroke *stroke) |
Copies the given stroke and inserts the copy before the given stroke. More... | |
void | stroke_move (QList< OMC::DrawingVectorStroke *> strokes, OMC::DrawingLayer *layer) |
Moves the given stroke and inserts it at the end of the given layer. More... | |
void | stroke_move (QList< OMC::DrawingVectorStroke *> strokes, OMC::DrawingVectorStroke *layer) |
Moves the given stroke and inserts it before the given stroke. More... | |
void | stroke_erase (QList< OMC::DrawingVectorStroke *> strokes) |
Erases the given stroke from its containing layer. More... | |
void | stroke_set_path (OMC::DrawingVectorStroke *targetStroke, OMC::BezierPath *path) |
Sets the stroke to the provided bezier path. More... | |
void | stroke_set_line_style (OMC::DrawingVectorStroke *targetStroke, OMC::VectorLineStyle *style) |
Sets the line style for the provided stroke(s). More... | |
void | stroke_set_thickness (OMC::DrawingVectorStroke *targetStroke, OMC::VectorThicknessPath *style) |
Sets the thickness path for the provided stroke(s). More... | |
void | stroke_set_tip_type (OMC::DrawingVectorStroke *targetStroke, const QString &direction, const QString &type) |
Sets the stroke's tip type. More... | |
void | stroke_set_tip_tangent (OMC::DrawingVectorStroke *targetStroke, const QString &side, const QString &direction, double tangent) |
Sets the stroke's tangent. More... | |
void | stroke_set_color (OMC::DrawingVectorStroke *targetStroke, const OMC::DrawingVectorColour *colour, const QString &side) |
Sets the inside or outside colour of the given stroke. More... | |
void | joint_set_outside_colour (OMC::DrawingVectorJoint *targetJoint, const OMC::DrawingVectorColour *colour) |
Sets the left colour of the given stroke. More... | |
void | joint_set_inside_colour (OMC::DrawingVectorJoint *targetJoint, const OMC::DrawingVectorColour *colour) |
Sets the inside colour of the given stroke. More... | |
void | contour_set_colour (OMC::DrawingVectorContour *targetStroke, const OMC::DrawingVectorColour *colour, bool children=false) |
Sets the inside colour of the given contour. More... | |
Public Attributes | |
bool | colour_respect_sticky |
True if sticky colours should be respected. More... | |
void OMC::DrawingAccess::art_layer_paste | ( | const OMC::DrawingVectorArtLayer * | toPaste, |
const OMC::Matrix * | matrixOffset | ||
) |
Pastes the drawing object on top of the current drawing.
void OMC::DrawingAccess::contour_set_colour | ( | OMC::DrawingVectorContour * | targetStroke, |
const OMC::DrawingVectorColour * | colour, | ||
bool | children = false |
||
) |
Sets the inside colour of the given contour.
void OMC::DrawingAccess::joint_set_inside_colour | ( | OMC::DrawingVectorJoint * | targetJoint, |
const OMC::DrawingVectorColour * | colour | ||
) |
Sets the inside colour of the given stroke.
void OMC::DrawingAccess::joint_set_outside_colour | ( | OMC::DrawingVectorJoint * | targetJoint, |
const OMC::DrawingVectorColour * | colour | ||
) |
Sets the left colour of the given stroke.
QList<OMC::DrawingVectorStroke*> OMC::DrawingAccess::stroke_copy | ( | QList< OMC::DrawingVectorStroke *> | strokes, |
OMC::DrawingLayer * | layer | ||
) |
Copies the given stroke and inserts the copy at the end of the given layer.
QList<OMC::DrawingVectorStroke*> OMC::DrawingAccess::stroke_copy | ( | QList< OMC::DrawingVectorStroke *> | strokes, |
OMC::DrawingVectorStroke * | stroke | ||
) |
Copies the given stroke and inserts the copy before the given stroke.
OMC::DrawingVectorStroke* OMC::DrawingAccess::stroke_create | ( | QList< OMC::DrawingVectorStroke *> | strokes, |
OMC::DrawingLayer * | layer | ||
) |
Insert a bunch of new strokes into the layer.
The provided strokes are defined by a OMC::BezierPath and added on the provided layer.
OMC::DrawingVectorStroke* OMC::DrawingAccess::stroke_create | ( | QList< OMC::DrawingVectorStroke *> | strokes, |
OMC::DrawingVectorStroke * | stroke, | ||
OMC::DrawingVectorLineStyle * | = nullptr , |
||
QString | side = QString() , |
||
OMC::DrawingVectorColour * | = nullptr |
||
) |
Insert a bunch of new strokes into the layer of the provided stroke.
The provided strokes are defined by a OMC::BezierPath and added before the provided stroke.
void OMC::DrawingAccess::stroke_erase | ( | QList< OMC::DrawingVectorStroke *> | strokes | ) |
Erases the given stroke from its containing layer.
void OMC::DrawingAccess::stroke_move | ( | QList< OMC::DrawingVectorStroke *> | strokes, |
OMC::DrawingLayer * | layer | ||
) |
Moves the given stroke and inserts it at the end of the given layer.
void OMC::DrawingAccess::stroke_move | ( | QList< OMC::DrawingVectorStroke *> | strokes, |
OMC::DrawingVectorStroke * | layer | ||
) |
Moves the given stroke and inserts it before the given stroke.
void OMC::DrawingAccess::stroke_set_color | ( | OMC::DrawingVectorStroke * | targetStroke, |
const OMC::DrawingVectorColour * | colour, | ||
const QString & | side | ||
) |
Sets the inside or outside colour of the given stroke.
void OMC::DrawingAccess::stroke_set_line_style | ( | OMC::DrawingVectorStroke * | targetStroke, |
OMC::VectorLineStyle * | style | ||
) |
Sets the line style for the provided stroke(s).
void OMC::DrawingAccess::stroke_set_path | ( | OMC::DrawingVectorStroke * | targetStroke, |
OMC::BezierPath * | path | ||
) |
Sets the stroke to the provided bezier path.
void OMC::DrawingAccess::stroke_set_thickness | ( | OMC::DrawingVectorStroke * | targetStroke, |
OMC::VectorThicknessPath * | style | ||
) |
Sets the thickness path for the provided stroke(s).
void OMC::DrawingAccess::stroke_set_tip_tangent | ( | OMC::DrawingVectorStroke * | targetStroke, |
const QString & | side, | ||
const QString & | direction, | ||
double | tangent | ||
) |
Sets the stroke's tangent.
Valid sides are : Right, Left
Valid directions are : From, To
void OMC::DrawingAccess::stroke_set_tip_type | ( | OMC::DrawingVectorStroke * | targetStroke, |
const QString & | direction, | ||
const QString & | type | ||
) |
Sets the stroke's tip type.
Valid directions are : From, To
Valid types are : RoundTip, FlatTip, BevelTip
void OMC::DrawingAccess::vector_begin_operations | ( | OMC::DrawingVectorArtLayer * | ) |
Begins vector operations on the drawing provided.
Only one drawing can be modified at a time. Beginning operations on a drawing will wrap the changes in an undo scope and will accumulate all drawing changes into that one operation.
void OMC::DrawingAccess::vector_layer_copy | ( | const OMC::DrawingVectorLayer * | sourceLayer, |
const OMC::DrawingVectorLayer * | targetLayer | ||
) |
Copies all the strokes from the source layer to the target layer.
OMC::DrawingLayer* OMC::DrawingAccess::vector_layer_create | ( | const QString & | type | ) |
Create a layer at the top of the drawing.
OMC::DrawingLayer* OMC::DrawingAccess::vector_layer_create_above | ( | OMC::DrawingLayer * | layer, |
const QString & | type | ||
) |
Create a layer of the given type above the destination layer.
Available layer types include the following: UNDEFINED_LAYER = 0,
PAINT_LAYER BRUSH_LAYER PEN_LAYER RECTANGLE_LAYER ELLIPSE_LAYER POLYLINE_LAYER STROKE_LAYER CLOSE_GAP_LAYER CENTERLINE_EXTRACTOR_LAYER
// import FLASH_LAYER ILLUSTRATOR_LAYER BITMAP_LAYER US_LINEART_LAYER US_COLORART_LAYER
OMC::DrawingLayer* OMC::DrawingAccess::vector_layer_create_at | ( | uint | idx, |
const QString & | type | ||
) |
Create a layer at the given index, with the given type.
OMC::DrawingLayer* OMC::DrawingAccess::vector_layer_create_under | ( | OMC::DrawingLayer * | layer, |
const QString & | type | ||
) |
Create a layer of the given type under the destination layer.
Available layer types include the following: UNDEFINED_LAYER
PAINT_LAYER
BRUSH_LAYER
PEN_LAYER
RECTANGLE_LAYER
ELLIPSE_LAYER
POLYLINE_LAYER
STROKE_LAYER
CLOSE_GAP_LAYER
CENTERLINE_EXTRACTOR_LAYER
FLASH_LAYER
ILLUSTRATOR_LAYER
BITMAP_LAYER
US_LINEART_LAYER
US_COLORART_LAYER
void OMC::DrawingAccess::vector_layer_erase | ( | const OMC::DrawingVectorLayer * | layer | ) |
Erases all the strokes of the given layer.
void OMC::DrawingAccess::vector_layer_erase | ( | const QList< OMC::DrawingVectorStroke *> | layers | ) |
Erases all the provided strokes.
void OMC::DrawingAccess::vector_layer_erase_at | ( | uint | idx | ) |
Erase the node at the given position.
void OMC::DrawingAccess::vector_layer_move | ( | const OMC::DrawingVectorLayer * | sourceLayer, |
const OMC::DrawingVectorLayer * | targetLayer | ||
) |
Moves all the strokes from the source layer to the target layer.
void OMC::DrawingAccess::vector_layer_paste_at | ( | uint | idx, |
OMC::DrawingLayer * | layer | ||
) |
Copy i_node and all of its children in the current drawing at the given position.
QList<OMC::DrawingVectorLayer*> OMC::DrawingAccess::vector_layers_create | ( | const QVariant & | genericDrawingDefinition | ) |
Creates layers with a generic layer definition object.
Generic layer creation in the style of javascripts "createLayers" function.
The generic description of the vector layers are in the form:
OMC::DrawingVectorLayer* OMC::DrawingAccess::vector_layers_merge | ( | ) |
Merge all layers in the OMC::DrawingVectorArtLayer.
OMC::DrawingVectorLayer* OMC::DrawingAccess::vector_layers_merge | ( | QList< OMC::DrawingVectorLayer *> | layers | ) |
Merge the given layers in the OMC::DrawingVectorArtLayer.
|
readwrite |
True if sticky colours should be respected.
Identifies whether colour opertaions will respect the sticky colours.