Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/annotate_draw.c11
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c1
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c25
-rw-r--r--source/blender/editors/gpencil/gpencil_add_blank.c1
-rw-r--r--source/blender/editors/gpencil/gpencil_add_lineart.c1
-rw-r--r--source/blender/editors/gpencil/gpencil_add_monkey.c8
-rw-r--r--source/blender/editors/gpencil/gpencil_add_stroke.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c18
-rw-r--r--source/blender/editors/gpencil/gpencil_intern.h126
-rw-r--r--source/blender/editors/gpencil/gpencil_sculpt_paint.c1
-rw-r--r--source/blender/editors/gpencil/gpencil_trace.h32
-rw-r--r--source/blender/editors/gpencil/gpencil_trace_utils.c32
-rw-r--r--source/blender/editors/gpencil/gpencil_undo.c3
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c185
15 files changed, 159 insertions, 289 deletions
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c
index 7795eed7c21..3705ea38e11 100644
--- a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -788,7 +788,6 @@ static void annotation_draw_data_all(Scene *scene,
/* ----- Annotation Sketches Drawing API ------ */
-/* draw grease-pencil sketches to specified 2d-view that uses ibuf corrections */
void ED_annotation_draw_2dimage(const bContext *C)
{
wmWindowManager *wm = CTX_wm_manager(C);
@@ -857,13 +856,6 @@ void ED_annotation_draw_2dimage(const bContext *C)
annotation_draw_data_all(scene, gpd, offsx, offsy, sizex, sizey, CFRA, dflag, area->spacetype);
}
-/**
- * Draw grease-pencil sketches to specified 2d-view
- * assuming that matrices are already set correctly.
- *
- * \note This gets called twice - first time with onlyv2d=true to draw 'canvas' strokes,
- * second time with onlyv2d=false for screen-aligned strokes.
- */
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
{
wmWindowManager *wm = CTX_wm_manager(C);
@@ -900,9 +892,6 @@ void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
scene, gpd, 0, 0, region->winx, region->winy, CFRA, dflag, area->spacetype);
}
-/* draw annotations sketches to specified 3d-view assuming that matrices are already set
- * correctly NOTE: this gets called twice - first time with only3d=true to draw 3d-strokes,
- * second time with only3d=false for screen-aligned strokes */
void ED_annotation_draw_view3d(
Scene *scene, struct Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
{
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 2160aaf705f..6f63529298c 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -412,7 +412,6 @@ static void gpencil_draw_strokes(tGPDdraw *tgpw)
/* ----- General Drawing ------ */
-/* wrapper to draw strokes for filling operator */
void ED_gpencil_draw_fill(tGPDdraw *tgpw)
{
gpencil_draw_strokes(tgpw);
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index fbdb7c8e520..046b3088360 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -55,7 +55,6 @@
/* ***************************************** */
/* Generics - Loopers */
-/* Loops over the gp-frames for a gp-layer, and applies the given callback */
bool ED_gpencil_layer_frames_looper(bGPDlayer *gpl,
Scene *scene,
bool (*gpf_cb)(bGPDframe *, Scene *))
@@ -80,7 +79,6 @@ bool ED_gpencil_layer_frames_looper(bGPDlayer *gpl,
/* ****************************************** */
/* Data Conversion Tools */
-/* make a listing all the gp-frames in a layer as cfraelems */
void ED_gpencil_layer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, bool onlysel)
{
CfraElem *ce;
@@ -106,7 +104,6 @@ void ED_gpencil_layer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, bool onlys
/* ***************************************** */
/* Selection Tools */
-/* check if one of the frames in this layer is selected */
bool ED_gpencil_layer_frame_select_check(const bGPDlayer *gpl)
{
/* error checking */
@@ -145,7 +142,6 @@ static void gpencil_frame_select(bGPDframe *gpf, short select_mode)
}
}
-/* set all/none/invert select (like above, but with SELECT_* modes) */
void ED_gpencil_select_frames(bGPDlayer *gpl, short select_mode)
{
/* error checking */
@@ -159,7 +155,6 @@ void ED_gpencil_select_frames(bGPDlayer *gpl, short select_mode)
}
}
-/* set all/none/invert select */
void ED_gpencil_layer_frame_select_set(bGPDlayer *gpl, short mode)
{
/* error checking */
@@ -171,7 +166,6 @@ void ED_gpencil_layer_frame_select_set(bGPDlayer *gpl, short mode)
ED_gpencil_select_frames(gpl, mode);
}
-/* select the frame in this layer that occurs on this frame (there should only be one at most) */
void ED_gpencil_select_frame(bGPDlayer *gpl, int selx, short select_mode)
{
bGPDframe *gpf;
@@ -187,7 +181,6 @@ void ED_gpencil_select_frame(bGPDlayer *gpl, int selx, short select_mode)
}
}
-/* select the frames in this layer that occur within the bounds specified */
void ED_gpencil_layer_frames_select_box(bGPDlayer *gpl, float min, float max, short select_mode)
{
if (gpl == NULL) {
@@ -202,7 +195,6 @@ void ED_gpencil_layer_frames_select_box(bGPDlayer *gpl, float min, float max, sh
}
}
-/* select the frames in this layer that occur within the lasso/circle region specified */
void ED_gpencil_layer_frames_select_region(KeyframeEditData *ked,
bGPDlayer *gpl,
short tool,
@@ -239,7 +231,6 @@ void ED_gpencil_layer_frames_select_region(KeyframeEditData *ked,
/* ***************************************** */
/* Frame Editing Tools */
-/* Delete selected frames */
bool ED_gpencil_layer_frames_delete(bGPDlayer *gpl)
{
bool changed = false;
@@ -260,7 +251,6 @@ bool ED_gpencil_layer_frames_delete(bGPDlayer *gpl)
return changed;
}
-/* Duplicate selected frames from given gp-layer */
void ED_gpencil_layer_frames_duplicate(bGPDlayer *gpl)
{
/* error checking */
@@ -284,11 +274,6 @@ void ED_gpencil_layer_frames_duplicate(bGPDlayer *gpl)
}
}
-/**
- * Set keyframe type for selected frames from given gp-layer
- *
- * \param type: The type of keyframe (#eBezTriple_KeyframeType) to set selected frames to.
- */
void ED_gpencil_layer_frames_keytype_set(bGPDlayer *gpl, short type)
{
if (gpl == NULL) {
@@ -320,7 +305,6 @@ static int gpencil_anim_copy_firstframe = 999999999;
static int gpencil_anim_copy_lastframe = -999999999;
static int gpencil_anim_copy_cfra = 0;
-/* This function frees any MEM_calloc'ed copy/paste buffer data */
void ED_gpencil_anim_copybuf_free(void)
{
BKE_gpencil_free_layers(&gpencil_anim_copybuf);
@@ -331,11 +315,6 @@ void ED_gpencil_anim_copybuf_free(void)
gpencil_anim_copy_cfra = 0;
}
-/* This function adds data to the copy/paste buffer, freeing existing data first
- * Only the selected GP-layers get their selected keyframes copied.
- *
- * Returns whether the copy operation was successful or not
- */
bool ED_gpencil_anim_copybuf_copy(bAnimContext *ac)
{
ListBase anim_data = {NULL, NULL};
@@ -404,7 +383,6 @@ bool ED_gpencil_anim_copybuf_copy(bAnimContext *ac)
return true;
}
-/* Pastes keyframes from buffer, and reports success */
bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const short offset_mode)
{
ListBase anim_data = {NULL, NULL};
@@ -547,7 +525,6 @@ static bool gpencil_frame_snap_nearmarker(bGPDframe *gpf, Scene *scene)
return false;
}
-/* snap selected frames to ... */
void ED_gpencil_layer_snap_frames(bGPDlayer *gpl, Scene *scene, short mode)
{
switch (mode) {
@@ -648,8 +625,6 @@ static bool gpencil_frame_mirror_marker(bGPDframe *gpf, Scene *scene)
return false;
}
-/* mirror selected gp-frames on... */
-/* TODO: mirror over a specific time */
void ED_gpencil_layer_mirror_frames(bGPDlayer *gpl, Scene *scene, short mode)
{
switch (mode) {
diff --git a/source/blender/editors/gpencil/gpencil_add_blank.c b/source/blender/editors/gpencil/gpencil_add_blank.c
index 3aa16e54597..4e4650e575c 100644
--- a/source/blender/editors/gpencil/gpencil_add_blank.c
+++ b/source/blender/editors/gpencil/gpencil_add_blank.c
@@ -76,7 +76,6 @@ static const ColorTemplate gp_stroke_material_black = {
/* ***************************************************************** */
/* Blank API */
-/* Add a Simple empty object with one layer and one color. */
void ED_gpencil_create_blank(bContext *C, Object *ob, float UNUSED(mat[4][4]))
{
Main *bmain = CTX_data_main(C);
diff --git a/source/blender/editors/gpencil/gpencil_add_lineart.c b/source/blender/editors/gpencil/gpencil_add_lineart.c
index ac0da0ad1db..aad2d978bfb 100644
--- a/source/blender/editors/gpencil/gpencil_add_lineart.c
+++ b/source/blender/editors/gpencil/gpencil_add_lineart.c
@@ -83,7 +83,6 @@ static const ColorTemplate gp_stroke_material_black = {
/* ***************************************************************** */
/* LineArt API */
-/* Add a Simple LineArt setup. */
void ED_gpencil_create_lineart(bContext *C, Object *ob)
{
Main *bmain = CTX_data_main(C);
diff --git a/source/blender/editors/gpencil/gpencil_add_monkey.c b/source/blender/editors/gpencil/gpencil_add_monkey.c
index 8d60ef3ed12..3b952dbe7da 100644
--- a/source/blender/editors/gpencil/gpencil_add_monkey.c
+++ b/source/blender/editors/gpencil/gpencil_add_monkey.c
@@ -39,13 +39,6 @@
#include "ED_gpencil.h"
-/**
- * Populate stroke with point data from data buffers.
- * \param gps: Grease pencil stroke
- * \param array: Flat array of point data values. Each entry has #GP_PRIM_DATABUF_SIZE values.
- * \param totpoints: Total of points
- * \param mat: 4x4 transform matrix to transform points into the right coordinate space.
- */
void ED_gpencil_stroke_init_data(bGPDstroke *gps,
const float *array,
const int totpoints,
@@ -842,7 +835,6 @@ static const ColorTemplate gp_monkey_pct_pupils = {
/* ***************************************************************** */
/* Monkey API */
-/* add a 2D Suzanne (original model created by Matias Mendiola) */
void ED_gpencil_create_monkey(bContext *C, Object *ob, float mat[4][4])
{
Main *bmain = CTX_data_main(C);
diff --git a/source/blender/editors/gpencil/gpencil_add_stroke.c b/source/blender/editors/gpencil/gpencil_add_stroke.c
index 73c4e64dd9a..d9e652392b4 100644
--- a/source/blender/editors/gpencil/gpencil_add_stroke.c
+++ b/source/blender/editors/gpencil/gpencil_add_stroke.c
@@ -204,8 +204,6 @@ static const ColorTemplate gp_stroke_material_grey = {
/* ***************************************************************** */
/* Stroke API */
-/* Add a Simple stroke with colors
- * (original design created by Daniel M. Lara and Matias Mendiola). */
void ED_gpencil_create_stroke(bContext *C, Object *ob, float mat[4][4])
{
Main *bmain = CTX_data_main(C);
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index db2104dfdf9..bea8126cfcc 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -2809,7 +2809,6 @@ static void gpencil_joined_fix_animdata_cb(ID *id, FCurve *fcu, void *user_data)
}
}
-/* join objects called from OBJECT_OT_join */
int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
@@ -3697,7 +3696,6 @@ void GPENCIL_OT_materials_copy_to_object(wmOperatorType *ot)
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}
-/* Parent GPencil object to Lattice */
bool ED_gpencil_add_lattice_modifier(const bContext *C,
ReportList *reports,
Object *ob,
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 3fc08096ab5..a4931ed6007 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -1381,11 +1381,6 @@ void GPENCIL_OT_extrude(wmOperatorType *ot)
* from several different layers into a single layer.
* \{ */
-/**
- * list of #bGPDstroke instances
- *
- * \note is exposed within the editors/gpencil module so that other tools can use it too.
- */
ListBase gpencil_strokes_copypastebuf = {NULL, NULL};
/* Hash for hanging on to all the colors used by strokes in the buffer
@@ -1429,7 +1424,6 @@ static void gpencil_strokes_copypastebuf_colors_name_to_material_free(GHash *nam
BLI_ghash_free(name_to_ma, MEM_freeN, NULL);
}
-/* Free copy/paste buffer data */
void ED_gpencil_strokes_copybuf_free(void)
{
bGPDstroke *gps, *gpsn;
@@ -1462,10 +1456,6 @@ void ED_gpencil_strokes_copybuf_free(void)
gpencil_strokes_copypastebuf.first = gpencil_strokes_copypastebuf.last = NULL;
}
-/**
- * Ensure that destination datablock has all the colors the pasted strokes need.
- * Helper function for copy-pasting strokes
- */
GHash *gpencil_copybuf_validate_colormap(bContext *C)
{
Main *bmain = CTX_data_main(C);
@@ -2654,7 +2644,6 @@ static int gpencil_delete_selected_points(bContext *C)
return OPERATOR_CANCELLED;
}
-/* simple wrapper to external call */
int gpencil_delete_selected_point_wrap(bContext *C)
{
return gpencil_delete_selected_points(C);
@@ -3319,10 +3308,6 @@ static bool gpencil_cyclical_set_curve_edit_poll_property(const bContext *C,
return true;
}
-/**
- * Similar to #CURVE_OT_cyclic_toggle or #MASK_OT_cyclic_toggle, but with
- * option to force opened/closed strokes instead of just toggle behavior.
- */
void GPENCIL_OT_stroke_cyclical_set(wmOperatorType *ot)
{
PropertyRNA *prop;
@@ -3434,9 +3419,6 @@ static int gpencil_stroke_caps_set_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-/**
- * Change Stroke caps mode Rounded or Flat
- */
void GPENCIL_OT_stroke_caps_set(wmOperatorType *ot)
{
static const EnumPropertyItem toggle_type[] = {
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index cfc1257204b..c1ebf72dd55 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -106,6 +106,10 @@ typedef struct tGPDdraw {
} tGPDdraw;
/* Modal Operator Drawing Callbacks ------------------------ */
+
+/**
+ * Wrapper to draw strokes for filling operator.
+ */
void ED_gpencil_draw_fill(struct tGPDdraw *tgpw);
/* ***************************************************** */
@@ -231,28 +235,74 @@ typedef struct tGPDprimitive {
} tGPDprimitive;
+/**
+ * Check whether a given stroke segment is inside a circular brush
+ *
+ * \param mval: The current screen-space coordinates (midpoint) of the brush
+ * \param rad: The radius of the brush
+ *
+ * \param x0, y0: The screen-space x and y coordinates of the start of the stroke segment
+ * \param x1, y1: The screen-space x and y coordinates of the end of the stroke segment
+ */
bool gpencil_stroke_inside_circle(const float mval[2], int rad, int x0, int y0, int x1, int y1);
+/**
+ * Init settings for stroke point space conversions
+ *
+ * \param r_gsc: [out] The space conversion settings struct, populated with necessary params
+ */
void gpencil_point_conversion_init(struct bContext *C, GP_SpaceConversion *r_gsc);
+/**
+ * Convert a Grease Pencil coordinate (i.e. can be 2D or 3D) to screen-space (2D)
+ *
+ * \param[out] r_x: The screen-space x-coordinate of the point
+ * \param[out] r_y: The screen-space y-coordinate of the point
+ *
+ * \warning This assumes that the caller has already checked
+ * whether the stroke in question can be drawn.
+ */
void gpencil_point_to_xy(const GP_SpaceConversion *gsc,
const struct bGPDstroke *gps,
const struct bGPDspoint *pt,
int *r_x,
int *r_y);
+/**
+ * Convert a Grease Pencil coordinate (i.e. can be 2D or 3D) to screen-space (2D).
+ *
+ * Just like #gpencil_point_to_xy(), except the resulting coordinates are floats not ints.
+ * Use this version to solve "stair-step" artifacts which may arise when
+ * round-tripping the calculations.
+ *
+ * \param r_x: The screen-space x-coordinate of the point.
+ * \param r_y: The screen-space y-coordinate of the point.
+ *
+ * \warning This assumes that the caller has already checked
+ * whether the stroke in question can be drawn.
+ */
void gpencil_point_to_xy_fl(const GP_SpaceConversion *gsc,
const bGPDstroke *gps,
const bGPDspoint *pt,
float *r_x,
float *r_y);
+/**
+ * Convert point to parent space
+ *
+ * \param pt: Original point
+ * \param diff_mat: Matrix with the difference between original parent matrix
+ * \param[out] r_pt: Pointer to new point after apply matrix
+ */
void gpencil_point_to_parent_space(const bGPDspoint *pt,
const float diff_mat[4][4],
bGPDspoint *r_pt);
/**
* Change points position relative to parent object
*/
+/**
+ * Change position relative to parent object
+ */
void gpencil_apply_parent(struct Depsgraph *depsgraph,
struct Object *obact,
bGPDlayer *gpl,
@@ -260,22 +310,52 @@ void gpencil_apply_parent(struct Depsgraph *depsgraph,
/**
* Change point position relative to parent object
*/
+/**
+ * Change point position relative to parent object
+ */
void gpencil_apply_parent_point(struct Depsgraph *depsgraph,
struct Object *obact,
bGPDlayer *gpl,
bGPDspoint *pt);
+/**
+ * generic based on gpencil_point_to_xy_fl
+ */
void gpencil_point_3d_to_xy(const GP_SpaceConversion *gsc,
const short flag,
const float pt[3],
float xy[2]);
+/**
+ * Project screen-space coordinates to 3D-space
+ *
+ * For use with editing tools where it is easier to perform the operations in 2D,
+ * and then later convert the transformed points back to 3D.
+ *
+ * \param screen_co: The screen-space 2D coordinates to convert to
+ * \param r_out: The resulting 3D coordinates of the input point
+ *
+ * \note We include this as a utility function, since the standard method
+ * involves quite a few steps, which are invariably always the same
+ * for all GPencil operations. So, it's nicer to just centralize these.
+ *
+ * \warning Assumes that it is getting called in a 3D view only.
+ */
bool gpencil_point_xy_to_3d(const GP_SpaceConversion *gsc,
struct Scene *scene,
const float screen_co[2],
float r_out[3]);
/* helper to convert 2d to 3d */
+
+/**
+ * Convert #tGPspoint (temporary 2D/screen-space point data used by GP modal operators)
+ * to 3D coordinates.
+ *
+ * \param point2D: The screen-space 2D point data to convert.
+ * \param depth: Depth array (via #ED_view3d_depth_read_cached()).
+ * \param r_out: The resulting 2D point data.
+ */
void gpencil_stroke_convertcoords_tpoint(struct Scene *scene,
struct ARegion *region,
struct Object *ob,
@@ -286,35 +366,71 @@ void gpencil_stroke_convertcoords_tpoint(struct Scene *scene,
/* Poll Callbacks ------------------------------------ */
/* gpencil_utils.c */
+/**
+ * Poll callback for adding data/layers - special.
+ */
bool gpencil_add_poll(struct bContext *C);
+/**
+ * Poll callback for checking if there is an active layer.
+ */
bool gpencil_active_layer_poll(struct bContext *C);
+/**
+ * Poll callback for checking if there is an active brush.
+ */
bool gpencil_active_brush_poll(struct bContext *C);
bool gpencil_brush_create_presets_poll(bContext *C);
/* Copy/Paste Buffer --------------------------------- */
/* gpencil_edit.c */
+/**
+ * list of #bGPDstroke instances
+ *
+ * \note is exposed within the editors/gpencil module so that other tools can use it too.
+ */
extern ListBase gpencil_strokes_copypastebuf;
/* Build a map for converting between old color-names and destination-color-refs. */
+/**
+ * Ensure that destination datablock has all the colors the pasted strokes need.
+ * Helper function for copy-pasting strokes
+ */
struct GHash *gpencil_copybuf_validate_colormap(struct bContext *C);
/* Stroke Editing ------------------------------------ */
+/**
+ * Simple wrapper to external call.
+ */
int gpencil_delete_selected_point_wrap(bContext *C);
+/**
+ * Subdivide a stroke once, by adding a point half way between each pair of existing points
+ * \param gpd: Datablock
+ * \param gps: Stroke data
+ * \param subdivide: Number of times to subdivide
+ */
void gpencil_subdivide_stroke(bGPdata *gpd, bGPDstroke *gps, const int subdivide);
/* Layers Enums -------------------------------------- */
+/**
+ * Just existing layers.
+ */
const struct EnumPropertyItem *ED_gpencil_layers_enum_itemf(struct bContext *C,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
bool *r_free);
+/**
+ * Existing + Option to add/use new layer.
+ */
const struct EnumPropertyItem *ED_gpencil_layers_with_new_enum_itemf(struct bContext *C,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
bool *r_free);
+/**
+ * Just existing Materials.
+ */
const struct EnumPropertyItem *ED_gpencil_material_enum_itemf(struct bContext *C,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
@@ -407,6 +523,9 @@ void GPENCIL_OT_stroke_editcurve_set_handle_type(struct wmOperatorType *ot);
/* stroke sculpting -- */
+/**
+ * Also used for weight paint.
+ */
void GPENCIL_OT_sculpt_paint(struct wmOperatorType *ot);
void GPENCIL_OT_weight_paint(struct wmOperatorType *ot);
@@ -476,7 +595,14 @@ enum {
void GPENCIL_OT_stroke_arrange(struct wmOperatorType *ot);
void GPENCIL_OT_stroke_change_color(struct wmOperatorType *ot);
void GPENCIL_OT_stroke_apply_thickness(struct wmOperatorType *ot);
+/**
+ * Similar to #CURVE_OT_cyclic_toggle or #MASK_OT_cyclic_toggle, but with
+ * option to force opened/closed strokes instead of just toggle behavior.
+ */
void GPENCIL_OT_stroke_cyclical_set(struct wmOperatorType *ot);
+/**
+ * Change Stroke caps mode Rounded or Flat
+ */
void GPENCIL_OT_stroke_caps_set(struct wmOperatorType *ot);
void GPENCIL_OT_stroke_join(struct wmOperatorType *ot);
void GPENCIL_OT_stroke_flip(struct wmOperatorType *ot);
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index e9a6beab798..32ad8c98950 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -2134,7 +2134,6 @@ static int gpencil_sculpt_brush_modal(bContext *C, wmOperator *op, const wmEvent
return OPERATOR_RUNNING_MODAL;
}
-/* Also used for weight paint. */
void GPENCIL_OT_sculpt_paint(wmOperatorType *ot)
{
/* identifiers */
diff --git a/source/blender/editors/gpencil/gpencil_trace.h b/source/blender/editors/gpencil/gpencil_trace.h
index 25d8dac2734..7c62288f65d 100644
--- a/source/blender/editors/gpencil/gpencil_trace.h
+++ b/source/blender/editors/gpencil/gpencil_trace.h
@@ -59,16 +59,48 @@ struct bGPDframe;
#define GPENCIL_TRACE_MODE_SINGLE 0
#define GPENCIL_TRACE_MODE_SEQUENCE 1
+/**
+ * Print trace bitmap for debugging.
+ * \param f: Output handle. Use `stderr` for printing
+ * \param bm: Trace bitmap
+ */
void ED_gpencil_trace_bitmap_print(FILE *f, const potrace_bitmap_t *bm);
+/**
+ * Return new un-initialized trace bitmap
+ * \param w: Width in pixels
+ * \param h: Height in pixels
+ * \return Trace bitmap
+ */
potrace_bitmap_t *ED_gpencil_trace_bitmap_new(int32_t w, int32_t h);
+/**
+ * Free a trace bitmap
+ * \param bm: Trace bitmap
+ */
void ED_gpencil_trace_bitmap_free(const potrace_bitmap_t *bm);
+/**
+ * Invert the given bitmap (Black to White)
+ * \param bm: Trace bitmap
+ */
void ED_gpencil_trace_bitmap_invert(const potrace_bitmap_t *bm);
+/**
+ * Convert image to BW bitmap for tracing
+ * \param ibuf: ImBuf of the image
+ * \param bm: Trace bitmap
+ */
void ED_gpencil_trace_image_to_bitmap(struct ImBuf *ibuf,
const potrace_bitmap_t *bm,
const float threshold);
+/**
+ * Convert Potrace Bitmap to Grease Pencil strokes
+ * \param st: Data with traced data
+ * \param ob: Target grease pencil object
+ * \param offset: Offset to center
+ * \param scale: Scale of the output
+ * \param sample: Sample distance to distribute points
+ */
void ED_gpencil_trace_data_to_strokes(struct Main *bmain,
potrace_state_t *st,
struct Object *ob,
diff --git a/source/blender/editors/gpencil/gpencil_trace_utils.c b/source/blender/editors/gpencil/gpencil_trace_utils.c
index 970afc3ff6b..f5690904fcf 100644
--- a/source/blender/editors/gpencil/gpencil_trace_utils.c
+++ b/source/blender/editors/gpencil/gpencil_trace_utils.c
@@ -46,11 +46,6 @@
#include "gpencil_trace.h"
-/**
- * Print trace bitmap for debugging.
- * \param f: Output handle. Use `stderr` for printing
- * \param bm: Trace bitmap
- */
void ED_gpencil_trace_bitmap_print(FILE *f, const potrace_bitmap_t *bm)
{
int32_t x, y;
@@ -77,12 +72,6 @@ void ED_gpencil_trace_bitmap_print(FILE *f, const potrace_bitmap_t *bm)
}
}
-/**
- * Return new un-initialized trace bitmap
- * \param w: Width in pixels
- * \param h: Height in pixels
- * \return Trace bitmap
- */
potrace_bitmap_t *ED_gpencil_trace_bitmap_new(int32_t w, int32_t h)
{
potrace_bitmap_t *bm;
@@ -104,10 +93,6 @@ potrace_bitmap_t *ED_gpencil_trace_bitmap_new(int32_t w, int32_t h)
return bm;
}
-/**
- * Free a trace bitmap
- * \param bm: Trace bitmap
- */
void ED_gpencil_trace_bitmap_free(const potrace_bitmap_t *bm)
{
if (bm != NULL) {
@@ -116,10 +101,6 @@ void ED_gpencil_trace_bitmap_free(const potrace_bitmap_t *bm)
MEM_SAFE_FREE(bm);
}
-/**
- * Invert the given bitmap (Black to White)
- * \param bm: Trace bitmap
- */
void ED_gpencil_trace_bitmap_invert(const potrace_bitmap_t *bm)
{
int32_t dy = bm->dy;
@@ -162,11 +143,6 @@ static void pixel_at_index(const ImBuf *ibuf, const int32_t idx, float r_col[4])
}
}
-/**
- * Convert image to BW bitmap for tracing
- * \param ibuf: ImBuf of the image
- * \param bm: Trace bitmap
- */
void ED_gpencil_trace_image_to_bitmap(ImBuf *ibuf,
const potrace_bitmap_t *bm,
const float threshold)
@@ -231,14 +207,6 @@ static void add_bezier(bGPDstroke *gps,
}
}
-/**
- * Convert Potrace Bitmap to Grease Pencil strokes
- * \param st: Data with traced data
- * \param ob: Target grease pencil object
- * \param offset: Offset to center
- * \param scale: Scale of the output
- * \param sample: Sample distance to distribute points
- */
void ED_gpencil_trace_data_to_strokes(Main *bmain,
potrace_state_t *st,
Object *ob,
diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c
index 99b8b672327..ec70febc80c 100644
--- a/source/blender/editors/gpencil/gpencil_undo.c
+++ b/source/blender/editors/gpencil/gpencil_undo.c
@@ -62,9 +62,6 @@ int ED_gpencil_session_active(void)
return (BLI_listbase_is_empty(&undo_nodes) == false);
}
-/**
- * \param step: eUndoStepDir.
- */
int ED_undo_gpencil_step(bContext *C, const int step)
{
bGPdata **gpd_ptr = NULL, *new_gpd = NULL;
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 99cf2b52df7..f082af979a1 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -96,11 +96,6 @@
/* ******************************************************** */
/* Context Wrangling... */
-/**
- * Get pointer to active Grease Pencil data-block,
- * and an RNA-pointer to trace back to whatever owns it,
- * when context info is not available.
- */
bGPdata **ED_gpencil_data_get_pointers_direct(ScrArea *area, Object *ob, PointerRNA *r_ptr)
{
/* if there's an active area, check if the particular editor may
@@ -130,11 +125,6 @@ bGPdata **ED_gpencil_data_get_pointers_direct(ScrArea *area, Object *ob, Pointer
return NULL;
}
-/**
- * Get pointer to active Grease Pencil data-block for annotations,
- * and an RNA-pointer to trace back to whatever owns it,
- * when context info is not available.
- */
bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id,
ScrArea *area,
Scene *scene,
@@ -233,10 +223,6 @@ bGPdata **ED_annotation_data_get_pointers_direct(ID *screen_id,
return NULL;
}
-/**
- * Get pointer to active Grease Pencil data-block,
- * and an RNA-pointer to trace back to whatever owns it.
- */
bGPdata **ED_gpencil_data_get_pointers(const bContext *C, PointerRNA *r_ptr)
{
ScrArea *area = CTX_wm_area(C);
@@ -245,10 +231,6 @@ bGPdata **ED_gpencil_data_get_pointers(const bContext *C, PointerRNA *r_ptr)
return ED_gpencil_data_get_pointers_direct(area, ob, r_ptr);
}
-/**
- * Get pointer to active Grease Pencil data-block,
- * and an RNA-pointer to trace back to whatever owns it.
- */
bGPdata **ED_annotation_data_get_pointers(const bContext *C, PointerRNA *r_ptr)
{
ID *screen_id = (ID *)CTX_wm_screen(C);
@@ -259,23 +241,18 @@ bGPdata **ED_annotation_data_get_pointers(const bContext *C, PointerRNA *r_ptr)
}
/* -------------------------------------------------------- */
-/* Get the active Grease Pencil data-block, when context is not available */
bGPdata *ED_gpencil_data_get_active_direct(ScrArea *area, Object *ob)
{
bGPdata **gpd_ptr = ED_gpencil_data_get_pointers_direct(area, ob, NULL);
return (gpd_ptr) ? *(gpd_ptr) : NULL;
}
-/* Get the active Grease Pencil data-block, when context is not available */
bGPdata *ED_annotation_data_get_active_direct(ID *screen_id, ScrArea *area, Scene *scene)
{
bGPdata **gpd_ptr = ED_annotation_data_get_pointers_direct(screen_id, area, scene, NULL);
return (gpd_ptr) ? *(gpd_ptr) : NULL;
}
-/**
- * Get the active Grease Pencil data-block
- */
bGPdata *ED_gpencil_data_get_active(const bContext *C)
{
Object *ob = CTX_data_active_object(C);
@@ -285,24 +262,12 @@ bGPdata *ED_gpencil_data_get_active(const bContext *C)
return ob->data;
}
-/**
- * Get the active Grease Pencil data-block
- * \note This is the original (#G.main) copy of the data-block, stored in files.
- * Do not use for reading evaluated copies of GP Objects data.
- */
bGPdata *ED_annotation_data_get_active(const bContext *C)
{
bGPdata **gpd_ptr = ED_annotation_data_get_pointers(C, NULL);
return (gpd_ptr) ? *(gpd_ptr) : NULL;
}
-/**
- * Get the evaluated copy of the active Grease Pencil data-block (where applicable)
- * - For the 3D View (i.e. "GP Objects"), this gives the evaluated copy of the GP data-block
- * (i.e. a copy of the active GP data-block for the active object, where modifiers have been
- * applied). This is needed to correctly work with "Copy-on-Write".
- * - For all other editors (i.e. "GP Annotations"), this just gives the active data-block
- * like for #ED_gpencil_data_get_active()
- */
+
bGPdata *ED_gpencil_data_get_active_evaluated(const bContext *C)
{
ScrArea *area = CTX_wm_area(C);
@@ -316,10 +281,6 @@ bGPdata *ED_gpencil_data_get_active_evaluated(const bContext *C)
/* -------------------------------------------------------- */
-/**
- * Utility to check whether the r_ptr output of ED_gpencil_data_get_pointers()
- * is for annotation usage.
- */
bool ED_gpencil_data_owner_is_annotation(PointerRNA *owner_ptr)
{
/* Key Assumption: If the pointer is an object, we're dealing with a GP Object's data.
@@ -330,7 +291,6 @@ bool ED_gpencil_data_owner_is_annotation(PointerRNA *owner_ptr)
/* ******************************************************** */
/* Keyframe Indicator Checks */
-/* Check whether there's an active GP keyframe on the current frame */
bool ED_gpencil_has_keyframe_v3d(Scene *UNUSED(scene), Object *ob, int cfra)
{
if (ob && ob->data && (ob->type == OB_GPENCIL)) {
@@ -351,7 +311,6 @@ bool ED_gpencil_has_keyframe_v3d(Scene *UNUSED(scene), Object *ob, int cfra)
/* ******************************************************** */
/* Poll Callbacks */
-/* poll callback for adding data/layers - special */
bool gpencil_add_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
@@ -363,7 +322,6 @@ bool gpencil_add_poll(bContext *C)
return (gpd != NULL);
}
-/* poll callback for checking if there is an active layer */
bool gpencil_active_layer_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
@@ -376,7 +334,6 @@ bool gpencil_active_layer_poll(bContext *C)
return (gpl != NULL);
}
-/* poll callback for checking if there is an active brush */
bool gpencil_active_brush_poll(bContext *C)
{
ToolSettings *ts = CTX_data_tool_settings(C);
@@ -391,7 +348,6 @@ bool gpencil_active_brush_poll(bContext *C)
/* Dynamic Enums of GP Layers */
/* NOTE: These include an option to create a new layer and use that... */
-/* Just existing layers */
const EnumPropertyItem *ED_gpencil_layers_enum_itemf(bContext *C,
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
@@ -429,7 +385,6 @@ const EnumPropertyItem *ED_gpencil_layers_enum_itemf(bContext *C,
return item;
}
-/* Existing + Option to add/use new layer */
const EnumPropertyItem *ED_gpencil_layers_with_new_enum_itemf(bContext *C,
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
@@ -482,7 +437,6 @@ const EnumPropertyItem *ED_gpencil_layers_with_new_enum_itemf(bContext *C,
return item;
}
-/* Just existing Materials */
const EnumPropertyItem *ED_gpencil_material_enum_itemf(bContext *C,
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
@@ -519,15 +473,6 @@ const EnumPropertyItem *ED_gpencil_material_enum_itemf(bContext *C,
/* ******************************************************** */
/* Brush Tool Core */
-/**
- * Check whether a given stroke segment is inside a circular brush
- *
- * \param mval: The current screen-space coordinates (midpoint) of the brush
- * \param rad: The radius of the brush
- *
- * \param x0, y0: The screen-space x and y coordinates of the start of the stroke segment
- * \param x1, y1: The screen-space x and y coordinates of the end of the stroke segment
- */
bool gpencil_stroke_inside_circle(const float mval[2], int rad, int x0, int y0, int x1, int y1)
{
/* simple within-radius check for now */
@@ -577,8 +522,6 @@ bool ED_gpencil_layer_has_selected_stroke(const bGPDlayer *gpl, const bool is_mu
/* ******************************************************** */
/* Stroke Validity Testing */
-/* Check whether given stroke can be edited given the supplied context */
-/* TODO: do we need additional flags for screenspace vs dataspace? */
bool ED_gpencil_stroke_can_use_direct(const ScrArea *area, const bGPDstroke *gps)
{
/* sanity check */
@@ -603,14 +546,12 @@ bool ED_gpencil_stroke_can_use_direct(const ScrArea *area, const bGPDstroke *gps
return true;
}
-/* Check whether given stroke can be edited in the current context */
bool ED_gpencil_stroke_can_use(const bContext *C, const bGPDstroke *gps)
{
ScrArea *area = CTX_wm_area(C);
return ED_gpencil_stroke_can_use_direct(area, gps);
}
-/* Check whether given stroke can be edited for the current color */
bool ED_gpencil_stroke_material_editable(Object *ob, const bGPDlayer *gpl, const bGPDstroke *gps)
{
/* check if the color is editable */
@@ -628,7 +569,6 @@ bool ED_gpencil_stroke_material_editable(Object *ob, const bGPDlayer *gpl, const
return true;
}
-/* Check whether given stroke is visible for the current material. */
bool ED_gpencil_stroke_material_visible(Object *ob, const bGPDstroke *gps)
{
/* check if the color is editable */
@@ -646,11 +586,6 @@ bool ED_gpencil_stroke_material_visible(Object *ob, const bGPDstroke *gps)
/* ******************************************************** */
/* Space Conversion */
-/**
- * Init settings for stroke point space conversions
- *
- * \param r_gsc: [out] The space conversion settings struct, populated with necessary params
- */
void gpencil_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc)
{
ScrArea *area = CTX_wm_area(C);
@@ -691,13 +626,6 @@ void gpencil_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc)
}
}
-/**
- * Convert point to parent space
- *
- * \param pt: Original point
- * \param diff_mat: Matrix with the difference between original parent matrix
- * \param[out] r_pt: Pointer to new point after apply matrix
- */
void gpencil_point_to_parent_space(const bGPDspoint *pt,
const float diff_mat[4][4],
bGPDspoint *r_pt)
@@ -708,9 +636,6 @@ void gpencil_point_to_parent_space(const bGPDspoint *pt,
copy_v3_v3(&r_pt->x, fpt);
}
-/**
- * Change position relative to parent object
- */
void gpencil_apply_parent(Depsgraph *depsgraph, Object *obact, bGPDlayer *gpl, bGPDstroke *gps)
{
bGPDspoint *pt;
@@ -731,9 +656,6 @@ void gpencil_apply_parent(Depsgraph *depsgraph, Object *obact, bGPDlayer *gpl, b
}
}
-/**
- * Change point position relative to parent object
- */
void gpencil_apply_parent_point(Depsgraph *depsgraph,
Object *obact,
bGPDlayer *gpl,
@@ -752,15 +674,6 @@ void gpencil_apply_parent_point(Depsgraph *depsgraph,
copy_v3_v3(&pt->x, fpt);
}
-/**
- * Convert a Grease Pencil coordinate (i.e. can be 2D or 3D) to screenspace (2D)
- *
- * \param[out] r_x: The screen-space x-coordinate of the point
- * \param[out] r_y: The screen-space y-coordinate of the point
- *
- * \warning This assumes that the caller has already checked
- * whether the stroke in question can be drawn.
- */
void gpencil_point_to_xy(
const GP_SpaceConversion *gsc, const bGPDstroke *gps, const bGPDspoint *pt, int *r_x, int *r_y)
{
@@ -803,19 +716,6 @@ void gpencil_point_to_xy(
}
}
-/**
- * Convert a Grease Pencil coordinate (i.e. can be 2D or 3D) to screenspace (2D).
- *
- * Just like #gpencil_point_to_xy(), except the resulting coordinates are floats not ints.
- * Use this version to solve "stair-step" artifacts which may arise when
- * roundtripping the calculations.
- *
- * \param r_x: The screen-space x-coordinate of the point.
- * \param r_y: The screen-space y-coordinate of the point.
- *
- * \warning This assumes that the caller has already checked
- * whether the stroke in question can be drawn.
- */
void gpencil_point_to_xy_fl(const GP_SpaceConversion *gsc,
const bGPDstroke *gps,
const bGPDspoint *pt,
@@ -873,9 +773,6 @@ void gpencil_point_to_xy_fl(const GP_SpaceConversion *gsc,
}
}
-/**
- * generic based on gpencil_point_to_xy_fl
- */
void gpencil_point_3d_to_xy(const GP_SpaceConversion *gsc,
const short flag,
const float pt[3],
@@ -930,21 +827,6 @@ void gpencil_point_3d_to_xy(const GP_SpaceConversion *gsc,
}
}
-/**
- * Project screenspace coordinates to 3D-space
- *
- * For use with editing tools where it is easier to perform the operations in 2D,
- * and then later convert the transformed points back to 3D.
- *
- * \param screen_co: The screenspace 2D coordinates to convert to
- * \param r_out: The resulting 3D coordinates of the input point
- *
- * \note We include this as a utility function, since the standard method
- * involves quite a few steps, which are invariably always the same
- * for all GPencil operations. So, it's nicer to just centralize these.
- *
- * \warning Assumes that it is getting called in a 3D view only.
- */
bool gpencil_point_xy_to_3d(const GP_SpaceConversion *gsc,
Scene *scene,
const float screen_co[2],
@@ -974,14 +856,6 @@ bool gpencil_point_xy_to_3d(const GP_SpaceConversion *gsc,
return false;
}
-/**
- * Convert tGPspoint (temporary 2D/screenspace point data used by GP modal operators)
- * to 3D coordinates.
- *
- * \param point2D: The screen-space 2D point data to convert.
- * \param depth: Depth array (via #ED_view3d_depth_read_cached()).
- * \param r_out: The resulting 2D point data.
- */
void gpencil_stroke_convertcoords_tpoint(Scene *scene,
ARegion *region,
Object *ob,
@@ -1027,10 +901,6 @@ void gpencil_stroke_convertcoords_tpoint(Scene *scene,
}
}
-/**
- * Get drawing reference point for conversion or projection of the stroke
- * \param r_vec: Reference point found
- */
void ED_gpencil_drawing_reference_get(const Scene *scene,
const Object *ob,
char align_flag,
@@ -1098,9 +968,6 @@ void ED_gpencil_project_stroke_to_view(bContext *C, bGPDlayer *gpl, bGPDstroke *
}
}
-/**
- * Reproject all points of the stroke to a plane locked to axis to avoid stroke offset
- */
void ED_gpencil_project_stroke_to_plane(const Scene *scene,
const Object *ob,
const RegionView3D *rv3d,
@@ -1179,7 +1046,6 @@ void ED_gpencil_project_stroke_to_plane(const Scene *scene,
}
}
-/* Reproject selected strokes */
void ED_gpencil_stroke_reproject(Depsgraph *depsgraph,
const GP_SpaceConversion *gsc,
SnapObjectContext *sctx,
@@ -1320,10 +1186,6 @@ void ED_gpencil_stroke_reproject(Depsgraph *depsgraph,
}
}
-/**
- * Reproject given point to a plane locked to axis to avoid stroke offset
- * \param pt: Point to affect (used for input & output).
- */
void ED_gpencil_project_point_to_plane(const Scene *scene,
const Object *ob,
bGPDlayer *gpl,
@@ -1406,12 +1268,6 @@ void ED_gpencil_project_point_to_plane(const Scene *scene,
/* XXX: Check if these functions duplicate stuff in blenkernel,
* and/or whether we should just deduplicate. */
-/**
- * Subdivide a stroke once, by adding a point half way between each pair of existing points
- * \param gpd: Datablock
- * \param gps: Stroke data
- * \param subdivide: Number of times to subdivide
- */
void gpencil_subdivide_stroke(bGPdata *gpd, bGPDstroke *gps, const int subdivide)
{
bGPDspoint *temp_points;
@@ -1505,7 +1361,6 @@ void gpencil_subdivide_stroke(bGPdata *gpd, bGPDstroke *gps, const int subdivide
BKE_gpencil_stroke_geometry_update(gpd, gps);
}
-/* Reset parent matrix for all layers. */
void ED_gpencil_reset_layers_parent(Depsgraph *depsgraph, Object *obact, bGPdata *gpd)
{
bGPDspoint *pt;
@@ -1555,7 +1410,6 @@ void ED_gpencil_reset_layers_parent(Depsgraph *depsgraph, Object *obact, bGPdata
/* ******************************************************** */
/* GP Object Stuff */
-/* Helper function to create new OB_GPENCIL Object */
Object *ED_gpencil_add_object(bContext *C, const float loc[3], ushort local_view_bits)
{
const float rot[3] = {0.0f};
@@ -1568,7 +1422,6 @@ Object *ED_gpencil_add_object(bContext *C, const float loc[3], ushort local_view
return ob;
}
-/* Helper function to create default colors and drawing brushes */
void ED_gpencil_add_defaults(bContext *C, Object *ob)
{
Main *bmain = CTX_data_main(C);
@@ -1600,7 +1453,6 @@ void ED_gpencil_add_defaults(bContext *C, Object *ob)
/* ******************************************************** */
/* Vertex Groups */
-/* assign points to vertex group */
void ED_gpencil_vgroup_assign(bContext *C, Object *ob, float weight)
{
bGPdata *gpd = (bGPdata *)ob->data;
@@ -1654,7 +1506,6 @@ void ED_gpencil_vgroup_assign(bContext *C, Object *ob, float weight)
CTX_DATA_END;
}
-/* remove points from vertex group */
void ED_gpencil_vgroup_remove(bContext *C, Object *ob)
{
bGPdata *gpd = (bGPdata *)ob->data;
@@ -1707,7 +1558,6 @@ void ED_gpencil_vgroup_remove(bContext *C, Object *ob)
CTX_DATA_END;
}
-/* select points of vertex group */
void ED_gpencil_vgroup_select(bContext *C, Object *ob)
{
bGPdata *gpd = (bGPdata *)ob->data;
@@ -1762,7 +1612,6 @@ void ED_gpencil_vgroup_select(bContext *C, Object *ob)
CTX_DATA_END;
}
-/* unselect points of vertex group */
void ED_gpencil_vgroup_deselect(bContext *C, Object *ob)
{
bGPdata *gpd = (bGPdata *)ob->data;
@@ -1843,7 +1692,6 @@ static bool gpencil_check_cursor_region(bContext *C, const int mval_i[2])
return false;
}
-/* draw eraser cursor */
void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y)
{
short radius = (short)brush->size;
@@ -2079,7 +1927,6 @@ static void gpencil_brush_cursor_draw(bContext *C, int x, int y, void *customdat
immUnbindProgram();
}
-/* Turn brush cursor in on/off */
void ED_gpencil_toggle_brush_cursor(bContext *C, bool enable, void *customdata)
{
Scene *scene = CTX_data_scene(C);
@@ -2107,7 +1954,6 @@ void ED_gpencil_toggle_brush_cursor(bContext *C, bool enable, void *customdata)
}
}
-/* set object modes */
void ED_gpencil_setup_modes(bContext *C, bGPdata *gpd, int newmode)
{
if (!gpd) {
@@ -2194,9 +2040,6 @@ static void gpencil_stroke_convertcoords(ARegion *region,
}
}
-/**
- * Convert 2d #tGPspoint to 3d #bGPDspoint.
- */
void ED_gpencil_tpoint_to_point(ARegion *region,
float origin[3],
const tGPspoint *tpt,
@@ -2214,9 +2057,6 @@ void ED_gpencil_tpoint_to_point(ARegion *region,
pt->uv_rot = tpt->uv_rot;
}
-/**
- * Recalculate UV for any stroke using the material.
- */
void ED_gpencil_update_color_uv(Main *bmain, Material *mat)
{
Material *gps_ma = NULL;
@@ -2424,7 +2264,6 @@ static float gpencil_calc_factor(const float p2d_a1[2],
return f;
}
-/* extend selection to stroke intersections */
int ED_gpencil_select_stroke_segment(bGPdata *gpd,
bGPDlayer *gpl,
bGPDstroke *gps,
@@ -2805,10 +2644,6 @@ void ED_gpencil_select_curve_toggle_all(bContext *C, int action)
}
}
-/**
- * Ensure the #tGPspoint buffer (while drawing stroke)
- * size is enough to save all points of the stroke.
- */
tGPspoint *ED_gpencil_sbuffer_ensure(tGPspoint *buffer_array,
int *buffer_size,
int *buffer_used,
@@ -2859,9 +2694,6 @@ void ED_gpencil_sbuffer_update_eval(bGPdata *gpd, Object *ob_eval)
gpd_eval->runtime.cp_points = gpd->runtime.cp_points;
}
-/**
- * Tag all scene grease pencil object to update.
- */
void ED_gpencil_tag_scene_gpencil(Scene *scene)
{
/* Mark all grease pencil data-blocks of the scene. */
@@ -3110,7 +2942,6 @@ void ED_gpencil_sbuffer_vertex_color_set(Depsgraph *depsgraph,
}
}
-/* Get the bigger 2D bound box points. */
void ED_gpencil_projected_2d_bound_box(const GP_SpaceConversion *gsc,
const bGPDstroke *gps,
const float diff_mat[4][4],
@@ -3144,7 +2975,6 @@ void ED_gpencil_projected_2d_bound_box(const GP_SpaceConversion *gsc,
}
}
-/* Check if the stroke collides with brush. */
bool ED_gpencil_stroke_check_collision(const GP_SpaceConversion *gsc,
bGPDstroke *gps,
const float mouse[2],
@@ -3171,15 +3001,6 @@ bool ED_gpencil_stroke_check_collision(const GP_SpaceConversion *gsc,
return BLI_rcti_isect(&rect_stroke, &rect_mouse, NULL);
}
-/**
- * Check if a point is inside of the stroke.
- *
- * \param gps: Stroke to check.
- * \param gsc: Space conversion data.
- * \param mouse: Mouse position.
- * \param diff_mat: View matrix.
- * \return True if the point is inside.
- */
bool ED_gpencil_stroke_point_is_inside(const bGPDstroke *gps,
const GP_SpaceConversion *gsc,
const int mouse[2],
@@ -3218,7 +3039,6 @@ bool ED_gpencil_stroke_point_is_inside(const bGPDstroke *gps,
return hit;
}
-/* Get extremes of stroke in 2D using current view. */
void ED_gpencil_stroke_extremes_to2d(const GP_SpaceConversion *gsc,
const float diff_mat[4][4],
bGPDstroke *gps,
@@ -3333,7 +3153,6 @@ bGPDstroke *ED_gpencil_stroke_nearest_to_ends(bContext *C,
return gps_rtn;
}
-/* Join two stroke using a contact point index and trimming the rest. */
bGPDstroke *ED_gpencil_stroke_join_and_trim(
bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps, bGPDstroke *gps_dst, const int pt_index)
{
@@ -3403,7 +3222,6 @@ bGPDstroke *ED_gpencil_stroke_join_and_trim(
return gps_final;
}
-/* Close if the distance between extremes is below threshold. */
void ED_gpencil_stroke_close_by_distance(bGPDstroke *gps, const float threshold)
{
if (gps == NULL) {
@@ -3420,7 +3238,6 @@ void ED_gpencil_stroke_close_by_distance(bGPDstroke *gps, const float threshold)
}
}
-/* Merge two layers. */
void ED_gpencil_layer_merge(bGPdata *gpd,
bGPDlayer *gpl_src,
bGPDlayer *gpl_dst,