Gpencil Operators¶
-
bpy.ops.gpencil.
active_frame_delete
()¶ Delete the active frame for the active Grease Pencil Layer
-
bpy.ops.gpencil.
active_frames_delete_all
()¶ Delete the active frame(s) of all editable Grease Pencil layers
-
bpy.ops.gpencil.
annotate
(mode='DRAW', stroke=None, wait_for_input=True)¶ Make annotations on the active data
Parameters: - mode (enum in ['DRAW', 'DRAW_STRAIGHT', 'DRAW_POLY', 'ERASER'], (optional)) –
Mode, Way to interpret mouse movements
DRAW
Draw Freehand, Draw freehand stroke(s).DRAW_STRAIGHT
Draw Straight Lines, Draw straight line segment(s).DRAW_POLY
Draw Poly Line, Click to place endpoints of straight line segments (connected).ERASER
Eraser, Erase Annotation strokes.
- stroke (
bpy_prop_collection
ofOperatorStrokeElement
, (optional)) – Stroke - wait_for_input (boolean, (optional)) – Wait for Input, Wait for first click instead of painting immediately
- mode (enum in ['DRAW', 'DRAW_STRAIGHT', 'DRAW_POLY', 'ERASER'], (optional)) –
-
bpy.ops.gpencil.
blank_frame_add
(all_layers=False)¶ Insert a blank frame on the current frame (all subsequently existing frames, if any, are shifted right by one frame)
Parameters: all_layers (boolean, (optional)) – All Layers, Create blank frame in all layers, not only active
-
bpy.ops.gpencil.
brush_presets_create
()¶ Create a set of predefined Grease Pencil drawing brushes
-
bpy.ops.gpencil.
color_hide
(unselected=False)¶ Hide selected/unselected Grease Pencil colors
Parameters: unselected (boolean, (optional)) – Unselected, Hide unselected rather than selected colors
-
bpy.ops.gpencil.
color_isolate
(affect_visibility=False)¶ Toggle whether the active color is the only one that is editable and/or visible
Parameters: affect_visibility (boolean, (optional)) – Affect Visibility, In addition to toggling the editability, also affect the visibility
-
bpy.ops.gpencil.
color_lock_all
()¶ Lock all Grease Pencil colors to prevent them from being accidentally modified
-
bpy.ops.gpencil.
color_reveal
()¶ Unhide all hidden Grease Pencil colors
-
bpy.ops.gpencil.
color_select
(deselect=False)¶ Select all Grease Pencil strokes using current color
Parameters: deselect (boolean, (optional)) – Deselect, Unselect strokes
-
bpy.ops.gpencil.
color_unlock_all
()¶ Unlock all Grease Pencil colors so that they can be edited
-
bpy.ops.gpencil.
convert
(type='PATH', use_normalize_weights=True, radius_multiplier=1.0, use_link_strokes=False, timing_mode='FULL', frame_range=100, start_frame=1, use_realtime=False, end_frame=250, gap_duration=0.0, gap_randomness=0.0, seed=0, use_timing_data=False)¶ Convert the active Grease Pencil layer to a new Curve Object
Parameters: - type (enum in ['PATH', 'CURVE', 'POLY'], (optional)) –
Type, Which type of curve to convert to
PATH
Path, Animation path.CURVE
Bezier Curve, Smooth Bezier curve.POLY
Polygon Curve, Bezier curve with straight-line segments (vector handles).
- use_normalize_weights (boolean, (optional)) – Normalize Weight, Normalize weight (set from stroke width)
- radius_multiplier (float in [0, 1000], (optional)) – Radius Fac, Multiplier for the points’ radii (set from stroke width)
- use_link_strokes (boolean, (optional)) – Link Strokes, Whether to link strokes with zero-radius sections of curves
- timing_mode (enum in ['NONE', 'LINEAR', 'FULL', 'CUSTOMGAP'], (optional)) –
Timing Mode, How to use timing data stored in strokes
NONE
No Timing, Ignore timing.LINEAR
Linear, Simple linear timing.FULL
Original, Use the original timing, gaps included.CUSTOMGAP
Custom Gaps, Use the original timing, but with custom gap lengths (in frames).
- frame_range (int in [1, 10000], (optional)) – Frame Range, The duration of evaluation of the path control curve
- start_frame (int in [1, 100000], (optional)) – Start Frame, The start frame of the path control curve
- use_realtime (boolean, (optional)) – Realtime, Whether the path control curve reproduces the drawing in realtime, starting from Start Frame
- end_frame (int in [1, 100000], (optional)) – End Frame, The end frame of the path control curve (if Realtime is not set)
- gap_duration (float in [0, 10000], (optional)) – Gap Duration, Custom Gap mode: (Average) length of gaps, in frames (Note: Realtime value, will be scaled if Realtime is not set)
- gap_randomness (float in [0, 10000], (optional)) – Gap Randomness, Custom Gap mode: Number of frames that gap lengths can vary
- seed (int in [0, 1000], (optional)) – Random Seed, Custom Gap mode: Random generator seed
- use_timing_data (boolean, (optional)) – Has Valid Timing, Whether the converted Grease Pencil layer has valid timing data (internal use)
- type (enum in ['PATH', 'CURVE', 'POLY'], (optional)) –
-
bpy.ops.gpencil.
convert_old_files
(annotation=False)¶ Convert 2.7x grease pencil files to 2.80
Parameters: annotation (boolean, (optional)) – Annotation, Convert to Annotations
-
bpy.ops.gpencil.
copy
()¶ Copy selected Grease Pencil points and strokes
-
bpy.ops.gpencil.
data_add
()¶ Add new Grease Pencil data-block
-
bpy.ops.gpencil.
data_unlink
()¶ Unlink active Annotation data-block
-
bpy.ops.gpencil.
delete
(type='POINTS')¶ Delete selected Grease Pencil strokes, vertices, or frames
Parameters: type (enum in ['POINTS', 'STROKES', 'FRAME'], (optional)) – Type, Method used for deleting Grease Pencil data
POINTS
Points, Delete selected points and split strokes into segments.STROKES
Strokes, Delete selected strokes.FRAME
Frame, Delete active frame.
-
bpy.ops.gpencil.
dissolve
(type='POINTS')¶ Delete selected points without splitting strokes
Parameters: type (enum in ['POINTS', 'BETWEEN', 'UNSELECT'], (optional)) – Type, Method used for dissolving Stroke points
POINTS
Dissolve, Dissolve selected points.BETWEEN
Dissolve Between, Dissolve points between selected points.UNSELECT
Dissolve Unselect, Dissolve all unselected points.
-
bpy.ops.gpencil.
draw
(mode='DRAW', stroke=None, wait_for_input=True, disable_straight=False, disable_fill=False, guide_last_angle=0.0)¶ Draw a new stroke in the active Grease Pencil Object
Parameters: - mode (enum in ['DRAW', 'DRAW_STRAIGHT', 'DRAW_POLY', 'ERASER'], (optional)) –
Mode, Way to interpret mouse movements
DRAW
Draw Freehand, Draw freehand stroke(s).DRAW_STRAIGHT
Draw Straight Lines, Draw straight line segment(s).DRAW_POLY
Draw Poly Line, Click to place endpoints of straight line segments (connected).ERASER
Eraser, Erase Grease Pencil strokes.
- stroke (
bpy_prop_collection
ofOperatorStrokeElement
, (optional)) – Stroke - wait_for_input (boolean, (optional)) – Wait for Input, Wait for first click instead of painting immediately
- disable_straight (boolean, (optional)) – No Straight lines, Disable key for straight lines
- disable_fill (boolean, (optional)) – No Fill Areas, Disable fill to use stroke as fill boundary
- guide_last_angle (float in [-10000, 10000], (optional)) – Angle, Speed guide angle
- mode (enum in ['DRAW', 'DRAW_STRAIGHT', 'DRAW_POLY', 'ERASER'], (optional)) –
-
bpy.ops.gpencil.
duplicate
()¶ Duplicate the selected Grease Pencil strokes
-
bpy.ops.gpencil.
duplicate_move
(GPENCIL_OT_duplicate=None, TRANSFORM_OT_translate=None)¶ Make copies of the selected Grease Pencil strokes and move them
Parameters: - GPENCIL_OT_duplicate (
GPENCIL_OT_duplicate
, (optional)) – Duplicate Strokes, Duplicate the selected Grease Pencil strokes - TRANSFORM_OT_translate (
TRANSFORM_OT_translate
, (optional)) – Move, Move selected items
- GPENCIL_OT_duplicate (
-
bpy.ops.gpencil.
editmode_toggle
(back=False)¶ Enter/Exit edit mode for Grease Pencil strokes
Parameters: back (boolean, (optional)) – Return to Previous Mode, Return to previous mode
-
bpy.ops.gpencil.
extrude
()¶ Extrude the selected Grease Pencil points
-
bpy.ops.gpencil.
extrude_move
(GPENCIL_OT_extrude=None, TRANSFORM_OT_translate=None)¶ Extrude selected points and move them
Parameters: - GPENCIL_OT_extrude (
GPENCIL_OT_extrude
, (optional)) – Extrude Stroke Points, Extrude the selected Grease Pencil points - TRANSFORM_OT_translate (
TRANSFORM_OT_translate
, (optional)) – Move, Move selected items
- GPENCIL_OT_extrude (
-
bpy.ops.gpencil.
fill
(on_back=False)¶ Fill with color the shape formed by strokes
Parameters: on_back (boolean, (optional)) – Draw On Back, Send new stroke to Back
-
bpy.ops.gpencil.
frame_clean_fill
(mode='ACTIVE')¶ Remove ‘no fill’ boundary strokes
Parameters: mode (enum in ['ACTIVE', 'ALL'], (optional)) – Mode
ACTIVE
Active Frame Only, Clean active frame only.ALL
All Frames, Clean all frames in all layers.
-
bpy.ops.gpencil.
frame_clean_loose
(limit=1)¶ Remove loose points
Parameters: limit (int in [1, inf], (optional)) – Limit, Number of points to consider stroke as loose
-
bpy.ops.gpencil.
frame_duplicate
(mode='ACTIVE')¶ Make a copy of the active Grease Pencil Frame
Parameters: mode (enum in ['ACTIVE', 'ALL'], (optional)) – Mode
ACTIVE
Active, Duplicate frame in active layer only.ALL
All, Duplicate active frames in all layers.
-
bpy.ops.gpencil.
generate_weights
(mode='NAME', armature='DEFAULT', ratio=0.1, decay=0.8)¶ Generate automatic weights for armatures (requires armature modifier)
Parameters: - mode (enum in ['NAME', 'AUTO'], (optional)) – Mode
- armature (enum in ['DEFAULT'], (optional)) – Armature, Armature to use
- ratio (float in [0, 2], (optional)) – Ratio, Ratio between bone length and influence radius
- decay (float in [0, 1], (optional)) – Decay, Factor to reduce influence depending of distance to bone axis
-
bpy.ops.gpencil.
guide_rotate
(increment=True, angle=0.0)¶ Rotate guide angle
Parameters: - increment (boolean, (optional)) – Increment, Increment angle
- angle (float in [-10000, 10000], (optional)) – Angle, Guide angle
-
bpy.ops.gpencil.
hide
(unselected=False)¶ Hide selected/unselected Grease Pencil layers
Parameters: unselected (boolean, (optional)) – Unselected, Hide unselected rather than selected layers
-
bpy.ops.gpencil.
interpolate
(shift=0.0)¶ Interpolate grease pencil strokes between frames
Parameters: shift (float in [-1, 1], (optional)) – Shift, Bias factor for which frame has more influence on the interpolated strokes
-
bpy.ops.gpencil.
interpolate_reverse
()¶ Remove breakdown frames generated by interpolating between two Grease Pencil frames
-
bpy.ops.gpencil.
interpolate_sequence
()¶ Generate ‘in-betweens’ to smoothly interpolate between Grease Pencil frames
-
bpy.ops.gpencil.
layer_add
()¶ Add new layer or note for the active data-block
-
bpy.ops.gpencil.
layer_change
(layer='DEFAULT')¶ Change active Grease Pencil layer
Parameters: layer (enum in ['DEFAULT'], (optional)) – Grease Pencil Layer
-
bpy.ops.gpencil.
layer_duplicate
()¶ Make a copy of the active Grease Pencil layer
-
bpy.ops.gpencil.
layer_duplicate_object
(object="", mode='ALL')¶ Make a copy of the active Grease Pencil layer to new object
Parameters: - object (string, (optional, never None)) – Object, Name of the destination object
- mode (enum in ['ALL', 'ACTIVE'], (optional)) – Mode
-
bpy.ops.gpencil.
layer_isolate
(affect_visibility=False)¶ Toggle whether the active layer is the only one that can be edited and/or visible
Parameters: affect_visibility (boolean, (optional)) – Affect Visibility, In addition to toggling the editability, also affect the visibility
-
bpy.ops.gpencil.
layer_merge
()¶ Merge the current layer with the layer below
-
bpy.ops.gpencil.
layer_move
(type='UP')¶ Move the active Grease Pencil layer up/down in the list
Parameters: type (enum in ['UP', 'DOWN'], (optional)) – Type
-
bpy.ops.gpencil.
layer_remove
()¶ Remove active Grease Pencil layer
-
bpy.ops.gpencil.
lock_all
()¶ Lock all Grease Pencil layers to prevent them from being accidentally modified
-
bpy.ops.gpencil.
lock_layer
()¶ Lock and hide any color not used in any layer
-
bpy.ops.gpencil.
move_to_layer
(layer=0)¶ Move selected strokes to another layer
Parameters: layer (int in [0, inf], (optional)) – Grease Pencil Layer
-
bpy.ops.gpencil.
paintmode_toggle
(back=False)¶ Enter/Exit paint mode for Grease Pencil strokes
Parameters: back (boolean, (optional)) – Return to Previous Mode, Return to previous mode
-
bpy.ops.gpencil.
paste
(type='ACTIVE')¶ Paste previously copied strokes to active layer or to original layer
Parameters: type (enum in ['ACTIVE', 'LAYER'], (optional)) – Type
-
bpy.ops.gpencil.
primitive
(edges=4, type='BOX', wait_for_input=True)¶ Create predefined grease pencil stroke shapes
Parameters: - edges (int in [2, 128], (optional)) – Edges, Number of polygon edges
- type (enum in ['BOX', 'LINE', 'CIRCLE', 'ARC', 'CURVE'], (optional)) – Type, Type of shape
- wait_for_input (boolean, (optional)) – Wait for Input
-
bpy.ops.gpencil.
reproject
(type='VIEW')¶ Reproject the selected strokes from the current viewpoint as if they had been newly drawn (e.g. to fix problems from accidental 3D cursor movement or accidental viewport changes, or for matching deforming geometry)
Parameters: type (enum in ['FRONT', 'SIDE', 'TOP', 'VIEW', 'SURFACE', 'CURSOR'], (optional)) – Projection Type
FRONT
Front, Reproject the strokes using the X-Z plane.SIDE
Side, Reproject the strokes using the Y-Z plane.TOP
Top, Reproject the strokes using the X-Y plane.VIEW
View, Reproject the strokes to end up on the same plane, as if drawn from the current viewpoint using ‘Cursor’ Stroke Placement.SURFACE
Surface, Reproject the strokes on to the scene geometry, as if drawn using ‘Surface’ placement.CURSOR
Cursor, Reproject the strokes using the orientation of 3D cursor.
-
bpy.ops.gpencil.
reveal
(select=True)¶ Show all Grease Pencil layers
Parameters: select (boolean, (optional)) – Select
-
bpy.ops.gpencil.
sculpt_paint
(stroke=None, wait_for_input=True)¶ Apply tweaks to strokes by painting over the strokes
Parameters: - stroke (
bpy_prop_collection
ofOperatorStrokeElement
, (optional)) – Stroke - wait_for_input (boolean, (optional)) – Wait for Input, Enter a mini ‘sculpt-mode’ if enabled, otherwise, exit after drawing a single stroke
- stroke (
-
bpy.ops.gpencil.
sculptmode_toggle
(back=False)¶ Enter/Exit sculpt mode for Grease Pencil strokes
Parameters: back (boolean, (optional)) – Return to Previous Mode, Return to previous mode
-
bpy.ops.gpencil.
select
(extend=False, deselect=False, toggle=False, deselect_all=False, entire_strokes=False, location=(0, 0))¶ Select Grease Pencil strokes and/or stroke points
Parameters: - extend (boolean, (optional)) – Extend, Extend selection instead of deselecting everything first
- deselect (boolean, (optional)) – Deselect, Remove from selection
- toggle (boolean, (optional)) – Toggle Selection, Toggle the selection
- deselect_all (boolean, (optional)) – Deselect On Nothing, Deselect all when nothing under the cursor
- entire_strokes (boolean, (optional)) – Entire Strokes, Select entire strokes instead of just the nearest stroke vertex
- location (int array of 2 items in [-inf, inf], (optional)) – Location, Mouse location
-
bpy.ops.gpencil.
select_all
(action='TOGGLE')¶ Change selection of all Grease Pencil strokes currently visible
Parameters: action (enum in ['TOGGLE', 'SELECT', 'DESELECT', 'INVERT'], (optional)) – Action, Selection action to execute
TOGGLE
Toggle, Toggle selection for all elements.SELECT
Select, Select all elements.DESELECT
Deselect, Deselect all elements.INVERT
Invert, Invert selection of all elements.
-
bpy.ops.gpencil.
select_alternate
(unselect_ends=True)¶ Select alternative points in same strokes as already selected points
Parameters: unselect_ends (boolean, (optional)) – Unselect Ends, Do not select the first and last point of the stroke
-
bpy.ops.gpencil.
select_box
(xmin=0, xmax=0, ymin=0, ymax=0, wait_for_input=True, mode='SET')¶ Select Grease Pencil strokes within a rectangular region
Parameters: - xmin (int in [-inf, inf], (optional)) – X Min
- xmax (int in [-inf, inf], (optional)) – X Max
- ymin (int in [-inf, inf], (optional)) – Y Min
- ymax (int in [-inf, inf], (optional)) – Y Max
- wait_for_input (boolean, (optional)) – Wait for Input
- mode (enum in ['SET', 'ADD', 'SUB', 'XOR', 'AND'], (optional)) –
Mode
SET
Set, Set a new selection.ADD
Extend, Extend existing selection.SUB
Subtract, Subtract existing selection.XOR
Difference, Inverts existing selection.AND
Intersect, Intersect existing selection.
-
bpy.ops.gpencil.
select_circle
(x=0, y=0, radius=25, wait_for_input=True, mode='SET')¶ Select Grease Pencil strokes using brush selection
Parameters: - x (int in [-inf, inf], (optional)) – X
- y (int in [-inf, inf], (optional)) – Y
- radius (int in [1, inf], (optional)) – Radius
- wait_for_input (boolean, (optional)) – Wait for Input
- mode (enum in ['SET', 'ADD', 'SUB'], (optional)) –
Mode
SET
Set, Set a new selection.ADD
Extend, Extend existing selection.SUB
Subtract, Subtract existing selection.
-
bpy.ops.gpencil.
select_first
(only_selected_strokes=False, extend=False)¶ Select first point in Grease Pencil strokes
Parameters: - only_selected_strokes (boolean, (optional)) – Selected Strokes Only, Only select the first point of strokes that already have points selected
- extend (boolean, (optional)) – Extend, Extend selection instead of deselecting all other selected points
-
bpy.ops.gpencil.
select_grouped
(type='LAYER')¶ Select all strokes with similar characteristics
Parameters: type (enum in ['LAYER', 'MATERIAL'], (optional)) – Type
LAYER
Layer, Shared layers.MATERIAL
Material, Shared materials.
-
bpy.ops.gpencil.
select_lasso
(mode='SET', path=None)¶ Select Grease Pencil strokes using lasso selection
Parameters: - mode (enum in ['SET', 'ADD', 'SUB', 'XOR', 'AND'], (optional)) –
Mode
SET
Set, Set a new selection.ADD
Extend, Extend existing selection.SUB
Subtract, Subtract existing selection.XOR
Difference, Inverts existing selection.AND
Intersect, Intersect existing selection.
- path (
bpy_prop_collection
ofOperatorMousePath
, (optional)) – Path
- mode (enum in ['SET', 'ADD', 'SUB', 'XOR', 'AND'], (optional)) –
-
bpy.ops.gpencil.
select_last
(only_selected_strokes=False, extend=False)¶ Select last point in Grease Pencil strokes
Parameters: - only_selected_strokes (boolean, (optional)) – Selected Strokes Only, Only select the last point of strokes that already have points selected
- extend (boolean, (optional)) – Extend, Extend selection instead of deselecting all other selected points
-
bpy.ops.gpencil.
select_less
()¶ Shrink sets of selected Grease Pencil points
-
bpy.ops.gpencil.
select_linked
()¶ Select all points in same strokes as already selected points
-
bpy.ops.gpencil.
select_more
()¶ Grow sets of selected Grease Pencil points
-
bpy.ops.gpencil.
selection_opacity_toggle
()¶ Hide/Unhide selected points for Grease Pencil strokes setting alpha factor
-
bpy.ops.gpencil.
selectmode_toggle
(mode=0)¶ Set selection mode for Grease Pencil strokes
Parameters: mode (int in [0, 2], (optional)) – Select mode, Select mode
-
bpy.ops.gpencil.
set_active_material
()¶ Set the selected stroke material as the active material
-
bpy.ops.gpencil.
snap_cursor_to_selected
()¶ Snap cursor to center of selected points
-
bpy.ops.gpencil.
snap_to_cursor
(use_offset=True)¶ Snap selected points/strokes to the cursor
Parameters: use_offset (boolean, (optional)) – With Offset, Offset the entire stroke instead of selected points only
-
bpy.ops.gpencil.
snap_to_grid
()¶ Snap selected points to the nearest grid points
-
bpy.ops.gpencil.
stroke_apply_thickness
()¶ Apply the thickness change of the layer to its strokes
-
bpy.ops.gpencil.
stroke_arrange
(direction='UP')¶ Arrange selected strokes up/down in the drawing order of the active layer
Parameters: direction (enum in ['TOP', 'UP', 'DOWN', 'BOTTOM'], (optional)) – Direction
-
bpy.ops.gpencil.
stroke_caps_set
(type='TOGGLE')¶ Change Stroke caps mode (rounded or flat)
Parameters: type (enum in ['TOGGLE', 'START', 'END', 'TOGGLE'], (optional)) – Type
TOGGLE
Both.START
Start.END
End.TOGGLE
Default, Set as default rounded.
-
bpy.ops.gpencil.
stroke_change_color
(material="")¶ Move selected strokes to active material
Parameters: material (string, (optional, never None)) – Material, Name of the material
-
bpy.ops.gpencil.
stroke_cutter
(path=None)¶ Select section and cut
Parameters: path ( bpy_prop_collection
ofOperatorMousePath
, (optional)) – Path
-
bpy.ops.gpencil.
stroke_cyclical_set
(type='TOGGLE', geometry=False)¶ Close or open the selected stroke adding an edge from last to first point
Parameters: - type (enum in ['CLOSE', 'OPEN', 'TOGGLE'], (optional)) – Type
- geometry (boolean, (optional)) – Create Geometry, Create new geometry for closing stroke
-
bpy.ops.gpencil.
stroke_flip
()¶ Change direction of the points of the selected strokes
-
bpy.ops.gpencil.
stroke_join
(type='JOIN', leave_gaps=False)¶ Join selected strokes (optionally as new stroke)
Parameters: - type (enum in ['JOIN', 'JOINCOPY'], (optional)) – Type
- leave_gaps (boolean, (optional)) – Leave Gaps, Leave gaps between joined strokes instead of linking them
-
bpy.ops.gpencil.
stroke_lock_color
()¶ Lock any color not used in any selected stroke
-
bpy.ops.gpencil.
stroke_merge
(mode='STROKE', back=False, additive=False, cyclic=False, clear_point=False, clear_stroke=False)¶ Create a new stroke with the selected stroke points
Parameters: - mode (enum in ['STROKE', 'POINT'], (optional)) – Mode
- back (boolean, (optional)) – Draw on Back, Draw new stroke below all previous strokes
- additive (boolean, (optional)) – Additive Drawing, Add to previous drawing
- cyclic (boolean, (optional)) – Cyclic, Close new stroke
- clear_point (boolean, (optional)) – Dissolve Points, Dissolve old selected points
- clear_stroke (boolean, (optional)) – Delete Strokes, Delete old selected strokes
-
bpy.ops.gpencil.
stroke_merge_by_distance
(threshold=0.001, use_unselected=False)¶ Merge points by distance
Parameters: - threshold (float in [0, 100], (optional)) – Threshold
- use_unselected (boolean, (optional)) – Unselected, Use whole stroke, not only selected points
-
bpy.ops.gpencil.
stroke_sample
(length=0.1)¶ Sample stroke points to predefined segment length
Parameters: length (float in [0, 100], (optional)) – Length
-
bpy.ops.gpencil.
stroke_separate
(mode='POINT')¶ Separate the selected strokes or layer in a new grease pencil object
Parameters: mode (enum in ['POINT', 'STROKE', 'LAYER'], (optional)) – Mode
POINT
Selected Points, Separate the selected points.STROKE
Selected Strokes, Separate the selected strokes.LAYER
Active Layer, Separate the strokes of the current layer.
-
bpy.ops.gpencil.
stroke_simplify
(factor=0.0)¶ Simplify selected stroked reducing number of points
Parameters: factor (float in [0, 100], (optional)) – Factor
-
bpy.ops.gpencil.
stroke_simplify_fixed
(step=1)¶ Simplify selected stroked reducing number of points using fixed algorithm
Parameters: step (int in [1, 100], (optional)) – Steps, Number of simplify steps
-
bpy.ops.gpencil.
stroke_smooth
(repeat=1, factor=0.5, only_selected=True, smooth_position=True, smooth_thickness=True, smooth_strength=False, smooth_uv=False)¶ Smooth selected strokes
Parameters: - repeat (int in [1, 50], (optional)) – Repeat
- factor (float in [0, 2], (optional)) – Factor
- only_selected (boolean, (optional)) – Selected Points, Smooth only selected points in the stroke
- smooth_position (boolean, (optional)) – Position
- smooth_thickness (boolean, (optional)) – Thickness
- smooth_strength (boolean, (optional)) – Strength
- smooth_uv (boolean, (optional)) – UV
-
bpy.ops.gpencil.
stroke_split
()¶ Split selected points as new stroke on same frame
-
bpy.ops.gpencil.
stroke_subdivide
(number_cuts=1, factor=0.0, repeat=1, only_selected=True, smooth_position=True, smooth_thickness=True, smooth_strength=False, smooth_uv=False)¶ Subdivide between continuous selected points of the stroke adding a point half way between them
Parameters: - number_cuts (int in [1, 10], (optional)) – Number of Cuts
- factor (float in [0, 2], (optional)) – Smooth
- repeat (int in [1, 10], (optional)) – Repeat
- only_selected (boolean, (optional)) – Selected Points, Smooth only selected points in the stroke
- smooth_position (boolean, (optional)) – Position
- smooth_thickness (boolean, (optional)) – Thickness
- smooth_strength (boolean, (optional)) – Strength
- smooth_uv (boolean, (optional)) – UV
-
bpy.ops.gpencil.
stroke_trim
()¶ Trim selected stroke to first loop or intersection
-
bpy.ops.gpencil.
unlock_all
()¶ Unlock all Grease Pencil layers so that they can be edited
-
bpy.ops.gpencil.
vertex_group_assign
()¶ Assign the selected vertices to the active vertex group
-
bpy.ops.gpencil.
vertex_group_deselect
()¶ Deselect all selected vertices assigned to the active vertex group
-
bpy.ops.gpencil.
vertex_group_invert
()¶ Invert weights to the active vertex group
-
bpy.ops.gpencil.
vertex_group_normalize
()¶ Normalize weights to the active vertex group
-
bpy.ops.gpencil.
vertex_group_normalize_all
(lock_active=True)¶ Normalize all weights of all vertex groups, so that for each vertex, the sum of all weights is 1.0
Parameters: lock_active (boolean, (optional)) – Lock Active, Keep the values of the active group while normalizing others
-
bpy.ops.gpencil.
vertex_group_remove_from
()¶ Remove the selected vertices from active or all vertex group(s)
-
bpy.ops.gpencil.
vertex_group_select
()¶ Select all the vertices assigned to the active vertex group
-
bpy.ops.gpencil.
vertex_group_smooth
(factor=0.5, repeat=1)¶ Smooth weights to the active vertex group
Parameters: - factor (float in [0, 1], (optional)) – Factor
- repeat (int in [1, 10000], (optional)) – Iterations
-
bpy.ops.gpencil.
weightmode_toggle
(back=False)¶ Enter/Exit weight paint mode for Grease Pencil strokes
Parameters: back (boolean, (optional)) – Return to Previous Mode, Return to previous mode