user: Provide the full official documentation entry for Bpy.Ops.Grease Pencil, preserving all code examples.

assistant: nge the display order of the selected strokes Parameters : direction (enum in [ 'TOP' , 'UP' , 'DOWN' , 'BOTTOM' ], (optional)) – Direction bpy.ops.grease_pencil. reproject ( * , type = 'VIEW' , keep_original = False , offset = 0.0 ) ¶ 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. keep_original ( boolean , ( optional ) ) – Keep Original, Keep original strokes and create a copy before reprojecting offset ( float in [ 0 , 10 ] , ( optional ) ) – Surface Offset bpy.ops.grease_pencil. reset_uvs ( ) ¶ Reset UV transformation to default values bpy.ops.grease_pencil. sculpt_paint ( * , stroke = None , mode = 'NORMAL' , pen_flip = False ) ¶ Sculpt strokes in the active Grease Pencil object Parameters : stroke ( bpy_prop_collection of OperatorStrokeElement , (optional)) – Stroke mode (enum in [ 'NORMAL' , 'INVERT' , 'SMOOTH' , 'ERASE' ], (optional)) – Stroke Mode, Action taken when a paint stroke is made NORMAL Regular – Apply brush normally. INVERT Invert – Invert action of brush for duration of stroke. SMOOTH Smooth – Switch brush to smooth mode for duration of stroke. ERASE Erase – Switch brush to erase mode for duration of stroke. pen_flip ( boolean , ( optional ) ) – Pen Flip, Whether a tablet’s eraser mode is being used bpy.ops.grease_pencil. 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.grease_pencil. select_all ( * , action = 'TOGGLE' ) ¶ (De)select all visible strokes 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.grease_pencil. select_alternate ( * , deselect_ends = False ) ¶ Select alternated points in strokes with already selected points Parameters : deselect_ends ( boolean , ( optional ) ) – Deselect Ends, (De)select the first and last point of each stroke bpy.ops.grease_pencil. select_ends ( * , amount_start = 0 , amount_end = 1 ) ¶ Select end points of strokes Parameters : amount_start ( int in [ 0 , inf ] , ( optional ) ) – Amount Start, Number of points to select from the start amount_end ( int in [ 0 , inf ] , ( optional ) ) – Amount End, Number of points to select from the end bpy.ops.grease_pencil. select_less ( ) ¶ Shrink the selection by one point bpy.ops.grease_pencil. select_linked ( ) ¶ Select all points in curves with any point selection bpy.ops.grease_pencil. select_more ( ) ¶ Grow the selection by one point bpy.ops.grease_pencil. select_random ( * , ratio = 0.5 , seed = 0 , action = 'SELECT' ) ¶ Selects random points from the current strokes selection Parameters : ratio ( float in [ 0 , 1 ] , ( optional ) ) – Ratio, Portion of items to select randomly seed ( int in [ 0 , inf ] , ( optional ) ) – Random Seed, Seed for the random number generator action (enum in [ 'SELECT' , 'DESELECT' ], (optional)) – Action, Selection action to execute SELECT Select – Select all elements. DESELECT Deselect – Deselect all elements. bpy.ops.grease_pencil. select_similar ( * , mode = 'LAYER' , threshold = 0.1 ) ¶ Select all strokes with similar characteristics Parameters : mode (enum in [ 'LAYER' , 'MATERIAL' , 'VERTEX_COLOR' , 'RADIUS' , 'OPACITY' ], (optional)) – Mode threshold ( float in [ 0 , inf ] , ( optional ) ) – Threshold bpy.ops.grease_pencil. separate ( * , mode = 'SELECTED' ) ¶ Separate the selected geometry into a new Grease Pencil object Parameters : mode (enum in [ 'SELECTED' , 'MATERIAL' , 'LAYER' ], (optional)) – Mode SELECTED Selection – Separate selected geometry. MATERIAL By Material – Separate by material. LAYER By Layer – Separate by layer. bpy.ops.grease_pencil. set_active_material ( ) ¶ Set the selected stroke material as the active material bpy.ops.grease_pencil. set_corner_type ( * , corner_type = 'SHARP' , miter_angle = 0.785398 ) ¶ Set the corner type of the selected points Parameters : corner_type (enum in [ 'ROUND' , 'FLAT' , 'SHARP' ], (optional)) – Corner Type miter_angle ( float in [ 0 , 3.14159 ] , ( optional ) ) – Miter Cut Angle, All corners sharper than the Miter angle will be cut flat bpy.ops.grease_pencil. set_curve_resolution ( * , resolution = 12 ) ¶ Set resolution of selected curves Parameters : resolution ( int in [ 0 , 10000 ] , ( optional ) ) – Resolution, The resolution to use for each curve segment bpy.ops.grease_pencil. set_curve_type ( * , type = 'POLY' , use_handles = False ) ¶ Set type of selected curves Parameters : type (enum in Curves Type Items , (optional)) – Type, Curve type use_handles ( boolean , ( optional ) ) – Handles, Take handle information into account in the conversion bpy.ops.grease_pencil. set_handle_type ( * , type = 'AUTO' ) ¶ Set the handle type for Bézier curves Parameters : type (enum in [ 'AUTO' , 'VECTOR' , 'ALIGN' , 'FREE_ALIGN' , 'TOGGLE_FREE_ALIGN' ], (optional)) – Type AUTO Auto – The location is automatically calculated to be smooth. VECTOR Vector – The location is calculated to point to the next/previous control point. ALIGN Align – The location is constrained to point in the opposite direction as the other handle. FREE_ALIGN Free – The handle can be moved anywhere, and does not influence the point’s other handle. TOGGLE_FREE_ALIGN Toggle Free/Align – Replace Free handles with Align, and all Align with Free handles. bpy.ops.grease_pencil. set_material ( * , slot = 'DEFAULT' ) ¶ Set active material Parameters : slot (enum in [ 'DEFAULT' ], (optional)) – Material Slot bpy.ops.grease_pencil. set_selection_mode ( * , mode = 'POINT' ) ¶ Change the selection mode for Grease Pencil strokes Parameters : mode (enum in Grease Pencil Selectmode Items , (optional)) – Mode bpy.ops.grease_pencil. set_start_point ( ) ¶ Select which point is the beginning of the curve bpy.ops.grease_pencil. set_uniform_opacity ( * , opacity_stroke = 1.0 , opacity_fill = 0.5 ) ¶ Set all stroke points to same opacity Parameters : opacity_stroke ( float in [ 0 , 1 ] , ( optional ) ) – Stroke Opacity opacity_fill ( float in [ 0 , 1 ] , ( optional ) ) – Fill Opacity bpy.ops.grease_pencil. set_uniform_thickness ( * , thickness = 0.1 ) ¶ Set all stroke points to same thickness Parameters : thickness ( float in [ 0 , 1000 ] , ( optional ) ) – Thickness, Thickness bpy.ops.grease_pencil. snap_cursor_to_selected ( ) ¶ Snap cursor to center of selected points bpy.ops.grease_pencil. 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.grease_pencil. snap_to_grid ( ) ¶ Snap selected points to the nearest grid points bpy.ops.grease_pencil. stroke_material_set ( * , material = '' ) ¶ Assign the active material slot to the selected strokes Parameters : material ( string , ( optional , never None ) ) – Material, Name of the material bpy.ops.grease_pencil. 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.grease_pencil. stroke_reset_vertex_color ( * , mode = 'BOTH' ) ¶ Reset vertex color for all or selected strokes Parameters : mode (enum in [ 'STROKE' , 'FILL' , 'BOTH' ], (optional)) – Mode bpy.ops.grease_pencil. stroke_simplify ( * , factor = 0.01 , length = 0.05 , distance = 0.01 , steps = 1 , mode = 'FIXED' ) ¶ Simplify selected strokes Parameters : factor ( float in [ 0 , 100 ] , ( optional ) ) – Factor length ( float in [ 0.01 , 100 ] , ( optional ) ) – Length distance ( float in [ 0 , 100 ] , ( optional ) ) – Distance steps ( int in [ 0 , 50 ] , ( optional ) ) – Steps mode (enum in [ 'FIXED' , 'ADAPTIVE' , 'SAMPLE' , 'MERGE' ], (optional)) – Mode, Method used for simplifying stroke points FIXED Fixed – Delete alternating vertices in the stroke, except extremes. ADAPTIVE Adaptive – Use a Ramer-Douglas-Peucker algorithm to simplify the stroke preserving main shape. SAMPLE Sample – Re-sample the stroke with segments of the specified length. MERGE Merge – Simplify the stroke by merging vertices closer than a given distance. bpy.ops.grease_pencil. stroke_smooth ( * , iterations = 10 , factor = 1.0 , smooth_ends = False , keep_shape = False , smooth_position = True , smooth_radius = True , smooth_opacity = False ) ¶ Smooth selected strokes Parameters : iterations ( int in [ 1 , 100 ] , ( optional ) ) – Iterations factor ( float in [ 0 , 1 ] , ( optional ) ) – Factor smooth_ends ( boolean , ( optional ) ) – Smooth Endpoints keep_shape ( boolean , ( optional ) ) – Keep Shape smooth_position ( boolean , ( optional ) ) – Position smooth_radius ( boolean , ( optional ) ) – Radius smooth_opacity ( boolean , ( optional ) ) – Opacity bpy.ops.grease_pencil. stroke_split ( ) ¶ Split selected points to a new stroke bpy.ops.grease_pencil. stroke_subdivide ( * , number_cuts = 1 , only_selected = True ) ¶ Subdivide between continuous selected points of the stroke adding a point half way between them Parameters : number_cuts ( int in [ 1 , 32 ] , ( optional ) ) – Number of Cuts only_selected ( boolean , ( optional ) ) – Selected Points, Smooth only selected points in the stroke bpy.ops.grease_pencil. stroke_subdivide_smooth ( * , GREASE_PENCIL_OT_stroke_subdivide = None , GREASE_PENCIL_OT_stroke_smooth = None ) ¶ Subdivide strokes and smooth them Parameters : GREASE_PENCIL_OT_stroke_subdivide ( GREASE_PENCIL_OT_stroke_subdivide , (optional)) – Subdivide Stroke, Subdivide between continuous selected points of the stroke adding a point half way between them GREASE_PENCIL_OT_stroke_smooth ( GREASE_PENCIL_OT_stroke_smooth , (optional)) – Smooth Stroke, Smooth selected strokes bpy.ops.grease_pencil. stroke_switch_direction ( ) ¶ Change direction of the points of the selected strokes bpy.ops.grease_pencil. stroke_trim ( * , path = None , use_smooth_stroke = False , smooth_stroke_factor = 0.75 , smooth_stroke_radius = 35 ) ¶ Delete stroke points in between intersecting strokes Parameters : path ( bpy_prop_collection of OperatorMousePath , (optional)) – Path use_smooth_stroke ( boolean , ( optional ) ) – Stabilize Stroke, Selection lags behind mouse and follows a smoother path smooth_stroke_factor ( float in [ 0.5 , 0.99 ] , ( optional ) ) – Smooth Stroke Factor, Higher values gives a smoother stroke smooth_stroke_radius ( int in [ 10 , 200 ] , ( optional ) ) – Smooth Stroke Radius, Minimum distance from last point before selection continues bpy.ops.grease_pencil. texture_gradient ( * , xstart = 0 , xend = 0 , ystart = 0 , yend = 0 , flip = False , cursor = 5 ) ¶ Draw a line to set the fill material gradient for the selected strokes Parameters : xstart ( int in [ -inf , inf ] , ( optional ) ) – X Start xend ( int in [ -inf , inf ] , ( optional ) ) – X End ystart ( int in [ -inf , inf ] , ( optional ) ) – Y Start yend ( int in [ -inf , inf ] , ( optional ) ) – Y End flip ( boolean , ( optional ) ) – Flip cursor ( int in [ 0 , inf ] , ( optional ) ) – Cursor, Mouse cursor style to use during the modal operator bpy.ops.grease_pencil. trace_image ( * , target = 'NEW' , radius = 0.01 , threshold = 0.5 , turnpolicy = 'MINORITY' , mode = 'SINGLE' , use_current_frame = True , frame_number = 0 ) ¶ Extract Grease Pencil strokes from image Parameters : target (enum in [ 'NEW' , 'SELECTED' ], (optional)) – Target Object, Target Grease Pencil radius ( float in [ 0.001 , 1 ] , ( optional ) ) – Radius threshold ( float in [ 0 , 1 ] , ( optional ) ) – Color Threshold, Determine the lightness threshold above which strokes are generated turnpolicy (enum in [ 'FOREGROUND' , 'BACKGROUND' , 'LEFT' , 'RIGHT' , 'MINORITY' , 'MAJORITY' , 'RANDOM' ], (optional)) – Turn Policy, Determines how to resolve ambiguities during decomposition of bitmaps into paths FOREGROUND Foreground – Prefers to connect foreground components. BACKGROUND Background – Prefers to connect background components. LEFT Left – Always take a left turn. RIGHT Right – Always take a right turn. MINORITY Minority – Prefers to connect the color that occurs least frequently in the local neighborhood of the current position. MAJORITY Majority – Prefers to connect the color that occurs most frequently in the local neighborhood of the current position. RANDOM Random – Choose pseudo-randomly. mode (enum in [ 'SINGLE' , 'SEQUENCE' ], (optional)) – Mode, Determines if trace simple image or full sequence SINGLE Single – Trace the current frame of the image. SEQUENCE Sequence – Trace full sequence. use_current_frame ( boolean , ( optional ) ) – Start At Current Frame, Trace Image starting in current image frame frame_number ( int in [ 0 , 9999 ] , ( optional ) ) – Trace Frame, Used to trace only one frame of the image sequence, set to zero to trace all bpy.ops.grease_pencil. vertex_brush_stroke ( * , stroke = None , mode = 'NORMAL' , pen_flip = False ) ¶ Draw on vertex colors in the active Grease Pencil object Parameters : stroke ( bpy_prop_collection of OperatorStrokeElement , (optional)) – Stroke mode (enum in [ 'NORMAL' , 'INVERT' , 'SMOOTH' , 'ERASE' ], (optional)) – Stroke Mode, Action taken when a paint stroke is made NORMAL Regular – Apply brush normally. INVERT Invert – Invert action of brush for duration of stroke. SMOOTH Smooth – Switch brush to smooth mode for duration of stroke. ERASE Erase – Switch brush to erase mode for duration of stroke. pen_flip ( boolean , ( optional ) ) – Pen Flip, Whether a tablet’s eraser mode is being used bpy.ops.grease_pencil. vertex_color_brightness_contrast ( * , mode = 'BOTH' , brightness = 0.0 , contrast = 0.0 ) ¶ Adjust vertex color brightness/contrast Parameters : mode (enum in [ 'STROKE' , 'FILL' , 'BOTH' ], (optional)) – Mode brightness ( float in [ -1 , 1 ] , ( optional ) ) – Brightness contrast ( float in [ -1 , 1 ] , ( optional ) ) – Contrast bpy.ops.grease_pencil. vertex_color_hsv ( * , mode = 'BOTH' , h = 0.5 , s = 1.0 , v = 1.0 ) ¶ Adjust vertex color HSV values Parameters : mode (enum in [ 'STROKE' , 'FILL' , 'BOTH' ], (optional)) – Mode h ( float in [ 0 , 1 ] , ( optional ) ) – Hue s ( float in [ 0 , 2 ] , ( optional ) ) – Saturation v ( float in [ 0 , 2 ] , ( optional ) ) – Value bpy.ops.grease_pencil. vertex_color_invert ( * , mode = 'BOTH' ) ¶ Invert RGB values Parameters : mode (enum in [ 'STROKE' , 'FILL' , 'BOTH' ], (optional)) – Mode bpy.ops.grease_pencil. vertex_color_levels ( * , mode = 'BOTH' , offset = 0.0 , gain = 1.0 ) ¶ Adjust levels of vertex colors Parameters : mode (enum in [ 'STROKE' , 'FILL' , 'BOTH' ], (optional)) – Mode offset ( float in [ -1 , 1 ] , ( optional ) ) – Offset, Value to add to colors gain ( float in [ 0 , inf ] , ( optional ) ) – Gain, Value to multiply colors by bpy.ops.grease_pencil. vertex_color_set ( * , mode = 'BOTH' , factor = 1.0 ) ¶ Set active color to all selected vertex Parameters : mode (enum in [ 'STROKE' , 'FILL' , 'BOTH' ], (optional)) – Mode factor ( float in [ 0 , 1 ] , ( optional ) ) – Factor, Mix Factor bpy.ops.grease_pencil. vertex_group_normalize ( ) ¶ Normalize weights of the active vertex group bpy.ops.grease_pencil. vertex_group_normalize_all ( * , lock_active = True ) ¶ Normalize the 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.grease_pencil. vertex_group_smooth ( * , factor = 0.5 , repeat = 1 ) ¶ Smooth the weights of the active vertex group Parameters : factor ( float in [ 0 , 1 ] , ( optional ) ) – Factor repeat ( int in [ 1 , 10000 ] , ( optional ) ) – Iterations bpy.ops.grease_pencil. vertexmode_toggle ( * , back = False ) ¶ Enter/Exit vertex paint mode for Grease Pencil strokes Parameters : back ( boolean , ( optional ) ) – Return to Previous Mode, Return to previous mode bpy.ops.grease_pencil. weight_brush_stroke ( * , stroke = None , mode = 'NORMAL' , pen_flip = False ) ¶ Draw weight on stroke points in the active Grease Pencil object Parameters : stroke ( bpy_prop_collection of OperatorStrokeElement , (optional)) – Stroke mode (enum in [ 'NORMAL' , 'INVERT' , 'SMOOTH' , 'ERASE' ], (optional)) – Stroke Mode, Action taken when a paint stroke is made NORMAL Regular – Apply brush normally. INVERT Invert – Invert action of brush for duration of stroke. SMOOTH Smooth – Switch brush to smooth mode for duration of stroke. ERASE Erase – Switch brush to erase mode for duration of stroke. pen_flip ( boolean , ( optional ) ) – Pen Flip, Whether a tablet’s eraser mode is being used bpy.ops.grease_pencil. weight_invert ( ) ¶ Invert the weight of active vertex group bpy.ops.grease_pencil. weight_sample ( ) ¶ Set the weight of the Draw tool to the weight of the vertex under the mouse cursor bpy.ops.grease_pencil. weight_toggle_direction ( ) ¶ Toggle Add/Subtract for the weight paint draw tool bpy.ops.grease_pencil. weightmode_toggle ( * , back = False ) ¶ Enter/Exit weight paint mo