diff options
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/annotate_draw.c | 27 | ||||
-rw-r--r-- | source/blender/editors/gpencil/annotate_paint.c | 3 | ||||
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 38 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_brush.c | 3 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_convert.c | 8 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_data.c | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 13 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_fill.c | 94 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_intern.h | 174 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_interpolate.c | 3 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_select.c | 3 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 8 |
13 files changed, 255 insertions, 131 deletions
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index e6747856d1e..7c31527dfe7 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -80,13 +80,20 @@ /* ----- General Defines ------ */ /* flags for sflag */ typedef enum eDrawStrokeFlags { - GP_DRAWDATA_NOSTATUS = (1 << 0), /* don't draw status info */ - GP_DRAWDATA_ONLY3D = (1 << 1), /* only draw 3d-strokes */ - GP_DRAWDATA_ONLYV2D = (1 << 2), /* only draw 'canvas' strokes */ - GP_DRAWDATA_ONLYI2D = (1 << 3), /* only draw 'image' strokes */ - GP_DRAWDATA_IEDITHACK = (1 << 4), /* special hack for drawing strokes in Image Editor (weird coordinates) */ - GP_DRAWDATA_NO_XRAY = (1 << 5), /* don't draw xray in 3D view (which is default) */ - GP_DRAWDATA_NO_ONIONS = (1 << 6), /* no onionskins should be drawn (for animation playback) */ + /** don't draw status info */ + GP_DRAWDATA_NOSTATUS = (1 << 0), + /** only draw 3d-strokes */ + GP_DRAWDATA_ONLY3D = (1 << 1), + /** only draw 'canvas' strokes */ + GP_DRAWDATA_ONLYV2D = (1 << 2), + /** only draw 'image' strokes */ + GP_DRAWDATA_ONLYI2D = (1 << 3), + /** special hack for drawing strokes in Image Editor (weird coordinates) */ + GP_DRAWDATA_IEDITHACK = (1 << 4), + /** don't draw xray in 3D view (which is default) */ + GP_DRAWDATA_NO_XRAY = (1 << 5), + /** no onionskins should be drawn (for animation playback) */ + GP_DRAWDATA_NO_ONIONS = (1 << 6), } eDrawStrokeFlags; @@ -272,7 +279,8 @@ static void gp_draw_stroke_3d( * Note: we want more visible levels of pressures when thickness is bigger. */ if (fabsf(pt->pressure - curpressure) > 0.2f / (float)thickness) { - /* if the pressure changes before get at least 2 vertices, need to repeat last point to avoid assert in immEnd() */ + /* if the pressure changes before get at least 2 vertices, + * need to repeat last point to avoid assert in immEnd() */ if (draw_points < 2) { const bGPDspoint *pt2 = pt - 1; immVertex3fv(pos, &pt2->x); @@ -954,7 +962,8 @@ static void gp_draw_data_all( gpd_source = (scene->gpd ? scene->gpd : NULL); } else if (spacetype == SPACE_CLIP && scene->clip) { - /* currently drawing only gpencil data from either clip or track, but not both - XXX fix logic behind */ + /* currently drawing only gpencil data from either clip or track, + * but not both - XXX fix logic behind */ gpd_source = (scene->clip->gpd ? scene->clip->gpd : NULL); } diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index 7991c317468..a5382ebf8e2 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -2370,7 +2370,8 @@ void GPENCIL_OT_annotate(wmOperatorType *ot) prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); - /* NOTE: wait for input is enabled by default, so that all UI code can work properly without needing users to know about this */ + /* NOTE: wait for input is enabled by default, + * so that all UI code can work properly without needing users to know about this */ prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "Wait for first click instead of painting immediately"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); } diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 392c670696b..87c7017c677 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -90,15 +90,24 @@ /* ----- General Defines ------ */ /* flags for sflag */ typedef enum eDrawStrokeFlags { - GP_DRAWDATA_NOSTATUS = (1 << 0), /* don't draw status info */ - GP_DRAWDATA_ONLY3D = (1 << 1), /* only draw 3d-strokes */ - GP_DRAWDATA_ONLYV2D = (1 << 2), /* only draw 'canvas' strokes */ - GP_DRAWDATA_ONLYI2D = (1 << 3), /* only draw 'image' strokes */ - GP_DRAWDATA_IEDITHACK = (1 << 4), /* special hack for drawing strokes in Image Editor (weird coordinates) */ - GP_DRAWDATA_NO_XRAY = (1 << 5), /* don't draw xray in 3D view (which is default) */ - GP_DRAWDATA_NO_ONIONS = (1 << 6), /* no onionskins should be drawn (for animation playback) */ - GP_DRAWDATA_VOLUMETRIC = (1 << 7), /* draw strokes as "volumetric" circular billboards */ - GP_DRAWDATA_FILL = (1 << 8) /* fill insides/bounded-regions of strokes */ + /** don't draw status info */ + GP_DRAWDATA_NOSTATUS = (1 << 0), + /** only draw 3d-strokes */ + GP_DRAWDATA_ONLY3D = (1 << 1), + /** only draw 'canvas' strokes */ + GP_DRAWDATA_ONLYV2D = (1 << 2), + /** only draw 'image' strokes */ + GP_DRAWDATA_ONLYI2D = (1 << 3), + /** special hack for drawing strokes in Image Editor (weird coordinates) */ + GP_DRAWDATA_IEDITHACK = (1 << 4), + /** don't draw xray in 3D view (which is default) */ + GP_DRAWDATA_NO_XRAY = (1 << 5), + /** no onionskins should be drawn (for animation playback) */ + GP_DRAWDATA_NO_ONIONS = (1 << 6), + /** draw strokes as "volumetric" circular billboards */ + GP_DRAWDATA_VOLUMETRIC = (1 << 7), + /** fill insides/bounded-regions of strokes */ + GP_DRAWDATA_FILL = (1 << 8) } eDrawStrokeFlags; @@ -342,7 +351,10 @@ static void gp_draw_stroke_volumetric_buffer( const tGPspoint *pt = points; for (int i = 0; i < totpoints; i++, pt++) { gp_set_tpoint_varying_color(pt, ink, color); - immAttr1f(size, pt->pressure * thickness); /* TODO: scale based on view transform (zoom level) */ + + /* TODO: scale based on view transform (zoom level) */ + immAttr1f(size, pt->pressure * thickness); + immVertex2f(pos, pt->x, pt->y); } @@ -403,8 +415,10 @@ static void gp_draw_stroke_volumetric_3d( const bGPDspoint *pt = points; for (int i = 0; i < totpoints && pt; i++, pt++) { gp_set_point_varying_color(pt, ink, color); - immAttr1f(size, pt->pressure * thickness); /* TODO: scale based on view transform */ - immVertex3fv(pos, &pt->x); /* we can adjust size in vertex shader based on view/projection! */ + /* TODO: scale based on view transform */ + immAttr1f(size, pt->pressure * thickness); + /* we can adjust size in vertex shader based on view/projection! */ + immVertex3fv(pos, &pt->x); } immEnd(); diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 412330ccf5c..3f21a076bea 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -707,7 +707,8 @@ static bool gp_brush_twist_apply( axis_angle_normalized_to_mat3(rmat, axis, angle); /* Rotate point (no matrix-space transforms needed, as GP points are in world space) */ - sub_v3_v3v3(vec, &pt->x, gso->dvec); /* make relative to center (center is stored in dvec) */ + sub_v3_v3v3(vec, &pt->x, gso->dvec); /* make relative to center + * (center is stored in dvec) */ mul_m3_v3(rmat, vec); add_v3_v3v3(&pt->x, vec, gso->dvec); /* restore */ diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index cb3fcba45e1..a880e6c3bf6 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -1129,7 +1129,7 @@ static int gp_camera_view_subrect(bContext *C, rctf *subrect) if (rv3d->persp == RV3D_CAMOB) { Scene *scene = CTX_data_scene(C); Depsgraph *depsgraph = CTX_data_depsgraph(C); - ED_view3d_calc_camera_border(scene, depsgraph, ar, v3d, rv3d, subrect, true); /* no shift */ + ED_view3d_calc_camera_border(scene, depsgraph, ar, v3d, rv3d, subrect, true); return 1; } } @@ -1137,7 +1137,8 @@ static int gp_camera_view_subrect(bContext *C, rctf *subrect) return 0; } -/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */ +/* convert a given grease-pencil layer to a 3d-curve representation + * (using current view if appropriate) */ static void gp_layer_to_curve( bContext *C, ReportList *reports, bGPdata *gpd, bGPDlayer *gpl, const int mode, const bool norm_weights, const float rad_fac, const bool link_strokes, tGpTimingData *gtd) @@ -1190,7 +1191,8 @@ static void gp_layer_to_curve( const bool add_start_point = (link_strokes && !(prev_gps)); const bool add_end_point = (link_strokes && !(gps->next)); - /* Detect new strokes created because of GP_STROKE_BUFFER_MAX reached, and stitch them to previous one. */ + /* Detect new strokes created because of GP_STROKE_BUFFER_MAX reached, + * and stitch them to previous one. */ bool stitch = false; if (prev_gps) { bGPDspoint *pt1 = &prev_gps->points[prev_gps->totpoints - 1]; diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 8afb0cafeb9..33521d7b53e 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -112,7 +112,8 @@ static int gp_data_add_exec(bContext *C, wmOperator *op) } else { /* decrement user count and add new datablock */ - /* TODO: if a datablock exists, we should make a copy of it instead of starting fresh (as in other areas) */ + /* TODO: if a datablock exists, + * we should make a copy of it instead of starting fresh (as in other areas) */ Main *bmain = CTX_data_main(C); /* decrement user count of old GP datablock */ @@ -1887,7 +1888,8 @@ static void joined_gpencil_fix_animdata_cb(ID *id, FCurve *fcu, void *user_data) const char *old_name = BLI_ghashIterator_getKey(&gh_iter); const char *new_name = BLI_ghashIterator_getValue(&gh_iter); - /* only remap if changed; this still means there will be some waste if there aren't many drivers/keys */ + /* only remap if changed; + * this still means there will be some waste if there aren't many drivers/keys */ if (!STREQ(old_name, new_name) && strstr(fcu->rna_path, old_name)) { fcu->rna_path = BKE_animsys_fix_rna_path_rename( id, fcu->rna_path, "layers", diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 5c6f7de9426..a71545cf392 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -629,7 +629,9 @@ static void gp_duplicate_points(const bGPDstroke *gps, ListBase *new_strokes, co /* make a stupid copy first of the entire stroke (to get the flags too) */ gpsd = MEM_dupallocN(gps); - BLI_strncpy(gpsd->runtime.tmp_layerinfo, layername, sizeof(gpsd->runtime.tmp_layerinfo)); /* saves original layer name */ + + /* saves original layer name */ + BLI_strncpy(gpsd->runtime.tmp_layerinfo, layername, sizeof(gpsd->runtime.tmp_layerinfo)); /* initialize triangle memory - will be calculated on next redraw */ gpsd->triangles = NULL; @@ -930,7 +932,8 @@ static int gp_strokes_copy_exec(bContext *C, wmOperator *op) /* make direct copies of the stroke and its points */ gpsd = MEM_dupallocN(gps); - BLI_strncpy(gpsd->runtime.tmp_layerinfo, gpl->info, sizeof(gpsd->runtime.tmp_layerinfo)); /* saves original layer name */ + /* saves original layer name */ + BLI_strncpy(gpsd->runtime.tmp_layerinfo, gpl->info, sizeof(gpsd->runtime.tmp_layerinfo)); gpsd->points = MEM_dupallocN(gps->points); if (gps->dvert != NULL) { gpsd->dvert = MEM_dupallocN(gps->dvert); @@ -3061,13 +3064,15 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op) } else { /* Geometry - Snap to surfaces of visible geometry */ - /* XXX: There will be precision loss (possible stairstep artifacts) from this conversion to satisfy the API's */ + /* XXX: There will be precision loss (possible stairstep artifacts) + * from this conversion to satisfy the API's */ const int screen_co[2] = {(int)xy[0], (int)xy[1]}; int depth_margin = 0; // XXX: 4 for strokes, 0 for normal float depth; - /* XXX: The proper procedure computes the depths into an array, to have smooth transitions when all else fails... */ + /* XXX: The proper procedure computes the depths into an array, + * to have smooth transitions when all else fails... */ if (ED_view3d_autodist_depth(gsc.ar, screen_co, depth_margin, &depth)) { ED_view3d_autodist_simple(gsc.ar, screen_co, &pt->x, 0, &depth); } diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index aa1a3a6cc76..dceb1b46898 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -91,39 +91,67 @@ typedef struct tGPDfill { bContext *C; struct Main *bmain; struct Depsgraph *depsgraph; - struct wmWindow *win; /* window where painting originated */ - struct Scene *scene; /* current scene from context */ - struct Object *ob; /* current active gp object */ - struct ScrArea *sa; /* area where painting originated */ - struct RegionView3D *rv3d; /* region where painting originated */ - struct View3D *v3d; /* view3 where painting originated */ - struct ARegion *ar; /* region where painting originated */ - struct bGPdata *gpd; /* current GP datablock */ - struct Material *mat; /* current material */ - struct bGPDlayer *gpl; /* layer */ - struct bGPDframe *gpf; /* frame */ - - short flag; /* flags */ - short oldkey; /* avoid too fast events */ - bool on_back; /* send to back stroke */ - - int center[2]; /* mouse fill center position */ - int sizex; /* windows width */ - int sizey; /* window height */ - int lock_axis; /* lock to viewport axis */ - - short fill_leak; /* number of pixel to consider the leak is too small (x 2) */ - float fill_threshold; /* factor for transparency */ - int fill_simplylvl; /* number of simplify steps */ - int fill_draw_mode; /* boundary limits drawing mode */ - - short sbuffer_size; /* number of elements currently in cache */ - void *sbuffer; /* temporary points */ - float *depth_arr; /* depth array for reproject */ - - Image *ima; /* temp image */ - BLI_Stack *stack; /* temp points data */ - void *draw_handle_3d; /* handle for drawing strokes while operator is running 3d stuff */ + /** window where painting originated */ + struct wmWindow *win; + /** current scene from context */ + struct Scene *scene; + /** current active gp object */ + struct Object *ob; + /** area where painting originated */ + struct ScrArea *sa; + /** region where painting originated */ + struct RegionView3D *rv3d; + /** view3 where painting originated */ + struct View3D *v3d; + /** region where painting originated */ + struct ARegion *ar; + /** current GP datablock */ + struct bGPdata *gpd; + /** current material */ + struct Material *mat; + /** layer */ + struct bGPDlayer *gpl; + /** frame */ + struct bGPDframe *gpf; + + /** flags */ + short flag; + /** avoid too fast events */ + short oldkey; + /** send to back stroke */ + bool on_back; + + /** mouse fill center position */ + int center[2]; + /** windows width */ + int sizex; + /** window height */ + int sizey; + /** lock to viewport axis */ + int lock_axis; + + /** number of pixel to consider the leak is too small (x 2) */ + short fill_leak; + /** factor for transparency */ + float fill_threshold; + /** number of simplify steps */ + int fill_simplylvl; + /** boundary limits drawing mode */ + int fill_draw_mode; + + /** number of elements currently in cache */ + short sbuffer_size; + /** temporary points */ + void *sbuffer; + /** depth array for reproject */ + float *depth_arr; + + /** temp image */ + Image *ima; + /** temp points data */ + BLI_Stack *stack; + /** handle for drawing strokes while operator is running 3d stuff */ + void *draw_handle_3d; } tGPDfill; diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index 56ddf81f357..0ccc8791667 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -107,79 +107,135 @@ typedef struct tGPDdraw { typedef struct tGPDinterpolate_layer { struct tGPDinterpolate_layer *next, *prev; - struct bGPDlayer *gpl; /* layer */ - struct bGPDframe *prevFrame; /* frame before current frame (interpolate-from) */ - struct bGPDframe *nextFrame; /* frame after current frame (interpolate-to) */ - struct bGPDframe *interFrame; /* interpolated frame */ - float factor; /* interpolate factor */ + /** layer */ + struct bGPDlayer *gpl; + /** frame before current frame (interpolate-from) */ + struct bGPDframe *prevFrame; + /** frame after current frame (interpolate-to) */ + struct bGPDframe *nextFrame; + /** interpolated frame */ + struct bGPDframe *interFrame; + /** interpolate factor */ + float factor; } tGPDinterpolate_layer; typedef struct tGPDinterpolate { - struct Scene *scene; /* current scene from context */ - struct ScrArea *sa; /* area where painting originated */ - struct ARegion *ar; /* region where painting originated */ - struct bGPdata *gpd; /* current GP datablock */ - struct Material *mat; /* current material */ - - int cframe; /* current frame number */ - ListBase ilayers; /* (tGPDinterpolate_layer) layers to be interpolated */ - float shift; /* value for determining the displacement influence */ - float init_factor; /* initial interpolation factor for active layer */ - float low_limit; /* shift low limit (-100%) */ - float high_limit; /* shift upper limit (200%) */ - int flag; /* flag from toolsettings */ + /** current scene from context */ + struct Scene *scene; + /** area where painting originated */ + struct ScrArea *sa; + /** region where painting originated */ + struct ARegion *ar; + /** current GP datablock */ + struct bGPdata *gpd; + /** current material */ + struct Material *mat; + + /** current frame number */ + int cframe; + /** (tGPDinterpolate_layer) layers to be interpolated */ + ListBase ilayers; + /** value for determining the displacement influence */ + float shift; + /** initial interpolation factor for active layer */ + float init_factor; + /** shift low limit (-100%) */ + float low_limit; + /** shift upper limit (200%) */ + float high_limit; + /** flag from toolsettings */ + int flag; NumInput num; /* numeric input */ - void *draw_handle_3d; /* handle for drawing strokes while operator is running 3d stuff */ - void *draw_handle_screen; /* handle for drawing strokes while operator is running screen stuff */ + /** handle for drawing strokes while operator is running 3d stuff */ + void *draw_handle_3d; + /** handle for drawing strokes while operator is running screen stuff */ + void *draw_handle_screen; } tGPDinterpolate; /* Temporary primitive operation data */ typedef struct tGPDprimitive { - struct Main *bmain; /* main database pointer */ + /** main database pointer */ + struct Main *bmain; struct Depsgraph *depsgraph; - struct wmWindow *win; /* window where painting originated */ - struct Scene *scene; /* current scene from context */ - struct Object *ob; /* current active gp object */ - struct ScrArea *sa; /* area where painting originated */ - struct RegionView3D *rv3d; /* region where painting originated */ - struct View3D *v3d; /* view3d where painting originated */ - struct ARegion *ar; /* region where painting originated */ - struct bGPdata *gpd; /* current GP datablock */ - struct Material *mat; /* current material */ - struct Brush *brush; /* current brush */ - - int cframe; /* current frame number */ - struct bGPDlayer *gpl; /* layer */ - struct bGPDframe *gpf; /* frame */ - int type; /* type of primitive */ - int orign_type; /* original type of primitive */ - bool curve; /* type of primitive is a curve */ - int brush_size; /* brush size */ - float brush_strength; /* brush strength */ - short flip; /* flip option */ - tGPspoint *points; /* array of data-points for stroke */ - int point_count; /* number of edges allocated */ - int tot_stored_edges; /* stored number of polygon edges */ - int tot_edges; /* number of polygon edges */ - float move[2]; /* move distance */ - float origin[2]; /* initial box corner */ - float start[2]; /* first box corner */ - float end[2]; /* last box corner */ - float midpoint[2]; /* midpoint box corner */ - float cp1[2]; /* first control point */ - float cp2[2]; /* second control point */ - int sel_cp; /* flag to determine control point is selected */ - int flag; /* flag to determine operations in progress */ - float mval[2]; /* recorded mouse-position */ - float mvalo[2]; /* previous recorded mouse-position */ - - int lock_axis; /* lock to viewport axis */ + /** window where painting originated */ + struct wmWindow *win; + /** current scene from context */ + struct Scene *scene; + /** current active gp object */ + struct Object *ob; + /** area where painting originated */ + struct ScrArea *sa; + /** region where painting originated */ + struct RegionView3D *rv3d; + /** view3d where painting originated */ + struct View3D *v3d; + /** region where painting originated */ + struct ARegion *ar; + /** current GP datablock */ + struct bGPdata *gpd; + /** current material */ + struct Material *mat; + /** current brush */ + struct Brush *brush; + + /** current frame number */ + int cframe; + /** layer */ + struct bGPDlayer *gpl; + /** frame */ + struct bGPDframe *gpf; + /** type of primitive */ + int type; + /** original type of primitive */ + int orign_type; + /** type of primitive is a curve */ + bool curve; + /** brush size */ + int brush_size; + /** brush strength */ + float brush_strength; + /** flip option */ + short flip; + /** array of data-points for stroke */ + tGPspoint *points; + /** number of edges allocated */ + int point_count; + /** stored number of polygon edges */ + int tot_stored_edges; + /** number of polygon edges */ + int tot_edges; + /** move distance */ + float move[2]; + /** initial box corner */ + float origin[2]; + /** first box corner */ + float start[2]; + /** last box corner */ + float end[2]; + /** midpoint box corner */ + float midpoint[2]; + /** first control point */ + float cp1[2]; + /** second control point */ + float cp2[2]; + /** flag to determine control point is selected */ + int sel_cp; + /** flag to determine operations in progress */ + int flag; + /** recorded mouse-position */ + float mval[2]; + /** previous recorded mouse-position */ + float mvalo[2]; + + /** lock to viewport axis */ + int lock_axis; struct RNG *rng; - NumInput num; /* numeric input */ + /** numeric input */ + NumInput num; } tGPDprimitive; diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 86a8e3479f3..4b1706f50b7 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -1112,7 +1112,8 @@ static int gpencil_interpolate_reverse_exec(bContext *C, wmOperator *UNUSED(op)) gpf = gpf->prev; } else { - /* Not a breakdown (may be a key, or an extreme, or something else that wasn't generated)... stop */ + /* Not a breakdown (may be a key, or an extreme, + * or something else that wasn't generated)... stop */ break; } } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index baf8ca41062..46b3d539477 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -2931,7 +2931,8 @@ static void gpencil_draw_apply_event(bContext *C, wmOperator *op, const wmEvent gpencil_draw_apply(C, op, p, depsgraph); /* force refresh */ - ED_region_tag_redraw(p->ar); /* just active area for now, since doing whole screen is too slow */ + /* just active area for now, since doing whole screen is too slow */ + ED_region_tag_redraw(p->ar); } /* ------------------------------- */ @@ -3761,7 +3762,8 @@ void GPENCIL_OT_draw(wmOperatorType *ot) prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); - /* NOTE: wait for input is enabled by default, so that all UI code can work properly without needing users to know about this */ + /* NOTE: wait for input is enabled by default, + * so that all UI code can work properly without needing users to know about this */ prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "Wait for first click instead of painting immediately"); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index fb5efb01f94..7d0d71bd348 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -998,7 +998,8 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op) bool select = !RNA_boolean_get(op->ptr, "deselect"); GP_SpaceConversion gsc = {NULL}; - rcti rect = {0}; /* for bounding rect around circle (for quicky intersection testing) */ + /* for bounding rect around circle (for quicky intersection testing) */ + rcti rect = {0}; bool changed = false; diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 36ae1a211d3..226a2bc7a98 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -140,7 +140,8 @@ bGPdata **ED_gpencil_data_get_pointers_direct(ID *screen_id, ScrArea *sa, Scene /* return the GP data for the active node block/node */ if (snode && snode->nodetree) { - /* for now, as long as there's an active node tree, default to using that in the Nodes Editor */ + /* for now, as long as there's an active node tree, + * default to using that in the Nodes Editor */ if (r_ptr) RNA_id_pointer_create(&snode->nodetree->id, r_ptr); return &snode->nodetree->gpd; } @@ -546,7 +547,7 @@ void gp_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc) /* for camera view set the subrect */ if (rv3d->persp == RV3D_CAMOB) { - ED_view3d_calc_camera_border(scene, CTX_data_depsgraph(C), ar, v3d, rv3d, &r_gsc->subrect_data, true); /* no shift */ + ED_view3d_calc_camera_border(scene, CTX_data_depsgraph(C), ar, v3d, rv3d, &r_gsc->subrect_data, true); r_gsc->subrect = &r_gsc->subrect_data; } } @@ -1215,7 +1216,8 @@ void ED_gpencil_parent_location( mul_m4_m4m4(diff_mat, tmp_mat, gpl->inverse); } else { - mul_m4_m4m4(diff_mat, obparent_eval->obmat, gpl->inverse); /* if bone not found use object (armature) */ + /* if bone not found use object (armature) */ + mul_m4_m4m4(diff_mat, obparent_eval->obmat, gpl->inverse); } return; } |