158 bool is_object =
false;
224 if (
G.background ==
false) {
236 ot->
name =
"Strokes Edit Mode Toggle";
237 ot->
idname =
"GPENCIL_OT_editmode_toggle";
238 ot->
description =
"Enter/Exit edit mode for Grease Pencil strokes";
249 ot->
srna,
"back", 0,
"Return to Previous Mode",
"Return to previous mode");
277 bool changed =
false;
294 for (
int i = 0; i < gps->totpoints; i++) {
295 pt = &gps->points[i];
318 ot->
name =
"Select Mode Toggle";
319 ot->
idname =
"GPENCIL_OT_selectmode_toggle";
320 ot->
description =
"Set selection mode for Grease Pencil strokes";
330 prop =
RNA_def_int(
ot->
srna,
"mode", 0, 0, 2,
"Select Mode",
"Select mode", 0, 2);
359 bool is_object =
false;
421 if (
G.background ==
false) {
433 ot->
name =
"Strokes Paint Mode Toggle";
434 ot->
idname =
"GPENCIL_OT_paintmode_toggle";
435 ot->
description =
"Enter/Exit paint mode for Grease Pencil strokes";
446 ot->
srna,
"back", 0,
"Return to Previous Mode",
"Return to previous mode");
475 bool is_object =
false;
528 if (
G.background ==
false) {
546 ot->
name =
"Strokes Sculpt Mode Toggle";
547 ot->
idname =
"GPENCIL_OT_sculptmode_toggle";
548 ot->
description =
"Enter/Exit sculpt mode for Grease Pencil strokes";
559 ot->
srna,
"back", 0,
"Return to Previous Mode",
"Return to previous mode");
584 bool is_object =
false;
593 const bool is_mode_set = (ob->
mode & mode_flag) != 0;
642 if (
G.background ==
false) {
654 ot->
name =
"Strokes Weight Mode Toggle";
655 ot->
idname =
"GPENCIL_OT_weightmode_toggle";
656 ot->
description =
"Enter/Exit weight paint mode for Grease Pencil strokes";
667 ot->
srna,
"back", 0,
"Return to Previous Mode",
"Return to previous mode");
695 bool is_object =
false;
753 if (
G.background ==
false) {
765 ot->
name =
"Strokes Vertex Mode Toggle";
766 ot->
idname =
"GPENCIL_OT_vertexmode_toggle";
767 ot->
description =
"Enter/Exit vertex paint mode for Grease Pencil strokes";
778 ot->
srna,
"back", 0,
"Return to Previous Mode",
"Return to previous mode");
813 ot->
name =
"Hide Selected";
814 ot->
idname =
"GPENCIL_OT_selection_opacity_toggle";
815 ot->
description =
"Hide/Unhide selected points for Grease Pencil strokes setting alpha factor";
835 const char *layername)
846 for (i = 0, pt = gps->
points; i < gps->totpoints; i++, pt++) {
848 if (start_idx == -1) {
854 if ((start_idx != -1) || (start_idx == gps->
totpoints - 1)) {
865 len = i - start_idx + 1;
889 for (
int j = 0; j < gpsd->
totpoints; j++) {
926 bool changed =
false;
979 for (i = 0, pt = gps->
points; i < gps->totpoints; i++, pt++) {
1009 ot->
name =
"Duplicate Strokes";
1010 ot->
idname =
"GPENCIL_OT_duplicate";
1011 ot->
description =
"Duplicate the selected Grease Pencil strokes";
1057 dvert_final->
dw = dvert->
dw;
1071 const bool do_stroke = (do_first || do_last);
1074 for (
int i = 0; i < gps->
totpoints; i++) {
1111 int totnewpoints, oldtotpoints;
1113 if ((do_first) || (do_last)) {
1142 for (
int i = 0; i < oldtotpoints; i++) {
1161 gps, temp_points, temp_dverts, oldtotpoints - 1, gps->
totpoints - 1,
true);
1237 last_select =
false;
1240 if (first_select || last_select) {
1241 int new_num_points = old_num_points;
1292 bool changed =
false;
1294 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
1297 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
1302 for (gps = gpf->strokes.first; gps; gps = gps->
next) {
1308 if (is_curve_edit) {
1326 if (!is_multiedit) {
1348 ot->
name =
"Extrude Stroke Points";
1350 ot->
description =
"Extrude the selected Grease Pencil points";
1502 if (is_curve_edit) {
1592 ot->
name =
"Copy Strokes";
1594 ot->
description =
"Copy selected Grease Pencil points and strokes";
1653 "No strokes to paste, select and copy some points before trying again");
1663 op->
reports,
RPT_ERROR,
"Can not paste strokes when active layer is hidden or locked");
1688 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
1700 if (is_curve_edit) {
1776 ot->
name =
"Paste Strokes";
1778 ot->
description =
"Paste previously copied strokes to active layer or to original layer";
1791 ot->
srna,
"paste_back", 0,
"Paste on Back",
"Add pasted strokes behind all strokes");
1817 if (layer_num > -1) {
1829 strcpy(name,
"GP_Layer");
1834 if (target_layer ==
NULL) {
1846 if (gpl_src == target_layer) {
1849 bGPDframe *init_gpf = (is_multiedit) ? gpl_src->frames.first : gpl_src->actframe;
1850 for (
bGPDframe *gpf_src = init_gpf; gpf_src; gpf_src = gpf_src->
next) {
1851 if ((gpf_src == gpl_src->actframe) ||
1853 if (gpf_src ==
NULL) {
1859 for (
bGPDstroke *gps = gpf_src->strokes.first; gps; gps = gpsn) {
1876 if (strokes.first) {
1881 BLI_assert((strokes.first == strokes.last) && (strokes.first ==
NULL));
1885 if (!is_multiedit) {
1890 if ((layer_num == -1) && (use_autolock)) {
1912 if (strstr(gpl->info,
"GP_Layer")) {
1921 char *name =
BLI_sprintfN(
"%.*s.%03d", 128,
"GP_Layer", index);
1949 ot->
name =
"Move Strokes to Layer";
1950 ot->
idname =
"GPENCIL_OT_move_to_layer";
1952 "Move selected strokes to another layer";
1963 prop =
RNA_def_int(
ot->
srna,
"layer", 0, -1, INT_MAX,
"Grease Pencil Layer",
"", -1, INT_MAX);
1967 ot->
srna,
"new_layer_name",
NULL,
MAX_NAME,
"Name",
"Name of the newly added layer");
1999 if ((all_layers ==
false) && (gpl != active_gpl)) {
2007 for (; gpf; gpf = gpf->
next) {
2029 ot->
name =
"Insert Blank Frame";
2030 ot->
idname =
"GPENCIL_OT_blank_frame_add";
2032 "Insert a blank frame on the current frame "
2033 "(all subsequently existing frames, if any, are shifted right by one frame)";
2046 "Create blank frame in all layers, not only active");
2077 const bool is_annotation =
STREQ(op->
idname,
"GPENCIL_OT_annotation_active_frame_delete");
2111 ot->
name =
"Delete Active Frame";
2112 ot->
idname =
"GPENCIL_OT_active_frame_delete";
2113 ot->
description =
"Delete the active frame for the active Grease Pencil Layer";
2125 ot->
name =
"Delete Active Frame";
2126 ot->
idname =
"GPENCIL_OT_annotation_active_frame_delete";
2127 ot->
description =
"Delete the active frame for the active Annotation Layer";
2157 bool success =
false;
2188 ot->
name =
"Delete All Active Frames";
2189 ot->
idname =
"GPENCIL_OT_active_frames_delete_all";
2190 ot->
description =
"Delete the active frame(s) of all editable Grease Pencil layers";
2229 bool changed =
false;
2231 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
2234 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
2276 bool changed =
false;
2280 int first = 0, last = 0;
2281 int num_points_remaining = gpc->tot_curve_points;
2285 for (
int i = 0; i < gpc->tot_curve_points; i++) {
2288 num_points_remaining--;
2294 for (
int i = 0; i < gpc->tot_curve_points; i++) {
2304 for (
int i = first + 1; i < last; i++) {
2307 num_points_remaining--;
2312 for (
int i = 0; i < gpc->tot_curve_points; i++) {
2315 num_points_remaining--;
2324 if (num_points_remaining < 1) {
2336 for (
int i = 0; i < gpc->tot_curve_points; i++) {
2346 for (
int i = 0; i < first; i++) {
2354 for (
int i = first; i < last; i++) {
2363 for (
int i = last; i < gpc->tot_curve_points; i++) {
2372 for (
int i = 0; i < gpc->tot_curve_points; i++) {
2386 if (gpc->curve_points !=
NULL) {
2390 gpc->curve_points = new_points;
2391 gpc->tot_curve_points = num_points_remaining;
2410 bool changed =
false;
2421 int tot = gps->totpoints;
2427 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
2438 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
2447 for (i = first, pt = gps->points + first; i < last; i++, pt++) {
2455 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
2475 "new gp stroke points copy");
2481 if (gps->dvert !=
NULL) {
2488 (gps->dvert !=
NULL) ? dvert = gps->dvert :
NULL;
2489 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
2494 if (gps->dvert !=
NULL) {
2500 if (gps->dvert !=
NULL) {
2507 (gps->dvert !=
NULL) ? dvert = gps->dvert :
NULL;
2508 for (i = 0, pt = gps->points; i < first; i++, pt++) {
2512 if (gps->dvert !=
NULL) {
2520 (gps->dvert !=
NULL) ? dvert = gps->dvert + first :
NULL;
2521 for (i = first, pt = gps->points + first; i < last; i++, pt++) {
2526 if (gps->dvert !=
NULL) {
2532 if (gps->dvert !=
NULL) {
2537 (gps->dvert !=
NULL) ? dvert = gps->dvert + last :
NULL;
2538 for (i = last, pt = gps->points + last; i < gps->totpoints; i++, pt++) {
2542 if (gps->dvert !=
NULL) {
2553 (gps->dvert !=
NULL) ? dvert = gps->dvert :
NULL;
2554 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
2559 if (gps->dvert !=
NULL) {
2565 if (gps->dvert !=
NULL) {
2582 gps->points = new_points;
2583 gps->dvert = new_dvert;
2584 gps->totpoints = tot;
2592 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
2611 bool changed =
false;
2613 if (is_curve_edit) {
2637 bool changed =
false;
2640 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
2643 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
2666 if (is_curve_edit) {
2733 "Delete selected points and split strokes into segments"},
2742 ot->
description =
"Delete selected Grease Pencil strokes, vertices, or frames";
2755 prop_gpencil_delete_types,
2758 "Method used for deleting Grease Pencil data");
2782 "Dissolve points between selected points"},
2789 ot->
idname =
"GPENCIL_OT_dissolve";
2790 ot->
description =
"Delete selected points without splitting strokes";
2803 prop_gpencil_dissolve_types,
2806 "Method used for dissolving stroke points");
2839 bool changed =
false;
2844 float diff_mat[4][4];
2859 if (is_curve_edit) {
2860 if (gps->editcurve ==
NULL) {
2863 float inv_diff_mat[4][4];
2871 float tmp0[3], tmp1[3], tmp2[3],
offset[3];
2877 offset[0] = gridf *
floorf(0.5f + tmp1[0] / gridf) - tmp1[0];
2878 offset[1] = gridf *
floorf(0.5f + tmp1[1] / gridf) - tmp1[1];
2879 offset[2] = gridf *
floorf(0.5f + tmp1[2] / gridf) - tmp1[2];
2905 for (
int i = 0; i < gps->totpoints; i++) {
2913 fpt[0] = gridf *
floorf(0.5f + fpt[0] / gridf);
2914 fpt[1] = gridf *
floorf(0.5f + fpt[1] / gridf);
2915 fpt[2] = gridf *
floorf(0.5f + fpt[2] / gridf);
2941 ot->
name =
"Snap Selection to Grid";
2942 ot->
idname =
"GPENCIL_OT_snap_to_grid";
2943 ot->
description =
"Snap selected points to the nearest grid points";
2970 bool changed =
false;
2971 if (is_curve_edit) {
2979 float diff_mat[4][4];
3009 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
3017 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
3043 ot->
name =
"Snap Selection to Cursor";
3044 ot->
idname =
"GPENCIL_OT_snap_to_cursor";
3045 ot->
description =
"Snap selected points/strokes to the cursor";
3059 "Offset the entire stroke instead of selected points only");
3072 float r_centroid[3],
3077 bool changed =
false;
3083 float diff_mat[4][4];
3105 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
3136 float centroid[3] = {0.0f};
3142 bool changed =
false;
3143 if (is_curve_edit) {
3172 ot->
name =
"Snap Cursor to Selected Points";
3173 ot->
idname =
"GPENCIL_OT_snap_cursor_to_selected";
3174 ot->
description =
"Snap cursor to center of selected points";
3204 if ((gps->thickness == 0) && (gpl->
line_change == 0)) {
3208 gps->thickness = gps->thickness + gpl->
line_change;
3227 ot->
name =
"Apply Stroke Thickness";
3228 ot->
idname =
"GPENCIL_OT_stroke_apply_thickness";
3229 ot->
description =
"Apply the thickness change of the layer to its strokes";
3264 bool changed =
false;
3267 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
3270 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
3275 for (gps = gpf->strokes.first; gps; gps = gps->
next) {
3309 if (is_curve_edit) {
3324 if (!is_multiedit) {
3349 if (!
STREQ(prop_id,
"type")) {
3369 ot->
name =
"Set Cyclical State";
3370 ot->
idname =
"GPENCIL_OT_stroke_cyclical_set";
3371 ot->
description =
"Close or open the selected stroke adding an edge from last to first point";
3384 ot->
srna,
"geometry",
false,
"Create Geometry",
"Create new geometry for closing stroke");
3413 bool changed =
false;
3416 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
3419 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
3424 for (
bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->
next) {
3438 short prev_first = gps->caps[0];
3439 short prev_last = gps->caps[1];
3458 if (prev_first != gps->caps[0] || prev_last != gps->caps[1]) {
3463 if (!is_multiedit) {
3491 ot->
name =
"Set Caps Mode";
3492 ot->
idname =
"GPENCIL_OT_stroke_caps_set";
3493 ot->
description =
"Change stroke caps mode (rounded or flat)";
3520 const int totstrokes)
3523 float min_dist = FLT_MAX;
3524 float dist, start_a[3], end_a[3], start_b[3], end_b[3];
3532 for (
int i = 0; i < totstrokes; i++) {
3544 if (dist < min_dist) {
3549 if (dist < min_dist) {
3554 if (dist < min_dist) {
3559 if (dist < min_dist) {
3576 const int max_join_strokes = 128;
3587 if (is_curve_edit) {
3597 int tot_strokes = 0;
3619 elem = &strokes_list[tot_strokes];
3626 if (tot_strokes == max_join_strokes) {
3629 "Too many strokes selected, only joined first %d strokes",
3639 if (tot_strokes < 2) {
3645 elem = &strokes_list[0];
3659 elem = &strokes_list[i];
3670 for (
int i = 0; i < tot_strokes; i++) {
3671 elem = &strokes_list[i];
3696 ot->
name =
"Join Strokes";
3697 ot->
idname =
"GPENCIL_OT_stroke_join";
3698 ot->
description =
"Join selected strokes (optionally as new stroke)";
3713 "Leave gaps between joined strokes instead of linking them");
3735 bool changed =
false;
3738 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
3741 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
3756 if (is_curve_edit) {
3768 if (!is_multiedit) {
3787 ot->
name =
"Flip Stroke";
3788 ot->
idname =
"GPENCIL_OT_stroke_flip";
3789 ot->
description =
"Change direction of the points of the selected strokes";
3820 bool changed =
false;
3824 int cfra_prv = INT_MIN;
3828 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
3831 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
3835 for (
bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->
next) {
3840 bool curve_select =
false;
3841 if (is_curve_edit && gps->editcurve !=
NULL) {
3849 cfra_prv = gpf->framenum;
3856 if (is_curve_edit && gps->editcurve !=
NULL) {
3870 if (!is_multiedit) {
3897 {
GP_REPROJECT_FRONT,
"FRONT", 0,
"Front",
"Reproject the strokes using the X-Z plane"},
3898 {
GP_REPROJECT_SIDE,
"SIDE", 0,
"Side",
"Reproject the strokes using the Y-Z plane"},
3899 {
GP_REPROJECT_TOP,
"TOP", 0,
"Top",
"Reproject the strokes using the X-Y plane"},
3904 "Reproject the strokes to end up on the same plane, as if drawn from the current "
3906 "using 'Cursor' Stroke Placement"},
3911 "Reproject the strokes on to the scene geometry, as if drawn using 'Surface' placement"},
3916 "Reproject the strokes using the orientation of 3D cursor"},
3921 ot->
name =
"Reproject Strokes";
3922 ot->
idname =
"GPENCIL_OT_reproject";
3924 "Reproject the selected strokes from the current viewpoint as if they had been newly "
3926 "(e.g. to fix problems from accidental 3D cursor movement or accidental viewport changes, "
3927 "or for matching deforming geometry)";
3946 "Keep original strokes and create a copy before reprojecting instead of reproject them");
3974 ot->
name =
"Recalculate internal geometry";
3975 ot->
idname =
"GPENCIL_OT_recalc_geometry";
4003 if (factor == 0.0f) {
4012 bool need_update =
false;
4015 for (
int n = 0; n < repeat; n++) {
4016 for (
int i = 0; i < gps->totpoints; i++) {
4022 if (smooth_position) {
4026 if (smooth_strength) {
4029 if (smooth_thickness) {
4037 if (n < repeat - 1) {
4057 int totnewpoints = 0;
4058 for (i = 0, pt = gps->
points; i < gps->totpoints && pt; i++, pt++) {
4073 return totnewpoints;
4079 int totnewpoints, oldtotpoints;
4082 for (
int s = 0; s < cuts; s++) {
4084 if (totnewpoints == 0) {
4108 for (
int i = 0; i < oldtotpoints; i++) {
4121 dvert = &temp_dverts[i];
4122 dvert_final = &gps->
dvert[i2];
4124 dvert_final->
dw = dvert->
dw;
4130 if (i + 1 < oldtotpoints) {
4132 pt_final = &gps->
points[i2];
4134 dvert_final = &gps->
dvert[i2];
4148 dvert = &temp_dverts[i];
4149 dvert_next = &temp_dverts[i + 1];
4150 dvert_final = &gps->
dvert[i2];
4156 for (
int d = 0; d < dvert->
totweight; d++) {
4174 bGPDspoint *pt = &temp_points[oldtotpoints - 1];
4179 dvert_final = &gps->
dvert[i2];
4192 dvert = &temp_dverts[oldtotpoints - 1];
4193 dvert_next = &temp_dverts[0];
4194 dvert_final = &gps->
dvert[i2];
4200 for (
int d = 0; d < dvert->
totweight; d++) {
4230 bool changed =
false;
4231 if (is_curve_edit) {
4279 if (!
STREQ(prop_id,
"number_cuts")) {
4292 ot->
name =
"Subdivide Stroke";
4293 ot->
idname =
"GPENCIL_OT_stroke_subdivide";
4295 "Subdivide between continuous selected points of the stroke adding a point half way "
4308 prop =
RNA_def_int(
ot->
srna,
"number_cuts", 1, 1, 10,
"Number of Cuts",
"", 1, 5);
4320 "Smooth only selected points in the stroke");
4340 bool changed =
false;
4341 if (is_curve_edit) {
4370 ot->
name =
"Simplify Stroke";
4371 ot->
idname =
"GPENCIL_OT_stroke_simplify";
4372 ot->
description =
"Simplify selected stroked reducing number of points";
4400 bool changed =
false;
4401 if (is_curve_edit) {
4409 for (
int i = 0; i <
steps; i++) {
4431 ot->
name =
"Simplify Fixed Stroke";
4432 ot->
idname =
"GPENCIL_OT_stroke_simplify_fixed";
4433 ot->
description =
"Simplify selected stroked reducing number of points using fixed algorithm";
4443 prop =
RNA_def_int(
ot->
srna,
"step", 1, 1, 100,
"Steps",
"Number of simplify steps", 1, 10);
4481 ot->
name =
"Sample Stroke";
4482 ot->
idname =
"GPENCIL_OT_stroke_sample";
4483 ot->
description =
"Sample stroke points to predefined segment length";
4495 ot->
srna,
"sharp_threshold", 0.1f, 0.0f,
M_PI,
"Sharp Threshold",
"", 0.0f,
M_PI);
4520 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
4523 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
4537 if (is_curve_edit) {
4546 if (!is_multiedit) {
4564 ot->
name =
"Trim Stroke";
4565 ot->
idname =
"GPENCIL_OT_stroke_trim";
4566 ot->
description =
"Trim selected stroke to first loop or intersection";
4626 bool has_selected =
false;
4629 has_selected =
true;
4635 if (!has_selected) {
4646 ob_dst = base_new->
object;
4662 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
4665 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
4686 if (gpl_dst ==
NULL) {
4694 if (gpf_dst ==
NULL) {
4707 if (is_curve_edit) {
4712 bool all_points_selected =
true;
4713 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
4715 all_points_selected =
false;
4721 if (all_points_selected) {
4727 gps->prev = gps->next =
NULL;
4746 for (i = 0, pt = gps_dst->
points; i < gps_dst->totpoints; i++, pt++) {
4766 gps->prev = gps->next =
NULL;
4777 if (!is_multiedit) {
4791 else if (gpl->
next) {
4822 int actcol = ob_dst->
actcol;
4823 for (
int slot = 1; slot <= ob_dst->
totcol; slot++) {
4829 if (actcol >= slot) {
4854 {
GP_SEPARATE_POINT,
"POINT", 0,
"Selected Points",
"Separate the selected points"},
4855 {
GP_SEPARATE_STROKE,
"STROKE", 0,
"Selected Strokes",
"Separate the selected strokes"},
4856 {
GP_SEPARATE_LAYER,
"LAYER", 0,
"Active Layer",
"Separate the strokes of the current layer"},
4861 ot->
name =
"Separate Strokes";
4862 ot->
idname =
"GPENCIL_OT_stroke_separate";
4863 ot->
description =
"Separate the selected strokes or layer in a new grease pencil object";
4899 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
4902 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
4920 if (is_curve_edit) {
4931 for (i = 0, pt = gps_dst->
points; i < gps_dst->totpoints; i++, pt++) {
4948 for (
int i2 = 0; i2 < gps->totpoints; i2++, ptn++) {
4958 if (!is_multiedit) {
4975 ot->
name =
"Split Strokes";
4976 ot->
idname =
"GPENCIL_OT_stroke_split";
4977 ot->
description =
"Split selected points as new stroke on same frame";
5016 ot->
name =
"Smooth Stroke";
5017 ot->
idname =
"GPENCIL_OT_stroke_smooth";
5036 "Smooth only selected points in the stroke");
5059 const float diff_mat[4][4],
5075 const float diff_mat[4][4],
5081 const bool flat_caps)
5090 for (i = 0, pt = hit_stroke->
points; i < hit_stroke->totpoints; i++, pt++) {
5097 if (((totselect == 1) && (hit_stroke->
totpoints == 2)) || (hit_stroke->
totpoints == totselect)) {
5104 if ((hit_stroke) && (hit_stroke->
totpoints == 2)) {
5105 pt = &hit_stroke->
points[0];
5106 pt1 = &hit_stroke->
points[1];
5116 for (i = 0, pt = hit_stroke->
points; i < hit_stroke->totpoints; i++, pt++) {
5158 bool changed =
false;
5171 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
5176 for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
5185 if (!is_multiedit) {
5197 float diff_mat[4][4];
5200 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
5202 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
5215 const int oldtot = gps->totpoints;
5216 for (
int i = 0; i < gps->totpoints; i++) {
5217 pt = &gps->points[i];
5229 float r_hita[3], r_hitb[3];
5230 if (gps->totpoints > 1) {
5232 gpd, gpl, gps, pt,
true,
true, scale, r_hita, r_hitb);
5235 if (gps->totpoints > oldtot) {
5241 if ((tot_inside == oldtot) || ((tot_inside == 1) && (oldtot == 2))) {
5242 for (
int i = 0; i < gps->totpoints; i++) {
5243 pt = &gps->points[i];
5249 if (!is_multiedit) {
5258 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
5261 gpl->actframe = gpf;
5268 if (!is_multiedit) {
5272 gpl->actframe = gpf_act;
5328 ot->
name =
"Stroke Cutter";
5330 ot->
idname =
"GPENCIL_OT_stroke_cutter";
5404 if (is_curve_edit) {
5429 ot->
name =
"Merge by Distance";
5430 ot->
idname =
"GPENCIL_OT_stroke_merge_by_distance";
5441 prop =
RNA_def_float(
ot->
srna,
"threshold", 0.001f, 0.0f, 100.0f,
"Threshold",
"", 0.0f, 100.0f);
5446 ot->
srna,
"use_unselected", 0,
"Unselected",
"Use whole stroke, not only selected points");
5517 bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe;
5520 if ((gpf == gpl->actframe) || ((gpf->flag &
GP_FRAME_SELECT) && (is_multiedit))) {
5532 bool is_curve_ready = (gps->editcurve !=
NULL);
5533 bool selected = (is_curve_edit && is_curve_ready) ?
5540 float stroke_thickness_inv = 1.0f /
max_ii(gps->thickness, 1);
5543 gps->fill_opacity_fac = factor;
5544 CLAMP(gps->fill_opacity_fac, 0.0f, 1.0f);
5548 if (!is_curve_edit || !is_curve_ready) {
5549 for (
int i = 0; i < gps->totpoints; i++) {
5552 pt->
pressure =
max_ff((
float)value * stroke_thickness_inv, 0.0f);
5562 for (
int i = 0; i < gps->editcurve->tot_curve_points; i++) {
5565 gpc_pt->
pressure =
max_ff((
float)value * stroke_thickness_inv, 0.0f);
5578 if (!is_multiedit) {
5600 "Normalizes the stroke thickness by making all points use the same thickness value"},
5605 "Normalizes the stroke opacity by making all points use the same opacity value"},
5610 ot->
name =
"Normalize Stroke";
5611 ot->
idname =
"GPENCIL_OT_stroke_normalize";
5624 ot->
srna,
"mode", prop_gpencil_normalize_modes, 0,
"Mode",
"Attribute to be normalized");
void BKE_brush_gpencil_paint_presets(struct Main *bmain, struct ToolSettings *ts, bool reset)
void BKE_brush_gpencil_weight_presets(struct Main *bmain, struct ToolSettings *ts, bool reset)
void BKE_brush_gpencil_sculpt_presets(struct Main *bmain, struct ToolSettings *ts, bool reset)
void BKE_brush_gpencil_vertex_presets(struct Main *bmain, struct ToolSettings *ts, bool reset)
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct Base * CTX_data_active_base(const bContext *C)
#define CTX_DATA_BEGIN(C, Type, instance, member)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct bGPDlayer * CTX_data_active_gpencil_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
#define CTX_DATA_COUNT(C, member)
struct wmMsgBus * CTX_wm_message_bus(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
void BKE_gpencil_stroke_select_index_set(struct bGPdata *gpd, struct bGPDstroke *gps)
void BKE_gpencil_layer_active_set(struct bGPdata *gpd, struct bGPDlayer *active)
struct bGPDstroke * BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, bool dup_points, bool dup_curve)
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
void BKE_gpencil_free_stroke_weights(struct bGPDstroke *gps)
int BKE_gpencil_object_material_ensure(struct Main *bmain, struct Object *ob, struct Material *material)
void BKE_gpencil_layer_mask_copy(const struct bGPDlayer *gpl_src, struct bGPDlayer *gpl_dst)
void BKE_gpencil_palette_ensure(struct Main *bmain, struct Scene *scene)
struct bGPDcurve * BKE_gpencil_stroke_editcurve_new(int tot_curve_points)
void BKE_gpencil_stroke_select_index_reset(struct bGPDstroke *gps)
struct bGPDlayer * BKE_gpencil_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive, bool add_to_header)
bool BKE_gpencil_layer_is_editable(const struct bGPDlayer *gpl)
bool BKE_gpencil_layer_frame_delete(struct bGPDlayer *gpl, struct bGPDframe *gpf)
int BKE_gpencil_object_material_index_get(struct Object *ob, struct Material *ma)
struct bGPDframe * BKE_gpencil_layer_frame_find(struct bGPDlayer *gpl, int cframe)
void BKE_gpencil_free_stroke(struct bGPDstroke *gps)
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
#define GPENCIL_STRENGTH_MIN
struct bGPdata * BKE_gpencil_data_addnew(struct Main *bmain, const char name[])
void BKE_gpencil_layer_transform_matrix_get(const struct Depsgraph *depsgraph, struct Object *obact, struct bGPDlayer *gpl, float diff_mat[4][4])
void BKE_gpencil_layer_mask_cleanup_all_layers(struct bGPdata *gpd)
void BKE_gpencil_stroke_weights_duplicate(struct bGPDstroke *gps_src, struct bGPDstroke *gps_dst)
void BKE_gpencil_layer_copy_settings(const struct bGPDlayer *gpl_src, struct bGPDlayer *gpl_dst)
void BKE_gpencil_stroke_editcurve_update(struct bGPdata *gpd, struct bGPDlayer *gpl, struct bGPDstroke *gps)
void BKE_gpencil_editcurve_subdivide(struct bGPDstroke *gps, int cuts)
void BKE_gpencil_editcurve_stroke_sync_selection(struct bGPdata *gpd, struct bGPDstroke *gps, struct bGPDcurve *gpc)
void BKE_gpencil_editcurve_recalculate_handles(struct bGPDstroke *gps)
void BKE_gpencil_stroke_flip(struct bGPDstroke *gps)
void BKE_gpencil_stroke_join(struct bGPDstroke *gps_a, struct bGPDstroke *gps_b, bool leave_gaps, bool fit_thickness, bool smooth)
bool BKE_gpencil_stroke_smooth_thickness(struct bGPDstroke *gps, int point_index, float influence, int iterations, struct bGPDstroke *r_gps)
void BKE_gpencil_stroke_simplify_adaptive(struct bGPdata *gpd, struct bGPDstroke *gps, float epsilon)
void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps)
bool BKE_gpencil_stroke_sample(struct bGPdata *gpd, struct bGPDstroke *gps, const float dist, const bool select, const float sharp_threshold)
bool BKE_gpencil_stroke_smooth_strength(struct bGPDstroke *gps, int point_index, float influence, int iterations, struct bGPDstroke *r_gps)
void BKE_gpencil_stroke_simplify_fixed(struct bGPdata *gpd, struct bGPDstroke *gps)
bool BKE_gpencil_stroke_smooth_uv(struct bGPDstroke *gps, int point_index, float influence, int iterations, struct bGPDstroke *r_gps)
struct bGPDstroke * BKE_gpencil_stroke_delete_tagged_points(struct bGPdata *gpd, struct bGPDframe *gpf, struct bGPDstroke *gps, struct bGPDstroke *next_stroke, int tag_flags, bool select, bool flat_cap, int limit)
void BKE_gpencil_curve_delete_tagged_points(struct bGPdata *gpd, struct bGPDframe *gpf, struct bGPDstroke *gps, struct bGPDstroke *next_stroke, struct bGPDcurve *gpc, int tag_flags)
void BKE_gpencil_stroke_merge_distance(struct bGPdata *gpd, struct bGPDframe *gpf, struct bGPDstroke *gps, float threshold, bool use_unselected)
bool BKE_gpencil_stroke_smooth_point(struct bGPDstroke *gps, int point_index, float influence, int iterations, bool smooth_caps, bool keep_shape, struct bGPDstroke *r_gps)
bool BKE_gpencil_stroke_close(struct bGPDstroke *gps)
bool BKE_gpencil_stroke_trim(struct bGPdata *gpd, struct bGPDstroke *gps)
void id_us_min(struct ID *id)
char * BKE_id_to_unique_string_key(const struct ID *id)
General operations, lookup, etc. for materials.
struct MaterialGPencilStyle * BKE_gpencil_material_settings(struct Object *ob, short act)
bool BKE_object_material_slot_remove(struct Main *bmain, struct Object *ob)
struct Material * BKE_object_material_get(struct Object *ob, short act)
bool BKE_object_material_slot_used(struct Object *object, short actcol)
struct Material * BKE_gpencil_material(struct Object *ob, short act)
General operations, lookup, etc. for blender objects.
bool BKE_paint_ensure(struct ToolSettings *ts, struct Paint **r_paint)
void BKE_paint_toolslots_brush_validate(struct Main *bmain, struct Paint *paint)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph)
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_str_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
#define GHASH_ITER(gh_iter_, ghash_)
GHash * BLI_ghash_int_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
bool BLI_lasso_is_point_inside(const int mcoords[][2], unsigned int mcoords_len, int sx, int sy, int error_value)
void BLI_lasso_boundbox(struct rcti *rect, const int mcoords[][2], unsigned int mcoords_len)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void void void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE float interpf(float a, float b, float t)
void invert_m4_m4_safe(float Ainv[4][4], const float A[4][4])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
bool BLI_rcti_isect_pt(const struct rcti *rect, int x, int y)
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
#define INIT_MINMAX(min, max)
#define POINTER_FROM_INT(i)
struct Depsgraph Depsgraph
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
float DEG_get_ctime(const Depsgraph *graph)
@ ID_RECALC_COPY_ON_WRITE
#define BEZT_DESEL_ALL(bezt)
#define BEZT_SEL_IDX(bezt, i)
@ GP_CURVE_NEEDS_STROKE_UPDATE
@ GP_STROKE_NEEDS_CURVE_UPDATE
#define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd)
#define GPENCIL_PAINT_MODE(gpd)
@ GP_DATA_STROKE_WEIGHTMODE
@ GP_DATA_STROKE_VERTEXMODE
@ GP_DATA_STROKE_PAINTMODE
@ GP_DATA_STROKE_SCULPTMODE
@ GP_DATA_AUTOLOCK_LAYERS
@ GP_DATA_STROKE_EDITMODE
#define GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd)
Object is a sort of wrapper for general info.
@ V3D_AROUND_CENTER_BOUNDS
#define IS_AUTOKEY_ON(scene)
struct Base * ED_object_add_duplicate(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, struct Base *base, eDupli_ID_Flags dupflag)
void ED_object_posemode_set_for_weight_paint(struct bContext *C, struct Main *bmain, struct Object *ob, bool is_mode_set)
void ED_outliner_select_sync_from_object_tag(struct bContext *C)
bool ED_operator_view3d_active(struct bContext *C)
SnapObjectContext * ED_transform_snap_object_context_create(struct Scene *scene, int flag)
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
float ED_view3d_grid_view_scale(struct Scene *scene, struct View3D *v3d, struct ARegion *region, const char **r_grid_unit)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
#define MEM_recallocN(vmemh, len)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
@ OPTYPE_DEPENDS_ON_CURSOR
#define ND_GPENCIL_EDITMODE
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
const Depsgraph * depsgraph
static bool is_inside(int x, int y, int cols, int rows)
static bool gpencil_sculptmode_toggle_poll(bContext *C)
void ED_gpencil_strokes_copybuf_free(void)
void GPENCIL_OT_recalc_geometry(wmOperatorType *ot)
void GPENCIL_OT_snap_to_cursor(wmOperatorType *ot)
static void layer_new_name_get(bGPdata *gpd, char *rname)
static int gpencil_stroke_separate_exec(bContext *C, wmOperator *op)
static GHash * gpencil_strokes_copypastebuf_colors_material_to_name_create(Main *bmain)
void GPENCIL_OT_stroke_cyclical_set(wmOperatorType *ot)
static int gpencil_delete_selected_strokes(bContext *C)
static int gpencil_stroke_cyclical_set_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_move_to_layer(wmOperatorType *ot)
static bool gpencil_actframe_delete_all_poll(bContext *C)
static int gpencil_strokes_paste_exec(bContext *C, wmOperator *op)
static int gpencil_snap_to_cursor(bContext *C, wmOperator *op)
static void gpencil_cutter_dissolve(bGPdata *gpd, bGPDlayer *hit_layer, bGPDstroke *hit_stroke, const bool flat_caps)
static int gpencil_extrude_exec(bContext *C, wmOperator *op)
struct tJoinStrokes tJoinStrokes
static bool gpencil_vertexmode_toggle_poll(bContext *C)
static int gpencil_stroke_simplify_exec(bContext *C, wmOperator *op)
static bool annotation_actframe_delete_poll(bContext *C)
static bool gpencil_dissolve_selected_curve_points(bContext *C, bGPdata *gpd, eGP_DissolveMode mode)
void GPENCIL_OT_paintmode_toggle(wmOperatorType *ot)
void GPENCIL_OT_stroke_simplify_fixed(wmOperatorType *ot)
void GPENCIL_OT_copy(wmOperatorType *ot)
static GHash * gpencil_strokes_copypastebuf_colors
static void gpencil_duplicate_points(bGPdata *gpd, const bGPDstroke *gps, ListBase *new_strokes, const char *layername)
static int gpencil_snap_cursor_to_sel(bContext *C, wmOperator *op)
static bool gpencil_stroke_points_centroid(Depsgraph *depsgraph, bContext *C, Object *obact, bGPdata *gpd, float r_centroid[3], float r_min[3], float r_max[3], size_t *count)
void GPENCIL_OT_snap_to_grid(wmOperatorType *ot)
static int gpencil_selectmode_toggle_exec(bContext *C, wmOperator *op)
static void gpencil_add_move_points(bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps)
void GPENCIL_OT_active_frame_delete(wmOperatorType *ot)
static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op)
static bool gpencil_weightmode_toggle_poll(bContext *C)
void GPENCIL_OT_stroke_flip(wmOperatorType *ot)
static bool gpencil_strokes_edit3d_poll(bContext *C)
static int gpencil_editmode_toggle_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_dissolve(wmOperatorType *ot)
static bool gpencil_dissolve_selected_stroke_points(bContext *C, bGPdata *gpd, eGP_DissolveMode mode)
static int gpencil_actframe_delete_all_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_stroke_simplify(wmOperatorType *ot)
static int gpencil_stroke_trim_exec(bContext *C, wmOperator *op)
static int gpencil_move_to_layer_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void gpencil_strokes_copypastebuf_colors_material_to_name_free(GHash *ma_to_name)
static int gpencil_cutter_lasso_select(bContext *C, wmOperator *op, GPencilTestFn is_inside_fn, void *user_data)
static void gpencil_strokes_copypastebuf_colors_name_to_material_free(GHash *name_to_ma)
static bool gpencil_cyclical_set_curve_edit_poll_property(const bContext *C, wmOperator *UNUSED(op), const PropertyRNA *prop)
@ GP_STROKE_CYCLIC_TOGGLE
static int gpencil_duplicate_exec(bContext *C, wmOperator *op)
static void gpencil_smooth_stroke(bContext *C, wmOperator *op)
static void gpencil_stroke_normalize_ui(bContext *UNUSED(C), wmOperator *op)
static int gpencil_get_nearest_stroke_index(tJoinStrokes *strokes_list, const bGPDstroke *gps, const int totstrokes)
int gpencil_delete_selected_point_wrap(bContext *C)
void GPENCIL_OT_snap_cursor_to_selected(wmOperatorType *ot)
static int gpencil_dissolve_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_weightmode_toggle(wmOperatorType *ot)
bool(* GPencilTestFn)(bGPDstroke *gps, bGPDspoint *pt, const GP_SpaceConversion *gsc, const float diff_mat[4][4], void *user_data)
static bool gpencil_merge_by_distance_poll(bContext *C)
static int gpencil_delete_selected_points(bContext *C)
static GHash * gpencil_strokes_copypastebuf_colors_name_to_material_create(Main *bmain)
static int gpencil_vertexmode_toggle_exec(bContext *C, wmOperator *op)
static bool gpencil_editmode_toggle_poll(bContext *C)
void GPENCIL_OT_stroke_split(wmOperatorType *ot)
static int gpencil_blank_frame_add_exec(bContext *C, wmOperator *op)
static void gpencil_stroke_subdivide(bGPDstroke *gps, const int cuts)
static int gpencil_stroke_join_exec(bContext *C, wmOperator *op)
static bool gpencil_stroke_edit_poll(bContext *C)
void GPENCIL_OT_blank_frame_add(wmOperatorType *ot)
void GPENCIL_OT_annotation_active_frame_delete(wmOperatorType *ot)
void GPENCIL_OT_stroke_trim(wmOperatorType *ot)
static int gpencil_strokes_reproject_exec(bContext *C, wmOperator *op)
static bool gpencil_strokes_paste_poll(bContext *C)
void GPENCIL_OT_editmode_toggle(wmOperatorType *ot)
void GPENCIL_OT_active_frames_delete_all(wmOperatorType *ot)
void GPENCIL_OT_delete(wmOperatorType *ot)
static int gpencil_dissolve_selected_points(bContext *C, eGP_DissolveMode mode)
static int gpencil_stroke_apply_thickness_exec(bContext *C, wmOperator *UNUSED(op))
void GPENCIL_OT_stroke_merge_by_distance(wmOperatorType *ot)
static int gpencil_stroke_subdivide_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_vertexmode_toggle(wmOperatorType *ot)
bool ED_object_gpencil_exit(struct Main *bmain, Object *ob)
void GPENCIL_OT_stroke_apply_thickness(wmOperatorType *ot)
static bool gpencil_selectmode_toggle_poll(bContext *C)
static int gpencil_stroke_flip_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_paste(wmOperatorType *ot)
static int gpencil_move_to_layer_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_stroke_caps_set(wmOperatorType *ot)
static bool gpencil_actframe_delete_poll(bContext *C)
void GPENCIL_OT_stroke_normalize(wmOperatorType *ot)
static bool gpencil_test_lasso(bGPDstroke *gps, bGPDspoint *pt, const GP_SpaceConversion *gsc, const float diff_mat[4][4], void *user_data)
static int gpencil_stroke_sample_exec(bContext *C, wmOperator *op)
static bool gpencil_snap_poll(bContext *C)
static int gpencil_sculptmode_toggle_exec(bContext *C, wmOperator *op)
static void gpencil_copy_move_point(bGPDstroke *gps, bGPDspoint *temp_points, MDeformVert *temp_dverts, int from_idx, int to_idx, const bool copy)
void GPENCIL_OT_stroke_separate(wmOperatorType *ot)
ListBase gpencil_strokes_copypastebuf
static bool gpencil_stroke_normalize_poll(bContext *C)
static int gpencil_snap_to_grid(bContext *C, wmOperator *UNUSED(op))
static int gpencil_stroke_smooth_exec(bContext *C, wmOperator *op)
static int gpencil_stroke_split_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_selection_opacity_toggle(wmOperatorType *ot)
static bool gpencil_paintmode_toggle_poll(bContext *C)
static void gpencil_curve_extrude_points(bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps, bGPDcurve *gpc)
static int gpencil_cutter_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_stroke_cutter(wmOperatorType *ot)
static int gpencil_actframe_delete_exec(bContext *C, wmOperator *op)
static int gpencil_weightmode_toggle_exec(bContext *C, wmOperator *op)
@ GP_STROKE_CAPS_TOGGLE_START
@ GP_STROKE_CAPS_TOGGLE_END
@ GP_STROKE_CAPS_TOGGLE_BOTH
@ GP_STROKE_CAPS_TOGGLE_DEFAULT
void GPENCIL_OT_duplicate(wmOperatorType *ot)
static bool gpencil_cutter_poll(bContext *C)
void GPENCIL_OT_stroke_sample(wmOperatorType *ot)
void GPENCIL_OT_stroke_smooth(wmOperatorType *ot)
static int gpencil_stroke_simplify_fixed_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_selectmode_toggle(wmOperatorType *ot)
static int gpencil_stroke_caps_set_exec(bContext *C, wmOperator *op)
static int gpencil_count_subdivision_cuts(bGPDstroke *gps)
static int gpencil_strokes_copy_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_extrude(wmOperatorType *ot)
void GPENCIL_OT_reproject(wmOperatorType *ot)
GHash * gpencil_copybuf_validate_colormap(bContext *C)
static bool gpencil_subdivide_curve_edit_poll_property(const bContext *C, wmOperator *UNUSED(op), const PropertyRNA *prop)
static int gpencil_recalc_geometry_exec(bContext *C, wmOperator *UNUSED(op))
static int gpencil_merge_by_distance_exec(bContext *C, wmOperator *op)
static int gpencil_hideselect_toggle_exec(bContext *C, wmOperator *UNUSED(op))
void GPENCIL_OT_sculptmode_toggle(wmOperatorType *ot)
static bool gpencil_stroke_not_in_curve_edit_mode(bContext *C)
void GPENCIL_OT_stroke_join(wmOperatorType *ot)
static int gpencil_delete_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_stroke_subdivide(wmOperatorType *ot)
static int gpencil_stroke_normalize_exec(bContext *C, wmOperator *op)
#define GP_EDITABLE_CURVES_END(gpstroke_iter)
#define GP_EDITABLE_CURVES_BEGIN(gpstroke_iter, C, gpl, gps, gpc)
void gpencil_point_conversion_init(struct bContext *C, GP_SpaceConversion *r_gsc)
#define GP_EDITABLE_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)
void gpencil_point_to_parent_space(const bGPDspoint *pt, const float diff_mat[4][4], bGPDspoint *r_pt)
void gpencil_apply_parent_point(struct Depsgraph *depsgraph, struct Object *obact, bGPDlayer *gpl, bGPDspoint *pt)
bool gpencil_active_layer_poll(struct bContext *C)
#define GP_EDITABLE_STROKES_END(gpstroke_iter)
bool gpencil_add_poll(struct bContext *C)
void gpencil_point_to_xy(const GP_SpaceConversion *gsc, const struct bGPDstroke *gps, const struct bGPDspoint *pt, int *r_x, int *r_y)
bool ED_gpencil_stroke_material_editable(Object *ob, const bGPDlayer *gpl, const bGPDstroke *gps)
int ED_gpencil_select_stroke_segment(bGPdata *gpd, bGPDlayer *gpl, bGPDstroke *gps, bGPDspoint *pt, bool select, bool insert, const float scale, float r_hita[3], float r_hitb[3])
void ED_gpencil_setup_modes(bContext *C, bGPdata *gpd, int newmode)
void ED_gpencil_stroke_reproject(Depsgraph *depsgraph, const GP_SpaceConversion *gsc, SnapObjectContext *sctx, bGPDlayer *gpl, bGPDframe *gpf, bGPDstroke *gps, const eGP_ReprojectModes mode, const bool keep_original)
bGPdata * ED_annotation_data_get_active(const bContext *C)
bool ED_gpencil_stroke_can_use(const bContext *C, const bGPDstroke *gps)
void ED_gpencil_reset_layers_parent(Depsgraph *depsgraph, Object *obact, bGPdata *gpd)
bGPdata * ED_gpencil_data_get_active(const bContext *C)
bool ED_gpencil_layer_has_selected_stroke(const bGPDlayer *gpl, const bool is_multiedit)
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
T length(const vec_base< T, Size > &a)
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
const char * RNA_property_identifier(const PropertyRNA *prop)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_int_get(PointerRNA *ptr, const char *name)
void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct BrushGpencilSettings * gpencil_settings
struct ToolSettings * toolsettings
bGPDcurve_point * curve_points
bGPDstroke_Runtime runtime
struct bGPDcurve * editcurve
struct MDeformVert * dvert
ListBase vertex_group_names
int vertex_group_active_index
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
bool(* poll_property)(const struct bContext *C, struct wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
void(* ui)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
const int(* WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *r_mcoords_len))[2]
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))