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:
authorCampbell Barton <ideasman42@gmail.com>2019-04-21 17:18:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-21 23:30:04 +0300
commit0ac990d088d553c27f5360f62e142e99f087890a (patch)
treeef3637e9f8086bc937b56777ea9b1f36f97790a4 /source/blender/editors/gpencil
parentf8b2268f4fbe92a1860c525f70fdc293304575ff (diff)
Cleanup: comments (long lines) in editors
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/annotate_draw.c21
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c16
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c10
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c12
-rw-r--r--source/blender/editors/gpencil/gpencil_add_stroke.c3
-rw-r--r--source/blender/editors/gpencil/gpencil_brush.c30
-rw-r--r--source/blender/editors/gpencil/gpencil_convert.c28
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c10
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c25
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c3
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c28
-rw-r--r--source/blender/editors/gpencil/gpencil_select.c18
-rw-r--r--source/blender/editors/gpencil/gpencil_undo.c3
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c35
14 files changed, 156 insertions, 86 deletions
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c
index a7fa51350ba..b4f0bc03700 100644
--- a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -138,8 +138,9 @@ static void gp_draw_stroke_buffer(const tGPspoint *points,
immBeginAtMost(GPU_PRIM_LINE_STRIP, totpoints);
for (int i = 0; i < totpoints; i++, pt++) {
- /* if there was a significant pressure change, stop the curve, change the thickness of the stroke,
- * and continue drawing again (since line-width cannot change in middle of GL_LINE_STRIP)
+ /* If there was a significant pressure change,
+ * stop the curve, change the thickness of the stroke,
+ * and continue drawing again (since line-width cannot change in middle of GL_LINE_STRIP).
*/
if (fabsf(pt->pressure - oldpressure) > 0.2f) {
/* need to have 2 points to avoid immEnd assert error */
@@ -277,8 +278,9 @@ static void gp_draw_stroke_3d(const bGPDspoint *points,
immBeginAtMost(GPU_PRIM_LINE_STRIP, totpoints + cyclic_add);
const bGPDspoint *pt = points;
for (int i = 0; i < totpoints; i++, pt++) {
- /* if there was a significant pressure change, stop the curve, change the thickness of the stroke,
- * and continue drawing again (since line-width cannot change in middle of GL_LINE_STRIP)
+ /* If there was a significant pressure change, stop the curve,
+ * change the thickness of the stroke, and continue drawing again
+ * (since line-width cannot change in middle of GL_LINE_STRIP)
* Note: we want more visible levels of pressures when thickness is bigger.
*/
if (fabsf(pt->pressure - curpressure) > 0.2f / (float)thickness) {
@@ -352,8 +354,9 @@ static void gp_draw_stroke_2d(const bGPDspoint *points,
scalefac = 0.001f;
}
- /* tessellation code - draw stroke as series of connected quads (triangle strips in fact) with connection
- * edges rotated to minimize shrinking artifacts, and rounded endcaps
+ /* Tessellation code - draw stroke as series of connected quads
+ * (triangle strips in fact) with connection edges rotated to minimize shrinking artifacts,
+ * and rounded endcaps.
*/
{
const bGPDspoint *pt1, *pt2;
@@ -377,7 +380,8 @@ static void gp_draw_stroke_2d(const bGPDspoint *points,
float mt[2], sc[2]; /* gradient for thickness, point for end-cap */
float pthick; /* thickness at segment point */
- /* get x and y coordinates from point2 (point1 has already been computed in previous iteration). */
+ /* Get x and y coordinates from point2
+ * (point1 has already been computed in previous iteration). */
gp_calc_2d_stroke_fxy(&pt2->x, sflag, offsx, offsy, winx, winy, s1);
/* calculate gradient and normal - 'angle'=(ny/nx) */
@@ -1041,7 +1045,8 @@ void ED_annotation_draw_2dimage(const bContext *C)
case SPACE_CLIP: /* clip */
{
/* just draw using standard scaling (settings here are currently ignored anyways) */
- /* FIXME: the opengl poly-strokes don't draw at right thickness when done this way, so disabled */
+ /* FIXME: the opengl poly-strokes don't draw at right thickness when done this way,
+ * so disabled. */
offsx = 0;
offsy = 0;
sizex = ar->winx;
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index aedfc88e43f..899b76e252f 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -160,7 +160,8 @@ typedef struct tGPsdata {
/* These need to be doubles, as (at least under unix) they are in seconds since epoch,
* float (and its 7 digits precision) is definitively not enough here!
- * double, with its 15 digits precision, ensures us millisecond precision for a few centuries at least.
+ * double, with its 15 digits precision,
+ * ensures us millisecond precision for a few centuries at least.
*/
/** Used when converting to path. */
double inittime;
@@ -287,9 +288,10 @@ static bool gp_stroke_filtermval(tGPsdata *p, const float mval[2], float pmval[2
else if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX))
return true;
- /* check if the distance since the last point is significant enough
- * - prevents points being added too densely
- * - distance here doesn't use sqrt to prevent slowness... we should still be safe from overflows though
+ /* Check if the distance since the last point is significant enough:
+ * - Prevents points being added too densely
+ * - Distance here doesn't use sqrt to prevent slowness.
+ * We should still be safe from overflows though.
*/
else if ((dx * dx + dy * dy) > MIN_EUCLIDEAN_PX * MIN_EUCLIDEAN_PX)
return true;
@@ -646,7 +648,8 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
ToolSettings *ts = p->scene->toolsettings;
int i, totelem;
- /* since strokes are so fine, when using their depth we need a margin otherwise they might get missed */
+ /* Since strokes are so fine, when using their depth we need a margin
+ * otherwise they might get missed. */
int depth_margin = (ts->annotate_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 4 : 0;
/* get total number of points to allocate space for
@@ -1718,7 +1721,8 @@ static void gpencil_draw_apply(wmOperator *op, tGPsdata *p, Depsgraph *depsgraph
p->mvalo[1] = p->mval[1];
p->opressure = p->pressure;
}
- /* only add current point to buffer if mouse moved (even though we got an event, it might be just noise) */
+ /* Only add current point to buffer if mouse moved
+ * (even though we got an event, it might be just noise). */
else if (gp_stroke_filtermval(p, p->mval, p->mvalo)) {
/* try to add point */
short ok = gp_stroke_addpoint(p, p->mval, p->pressure, p->curtime);
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 8110b1f3b9f..47f6e2e5a6e 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -274,7 +274,8 @@ static void gp_calc_stroke_text_coordinates(
}
}
-/* Triangulate stroke for high quality fill (this is done only if cache is null or stroke was modified) */
+/* Triangulate stroke for high quality fill
+ * (this is done only if cache is null or stroke was modified). */
static void gp_triangulate_stroke_fill(bGPDstroke *gps)
{
BLI_assert(gps->totpoints >= 3);
@@ -643,8 +644,8 @@ static void gp_draw_stroke_2d(const bGPDspoint *points,
/* TODO: fancy++ with the magic of shaders */
- /* tessellation code - draw stroke as series of connected quads (triangle strips in fact) with connection
- * edges rotated to minimize shrinking artifacts, and rounded endcaps
+ /* tessellation code - draw stroke as series of connected quads (triangle strips in fact)
+ * with connection edges rotated to minimize shrinking artifacts, and rounded endcaps.
*/
{
const bGPDspoint *pt1, *pt2;
@@ -675,7 +676,8 @@ static void gp_draw_stroke_2d(const bGPDspoint *points,
float mt[2], sc[2]; /* gradient for thickness, point for end-cap */
float pthick; /* thickness at segment point */
- /* get x and y coordinates from point2 (point1 has already been computed in previous iteration). */
+ /* Get x and y coordinates from point2
+ * (point1 has already been computed in previous iteration). */
mul_v3_m4v3(fpt, diff_mat, &pt2->x);
gp_calc_2d_stroke_fxy(fpt, sflag, offsx, offsy, winx, winy, s1);
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index 4724dc068b6..44e7341b6f7 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -301,12 +301,14 @@ void ED_gplayer_frames_keytype_set(bGPDlayer *gpl, short type)
}
/* -------------------------------------- */
-/* Copy and Paste Tools */
-/* - The copy/paste buffer currently stores a set of GP_Layers, with temporary
+/* Copy and Paste Tools:
+ * - The copy/paste buffer currently stores a set of GP_Layers, with temporary
* GP_Frames with the necessary strokes
- * - Unless there is only one element in the buffer, names are also tested to check for compatibility.
- * - All pasted frames are offset by the same amount. This is calculated as the difference in the times of
- * the current frame and the 'first keyframe' (i.e. the earliest one in all channels).
+ * - Unless there is only one element in the buffer,
+ * names are also tested to check for compatibility.
+ * - All pasted frames are offset by the same amount.
+ * This is calculated as the difference in the times of the current frame and the
+ * 'first keyframe' (i.e. the earliest one in all channels).
* - The earliest frame is calculated per copy operation.
*/
diff --git a/source/blender/editors/gpencil/gpencil_add_stroke.c b/source/blender/editors/gpencil/gpencil_add_stroke.c
index d6e068926dd..f6ff5ed4f13 100644
--- a/source/blender/editors/gpencil/gpencil_add_stroke.c
+++ b/source/blender/editors/gpencil/gpencil_add_stroke.c
@@ -210,7 +210,8 @@ 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) */
+/* 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_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 627e05393ff..c1503bb57b2 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -302,7 +302,8 @@ static float gp_brush_influence_calc(tGP_BrushEditData *gso, const int radius, c
/* ----------------------------------------------- */
/* Smooth Brush */
-/* A simple (but slower + inaccurate) smooth-brush implementation to test the algorithm for stroke smoothing */
+/* A simple (but slower + inaccurate)
+ * smooth-brush implementation to test the algorithm for stroke smoothing. */
static bool gp_brush_smooth_apply(
tGP_BrushEditData *gso, bGPDstroke *gps, int pt_index, const int radius, const int co[2])
{
@@ -351,7 +352,8 @@ static bool gp_brush_thickness_apply(
inf = gp_brush_influence_calc(gso, radius, co) / 10.0f;
/* apply */
- // XXX: this is much too strong, and it should probably do some smoothing with the surrounding stuff
+ /* XXX: this is much too strong,
+ * and it should probably do some smoothing with the surrounding stuff. */
if (gp_brush_invert_check(gso)) {
/* make line thinner - reduce stroke pressure */
pt->pressure -= inf;
@@ -801,7 +803,16 @@ static bool gp_brush_randomize_apply(
mul_v2_fl(svec, fac);
}
- //printf("%f %f (%f), nco = {%f %f}, co = %d %d\n", svec[0], svec[1], fac, nco[0], nco[1], co[0], co[1]);
+#if 0
+ printf("%f %f (%f), nco = {%f %f}, co = %d %d\n",
+ svec[0],
+ svec[1],
+ fac,
+ nco[0],
+ nco[1],
+ co[0],
+ co[1]);
+#endif
/* convert to dataspace */
if (gps->flag & GP_STROKE_3DSPACE) {
@@ -1106,7 +1117,8 @@ static void gp_brush_clone_adjust(tGP_BrushEditData *gso)
gp_brush_grab_calc_dvec(gso);
/* For each of the stored strokes, apply the offset to each point */
- /* NOTE: Again this assumes that in the 3D view, we only have 3d space and not screenspace strokes... */
+ /* NOTE: Again this assumes that in the 3D view,
+ * we only have 3d space and not screenspace strokes... */
for (snum = 0; snum < data->totitems; snum++) {
bGPDstroke *gps = data->new_strokes[snum];
bGPDspoint *pt;
@@ -1453,7 +1465,8 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
pt1 = gps->points + i;
pt2 = gps->points + i + 1;
- /* Skip if neither one is selected (and we are only allowed to edit/consider selected points) */
+ /* Skip if neither one is selected
+ * (and we are only allowed to edit/consider selected points) */
if (gso->settings->flag & GP_SCULPT_SETT_FLAG_SELECT_MASK) {
if (!(pt1->flag & GP_SPOINT_SELECT) && !(pt2->flag & GP_SPOINT_SELECT)) {
include_last = false;
@@ -1501,9 +1514,10 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
changed |= ok;
}
else if (include_last) {
- /* This case is for cases where for whatever reason the second vert (1st here) doesn't get included
- * because the whole edge isn't in bounds, but it would've qualified since it did with the
- * previous step (but wasn't added then, to avoid double-ups)
+ /* This case is for cases where for whatever reason the second vert (1st here)
+ * doesn't get included because the whole edge isn't in bounds,
+ * but it would've qualified since it did with the previous step
+ * (but wasn't added then, to avoid double-ups).
*/
changed |= apply(gso, gps, i, radius, pc1);
include_last = false;
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c
index c1c797b15be..28d57939e0e 100644
--- a/source/blender/editors/gpencil/gpencil_convert.c
+++ b/source/blender/editors/gpencil/gpencil_convert.c
@@ -693,8 +693,10 @@ static void gp_stroke_to_path(bContext *C,
* the last segment to get the first point (p1) position and timing.
* - If we do not have those (quite odd, but may happen), we linearly interpolate the last point
* with the first point of the current stroke.
- * The same goes for the second point, first segment of the current stroke is "negatively" extrapolated
- * if it exists, else (if the stroke is a single point), linear interpolation with last curve point...
+ *
+ * The same goes for the second point, first segment of the current stroke is "negatively"
+ * extrapolated if it exists, else (if the stroke is a single point),
+ * linear interpolation with last curve point.
*/
if (curnu && !stitch && old_nbp) {
float p1[3], p2[3], p[3], next_p[3];
@@ -774,8 +776,9 @@ static void gp_stroke_to_path(bContext *C,
dt = -GAP_DFAC; /* Rather arbitrary too! */
}
bp = &nu->bp[old_nbp];
- /* Note we can't give anything else than 0.0 as time here, since a negative one (which would be expected value)
- * would not work (it would be *before* gtd->inittime, which is not supported currently).
+ /* Note we can't give anything else than 0.0 as time here, since a negative one
+ * (which would be expected value) would not work
+ * (it would be *before* gtd->inittime, which is not supported currently).
*/
gp_stroke_to_path_add_point(
gtd, bp, p, p, do_gtd, gps->inittime, dt, 0.0f, rad_fac, minmax_weights);
@@ -907,9 +910,10 @@ static void gp_stroke_to_bezier(bContext *C,
/* create new 'nurb' or extend current one within the curve */
if (nu) {
old_nbezt = nu->pntsu;
- /* If we do stitch, first point of current stroke is assumed the same as last point of previous stroke,
- * so no need to add it.
- * If no stitch, we want to add two additional points to make a "zero-radius" link between both strokes.
+ /* If we do stitch, first point of current stroke is assumed the same as last point of
+ * previous stroke, so no need to add it.
+ * If no stitch, we want to add two additional points to make a "zero-radius"
+ * link between both strokes.
*/
BKE_nurb_bezierPoints_add(nu, gps->totpoints + ((stitch) ? -1 : 2) + add_start_end_points);
}
@@ -962,8 +966,11 @@ static void gp_stroke_to_bezier(bContext *C,
* the last segment to get the first point (p1) position and timing.
* - If we do not have those (quite odd, but may happen), we linearly interpolate the last point
* with the first point of the current stroke.
- * The same goes for the second point, first segment of the current stroke is "negatively" extrapolated
- * if it exists, else (if the stroke is a single point), linear interpolation with last curve point...
+ *
+ * The same goes for the second point,
+ * first segment of the current stroke is "negatively" extrapolated
+ * if it exists, else (if the stroke is a single point),
+ * linear interpolation with last curve point.
*/
else {
float p1[3], p2[3];
@@ -1133,7 +1140,8 @@ static void gp_stroke_to_bezier(bContext *C,
/* The end point */
interp_v3_v3v3(h1, p, prev_bezt->vec[1], BEZT_HANDLE_FAC);
interp_v3_v3v3(h2, p, prev_bezt->vec[1], -BEZT_HANDLE_FAC);
- /* Note bezt has already been incremented in main loop above, so it points to the right place. */
+ /* Note bezt has already been incremented in main loop above,
+ * so it points to the right place. */
gp_stroke_to_bezier_add_point(gtd,
bezt,
p,
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index c91c543e746..7cab9def553 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -124,7 +124,8 @@ static int gp_data_add_exec(bContext *C, wmOperator *op)
id_us_min(&gpd->id);
}
- /* add new datablock, with a single layer ready to use (so users don't have to perform an extra step) */
+ /* Add new datablock, with a single layer ready to use
+ * (so users don't have to perform an extra step). */
if (is_annotation) {
bGPdata *gpd = BKE_gpencil_data_addnew(bmain, DATA_("Annotations"));
*gpd_ptr = gpd;
@@ -2091,7 +2092,10 @@ typedef struct tJoinGPencil_AdtFixData {
GHash *names_map;
} tJoinGPencil_AdtFixData;
-/* Callback to pass to BKE_fcurves_main_cb() for RNA Paths attached to each F-Curve used in the AnimData */
+/**
+ * Callback to pass to #BKE_fcurves_main_cb()
+ * for RNA Paths attached to each F-Curve used in the #AnimData.
+ */
static void joined_gpencil_fix_animdata_cb(ID *id, FCurve *fcu, void *user_data)
{
tJoinGPencil_AdtFixData *afd = (tJoinGPencil_AdtFixData *)user_data;
@@ -2374,7 +2378,7 @@ static bool gpencil_active_color_poll(bContext *C)
return false;
}
-/* ******************* Lock and hide any color non used in current layer ************************** */
+/* **************** Lock and hide any color non used in current layer ************************** */
static int gpencil_lock_layer_exec(bContext *C, wmOperator *UNUSED(op))
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 40e1e483f41..0116747ab82 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -1212,8 +1212,9 @@ static bool gp_strokes_paste_poll(bContext *C)
{
/* 1) Must have GP datablock to paste to
* - We don't need to have an active layer though, as that can easily get added
- * - If the active layer is locked, we can't paste there, but that should prompt a warning instead
- * 2) Copy buffer must at least have something (though it may be the wrong sort...)
+ * - If the active layer is locked, we can't paste there,
+ * but that should prompt a warning instead.
+ * 2) Copy buffer must at least have something (though it may be the wrong sort...).
*/
return (ED_gpencil_data_get_active(C) != NULL) &&
(!BLI_listbase_is_empty(&gp_strokes_copypastebuf));
@@ -1273,8 +1274,9 @@ static int gp_strokes_paste_exec(bContext *C, wmOperator *op)
}
if (ok == false) {
- /* XXX: this check is not 100% accurate (i.e. image editor is incompatible with normal 2D strokes),
- * but should be enough to give users a good idea of what's going on
+ /* XXX: this check is not 100% accurate
+ * (i.e. image editor is incompatible with normal 2D strokes),
+ * but should be enough to give users a good idea of what's going on.
*/
if (CTX_wm_area(C)->spacetype == SPACE_VIEW3D)
BKE_report(op->reports, RPT_ERROR, "Cannot paste 2D strokes in 3D View");
@@ -1541,7 +1543,8 @@ static int gp_blank_frame_add_exec(bContext *C, wmOperator *op)
/* Initialise datablock and an active layer if nothing exists yet */
if (ELEM(NULL, gpd, active_gpl)) {
- /* let's just be lazy, and call the "Add New Layer" operator, which sets everything up as required */
+ /* Let's just be lazy, and call the "Add New Layer" operator,
+ * which sets everything up as required. */
WM_operator_name_call(C, "GPENCIL_OT_layer_add", WM_OP_EXEC_DEFAULT, NULL);
}
@@ -2239,13 +2242,13 @@ void gp_stroke_delete_tagged_points(bGPDframe *gpf,
e++;
}
}
- /* Each island corresponds to a new stroke. We must adjust the
- * timings of these new strokes:
+ /* Each island corresponds to a new stroke.
+ * We must adjust the timings of these new strokes:
*
- * Each point's timing data is a delta from stroke's inittime, so as we erase some points from
- * the start of the stroke, we have to offset this inittime and all remaining points' delta values.
- * This way we get a new stroke with exactly the same timing as if user had started drawing from
- * the first non-removed point...
+ * Each point's timing data is a delta from stroke's inittime, so as we erase some points
+ * from the start of the stroke, we have to offset this inittime and all remaining points'
+ * delta values. This way we get a new stroke with exactly the same timing as if user had
+ * started drawing from the first non-removed point.
*/
{
bGPDspoint *pts;
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 8d3137ed3db..f873b9e2b7c 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -930,7 +930,8 @@ static void gpencil_get_depth_array(tGPDfill *tgpf)
view3d_region_operator_needs_opengl(tgpf->win, tgpf->ar);
ED_view3d_autodist_init(tgpf->depsgraph, tgpf->ar, tgpf->v3d, 0);
- /* since strokes are so fine, when using their depth we need a margin otherwise they might get missed */
+ /* Since strokes are so fine, when using their depth we need a margin
+ * otherwise they might get missed. */
int depth_margin = 0;
/* get an array of depths, far depths are blended */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 3fc7ade7368..02f53f09c23 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -178,7 +178,8 @@ typedef struct tGPsdata {
/* These need to be doubles, as (at least under unix) they are in seconds since epoch,
* float (and its 7 digits precision) is definitively not enough here!
- * double, with its 15 digits precision, ensures us millisecond precision for a few centuries at least.
+ * double, with its 15 digits precision,
+ * ensures us millisecond precision for a few centuries at least.
*/
/** Used when converting to path. */
double inittime;
@@ -370,9 +371,10 @@ static bool gp_stroke_filtermval(tGPsdata *p, const float mval[2], float mvalo[2
else if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX))
return true;
- /* check if the distance since the last point is significant enough
- * - prevents points being added too densely
- * - distance here doesn't use sqrt to prevent slowness... we should still be safe from overflows though
+ /* Check if the distance since the last point is significant enough:
+ * - Prevents points being added too densely
+ * - Distance here doesn't use sqrt to prevent slowness.
+ * We should still be safe from overflows though.
*/
else if ((dx * dx + dy * dy) > MIN_EUCLIDEAN_PX * MIN_EUCLIDEAN_PX)
return true;
@@ -913,7 +915,8 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
(!is_depth);
int i, totelem;
- /* since strokes are so fine, when using their depth we need a margin otherwise they might get missed */
+ /* Since strokes are so fine,
+ * when using their depth we need a margin otherwise they might get missed. */
int depth_margin = (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 4 : 0;
/* get total number of points to allocate space for
@@ -1233,9 +1236,9 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
/* calculate UVs along the stroke */
ED_gpencil_calc_stroke_uv(obact, gps);
- /* add stroke to frame, usually on tail of the listbase, but if on back is enabled the stroke is added on listbase head
- * because the drawing order is inverse and the head stroke is the first to draw. This is very useful for artist
- * when drawing the background
+ /* add stroke to frame, usually on tail of the listbase, but if on back is enabled the stroke
+ * is added on listbase head because the drawing order is inverse and the head stroke is the
+ * first to draw. This is very useful for artist when drawing the background.
*/
if ((ts->gpencil_flags & GP_TOOL_FLAG_PAINT_ONBACK) &&
(p->paintmode != GP_PAINTMODE_DRAW_POLY)) {
@@ -2544,7 +2547,8 @@ static void gpencil_draw_apply(bContext *C, wmOperator *op, tGPsdata *p, Depsgra
copy_v2_v2(p->mvalo, p->mval);
p->opressure = p->pressure;
}
- /* only add current point to buffer if mouse moved (even though we got an event, it might be just noise) */
+ /* Only add current point to buffer if mouse moved
+ * (even though we got an event, it might be just noise). */
else if (gp_stroke_filtermval(p, p->mval, p->mvalo)) {
/* if lazy mouse, interpolate the last and current mouse positions */
@@ -3266,10 +3270,12 @@ static void gpencil_stroke_end(wmOperator *op)
p->gpf = NULL;
}
-/* Move last stroke in the listbase to the head to be drawn below all previous strokes in the layer */
+/* Move last stroke in the listbase to the head
+ * to be drawn below all previous strokes in the layer. */
static void gpencil_move_last_stroke_to_back(bContext *C)
{
- /* move last stroke (the polygon) to head of the listbase stroke to draw on back of all previous strokes */
+ /* Move last stroke (the polygon) to head of the listbase stroke
+ * to draw on back of all previous strokes. */
bGPdata *gpd = ED_gpencil_data_get_active(C);
bGPDlayer *gpl = BKE_gpencil_layer_getactive(gpd);
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index ef7a198111b..6b5c728c4ed 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -291,7 +291,8 @@ typedef enum eGP_SelectGrouped {
/* Select strokes with the same color */
GP_SEL_SAME_MATERIAL = 1,
- /* TODO: All with same prefix - Useful for isolating all layers for a particular character for instance */
+ /* TODO: All with same prefix -
+ * Useful for isolating all layers for a particular character for instance. */
/* TODO: All with same appearance - colour/opacity/volumetric/fills ? */
} eGP_SelectGrouped;
@@ -621,7 +622,8 @@ static int gpencil_select_more_exec(bContext *C, wmOperator *UNUSED(op))
int i;
bool prev_sel;
- /* First Pass: Go in forward order, expanding selection if previous was selected (pre changes)...
+ /* First Pass: Go in forward order,
+ * expanding selection if previous was selected (pre changes).
* - This pass covers the "after" edges of selection islands
*/
prev_sel = false;
@@ -705,7 +707,8 @@ static int gpencil_select_less_exec(bContext *C, wmOperator *UNUSED(op))
int i;
bool prev_sel;
- /* First Pass: Go in forward order, shrinking selection if previous was not selected (pre changes)...
+ /* First Pass: Go in forward order, shrinking selection
+ * if previous was not selected (pre changes).
* - This pass covers the "after" edges of selection islands
*/
prev_sel = false;
@@ -776,9 +779,12 @@ void GPENCIL_OT_select_less(wmOperatorType *ot)
/** \name Circle Select Operator
* \{ */
-/* Helper to check if a given stroke is within the area */
-/* NOTE: Code here is adapted (i.e. copied directly) from gpencil_paint.c::gp_stroke_eraser_dostroke()
- * It would be great to de-duplicate the logic here sometime, but that can wait...
+/**
+ * Helper to check if a given stroke is within the area.
+ *
+ * \note Code here is adapted (i.e. copied directly)
+ * from gpencil_paint.c #gp_stroke_eraser_dostroke().
+ * It would be great to de-duplicate the logic here sometime, but that can wait.
*/
static bool gp_stroke_do_circle_sel(bGPDlayer *gpl,
bGPDstroke *gps,
diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c
index d91977bc0da..bf077d528dd 100644
--- a/source/blender/editors/gpencil/gpencil_undo.c
+++ b/source/blender/editors/gpencil/gpencil_undo.c
@@ -154,7 +154,8 @@ void gpencil_undo_push(bGPdata *gpd)
* - to prevent running out of memory during **really**
* long drawing sessions (triggering swapping)
*/
- /* TODO: Undo-memory constraint is not respected yet, but can be added if we have any need for it */
+ /* TODO: Undo-memory constraint is not respected yet,
+ * but can be added if we have any need for it. */
if (U.undosteps && !BLI_listbase_is_empty(&undo_nodes)) {
/* remove anything older than n-steps before cur_node */
int steps = 0;
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index fcaefc3d1dd..357e570655a 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -85,7 +85,9 @@
/* ******************************************************** */
/* Context Wrangling... */
-/* Get pointer to active Grease Pencil datablock, and an RNA-pointer to trace back to whatever owns it,
+/**
+ * Get pointer to active Grease Pencil datablock,
+ * and an RNA-pointer to trace back to whatever owns it,
* when context info is not available.
*/
bGPdata **ED_gpencil_data_get_pointers_direct(
@@ -154,7 +156,8 @@ bGPdata **ED_gpencil_data_get_pointers_direct(
{
SpaceSeq *sseq = (SpaceSeq *)sl;
- /* for now, Grease Pencil data is associated with the space (actually preview region only) */
+ /* For now, Grease Pencil data is associated with the space
+ * (actually preview region only). */
/* XXX our convention for everything else is to link to data though... */
if (r_ptr)
RNA_pointer_create(screen_id, &RNA_SpaceSequenceEditor, sseq, r_ptr);
@@ -202,7 +205,8 @@ bGPdata **ED_gpencil_data_get_pointers_direct(
return NULL;
}
-/* Get pointer to active Grease Pencil datablock, and an RNA-pointer to trace back to whatever owns it */
+/* Get pointer to active Grease Pencil datablock,
+ * and an RNA-pointer to trace back to whatever owns it. */
bGPdata **ED_gpencil_data_get_pointers(const bContext *C, PointerRNA *r_ptr)
{
ID *screen_id = (ID *)CTX_wm_screen(C);
@@ -251,7 +255,11 @@ bGPdata *ED_gpencil_data_get_active_evaluated(const bContext *C)
Object *ob = CTX_data_active_object(C);
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
- /* if (ob && ob->type == OB_GPENCIL) BLI_assert(ob_eval->data == DEG_get_evaluated_id(ob->data)); */
+#if 0
+ if (ob && ob->type == OB_GPENCIL) {
+ BLI_assert(ob_eval->data == DEG_get_evaluated_id(ob->data));
+ }
+#endif
return ED_gpencil_data_get_active_direct(screen_id, sa, scene_eval, ob_eval);
}
@@ -606,7 +614,8 @@ void gp_apply_parent_point(
* \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.
+ * \warning This assumes that the caller has already checked
+ * whether the stroke in question can be drawn.
*/
void gp_point_to_xy(
const GP_SpaceConversion *gsc, const bGPDstroke *gps, const bGPDspoint *pt, int *r_x, int *r_y)
@@ -650,15 +659,17 @@ void gp_point_to_xy(
}
/**
- * Convert a Grease Pencil coordinate (i.e. can be 2D or 3D) to screenspace (2D)
+ * Convert a Grease Pencil coordinate (i.e. can be 2D or 3D) to screenspace (2D).
*
* Just like #gp_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.
+ * Use this version to solve "stair-step" artifacts which may arise when
+ * roundtripping the calculations.
*
- * \param r_x: [out] The screen-space x-coordinate of the point.
- * \param r_y: [out] The screen-space y-coordinate of the point.
+ * \param r_x[out]: The screen-space x-coordinate of the point.
+ * \param r_y[out]: 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.
+ * \warning This assumes that the caller has already checked
+ * whether the stroke in question can be drawn.
*/
void gp_point_to_xy_fl(const GP_SpaceConversion *gsc,
const bGPDstroke *gps,
@@ -1079,7 +1090,9 @@ void ED_gp_project_point_to_plane(const Scene *scene,
/* ******************************************************** */
/* Stroke Operations */
-// XXX: Check if these functions duplicate stuff in blenkernel, and/or whether we should just deduplicate
+
+/* 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