Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_brush.c
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | typedef struct tGP_BrushEditData { | ||||
| /* Brush Settings */ | /* Brush Settings */ | ||||
| GP_Sculpt_Settings *settings; | GP_Sculpt_Settings *settings; | ||||
| GP_Sculpt_Data *gp_brush; | GP_Sculpt_Data *gp_brush; | ||||
| GP_Sculpt_Data *gp_brush_old; | GP_Sculpt_Data *gp_brush_old; | ||||
| eGP_Sculpt_Types brush_type; | eGP_Sculpt_Types brush_type; | ||||
| eGP_Sculpt_Types brush_type_old; | eGP_Sculpt_Types brush_type_old; | ||||
| eGP_Sculpt_Flag flag; | eGP_Sculpt_Flag flag; | ||||
| eGP_Sculpt_SelectMaskFlag mask; | |||||
| /* Space Conversion Data */ | /* Space Conversion Data */ | ||||
| GP_SpaceConversion gsc; | GP_SpaceConversion gsc; | ||||
| /* Is the brush currently painting? */ | /* Is the brush currently painting? */ | ||||
| bool is_painting; | bool is_painting; | ||||
| bool is_weight_mode; | bool is_weight_mode; | ||||
| ▲ Show 20 Lines • Show All 1,155 Lines • ▼ Show 20 Lines | #endif | ||||
| } | } | ||||
| else { | else { | ||||
| gso->vrgroup = -1; | gso->vrgroup = -1; | ||||
| } | } | ||||
| gso->sa = CTX_wm_area(C); | gso->sa = CTX_wm_area(C); | ||||
| gso->ar = CTX_wm_region(C); | gso->ar = CTX_wm_region(C); | ||||
| /* save mask */ | |||||
| gso->mask = ts->gpencil_selectmode_sculpt; | |||||
| /* multiframe settings */ | /* multiframe settings */ | ||||
| gso->is_multiframe = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gso->gpd); | gso->is_multiframe = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gso->gpd); | ||||
| gso->use_multiframe_falloff = (ts->gp_sculpt.flag & GP_SCULPT_SETT_FLAG_FRAME_FALLOFF) != 0; | gso->use_multiframe_falloff = (ts->gp_sculpt.flag & GP_SCULPT_SETT_FLAG_FRAME_FALLOFF) != 0; | ||||
| /* Init multi-edit falloff curve data before doing anything, | /* Init multi-edit falloff curve data before doing anything, | ||||
| * so we won't have to do it again later. */ | * so we won't have to do it again later. */ | ||||
| if (gso->is_multiframe) { | if (gso->is_multiframe) { | ||||
| BKE_curvemapping_initialize(ts->gp_sculpt.cur_falloff); | BKE_curvemapping_initialize(ts->gp_sculpt.cur_falloff); | ||||
| ▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | else { | ||||
| */ | */ | ||||
| for (i = 0; (i + 1) < gps->totpoints; i++) { | for (i = 0; (i + 1) < gps->totpoints; i++) { | ||||
| /* Get points to work with */ | /* Get points to work with */ | ||||
| pt1 = gps->points + i; | pt1 = gps->points + i; | ||||
| pt2 = gps->points + i + 1; | pt2 = gps->points + i + 1; | ||||
| /* Skip if neither one is selected | /* Skip if neither one is selected | ||||
| * (and we are only allowed to edit/consider selected points) */ | * (and we are only allowed to edit/consider selected points) */ | ||||
| if ((gso->settings->flag & GP_SCULPT_SETT_FLAG_SELECT_MASK) && (!gso->is_weight_mode)) { | if ((GPENCIL_ANY_SCULPT_MASK(gso->mask)) && (!gso->is_weight_mode)) { | ||||
| if (!(pt1->flag & GP_SPOINT_SELECT) && !(pt2->flag & GP_SPOINT_SELECT)) { | if (!(pt1->flag & GP_SPOINT_SELECT) && !(pt2->flag & GP_SPOINT_SELECT)) { | ||||
| include_last = false; | include_last = false; | ||||
| continue; | continue; | ||||
| } | } | ||||
| } | } | ||||
| bGPDspoint npt; | bGPDspoint npt; | ||||
| gp_point_to_parent_space(pt1, diff_mat, &npt); | gp_point_to_parent_space(pt1, diff_mat, &npt); | ||||
| gp_point_to_xy(gsc, gps, &npt, &pc1[0], &pc1[1]); | gp_point_to_xy(gsc, gps, &npt, &pc1[0], &pc1[1]); | ||||
| ▲ Show 20 Lines • Show All 685 Lines • Show Last 20 Lines | |||||