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-01-15 15:24:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-15 15:30:31 +0300
commitb8e8c0e325d213f2dcf4adad5506989fa224716e (patch)
treeadb3d7fa8735426ea856a929f562655b2eaf64cb /source/blender/editors/sculpt_paint
parent4226ee0b71fec6f08897dacf3d6632526618acca (diff)
Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c14
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c12
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c112
-rw-r--r--source/blender/editors/sculpt_paint/paint_mask.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c9
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c27
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c9
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c23
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c6
10 files changed, 145 insertions, 73 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 5467312d111..44e29f66ff9 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -316,8 +316,10 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
pool = BKE_image_pool_new();
- if (mtex->tex && mtex->tex->nodetree)
- ntreeTexBeginExecTree(mtex->tex->nodetree); /* has internal flag to detect it only does it once */
+ if (mtex->tex && mtex->tex->nodetree) {
+ /* has internal flag to detect it only does it once */
+ ntreeTexBeginExecTree(mtex->tex->nodetree);
+ }
LoadTexData data = {
.br = br, .vc = vc, .mtex = mtex, .buffer = buffer, .col = col,
@@ -801,7 +803,8 @@ static void paint_draw_alpha_overlay(
UnifiedPaintSettings *ups, Brush *brush,
ViewContext *vc, int x, int y, float zoom, ePaintMode mode)
{
- /* color means that primary brush texture is colured and secondary is used for alpha/mask control */
+ /* color means that primary brush texture is colured and
+ * secondary is used for alpha/mask control */
bool col = ELEM(mode, PAINT_MODE_TEXTURE_3D, PAINT_MODE_TEXTURE_2D, PAINT_MODE_VERTEX) ? true : false;
eOverlayControlFlags flags = BKE_paint_get_overlay_flags();
gpuPushAttrib(GPU_DEPTH_BUFFER_BIT | GPU_BLEND_BIT);
@@ -1079,8 +1082,9 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
float translation[2] = { x, y };
float final_radius = (BKE_brush_size_get(scene, brush) * zoomx);
- /* don't calculate rake angles while a stroke is active because the rake variables are global and
- * we may get interference with the stroke itself. For line strokes, such interference is visible */
+ /* don't calculate rake angles while a stroke is active because the rake variables are global
+ * and we may get interference with the stroke itself.
+ * For line strokes, such interference is visible */
if (!ups->stroke_active) {
paint_calculate_rake_rotation(ups, brush, translation);
}
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 04941e36455..f348273e745 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -391,11 +391,14 @@ void paint_brush_init_tex(Brush *brush)
/* init mtex nodes */
if (brush) {
MTex *mtex = &brush->mtex;
- if (mtex->tex && mtex->tex->nodetree)
- ntreeTexBeginExecTree(mtex->tex->nodetree); /* has internal flag to detect it only does it once */
+ if (mtex->tex && mtex->tex->nodetree) {
+ /* has internal flag to detect it only does it once */
+ ntreeTexBeginExecTree(mtex->tex->nodetree);
+ }
mtex = &brush->mask_mtex;
- if (mtex->tex && mtex->tex->nodetree)
+ if (mtex->tex && mtex->tex->nodetree) {
ntreeTexBeginExecTree(mtex->tex->nodetree);
+ }
}
}
@@ -1105,7 +1108,8 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
/* entering paint mode also sets image to editors */
if (imapaint->mode == IMAGEPAINT_MODE_MATERIAL) {
- Material *ma = give_current_material(ob, ob->actcol); /* set the current material active paint slot on image editor */
+ /* set the current material active paint slot on image editor */
+ Material *ma = give_current_material(ob, ob->actcol);
if (ma && ma->texpaintslot)
ima = ma->texpaintslot[ma->paint_active_slot].ima;
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index 90aa13ab5c1..5e01a33485e 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -1522,7 +1522,8 @@ void paint_2d_bucket_fill(
float image_init[2];
int minx = ibuf->x, miny = ibuf->y, maxx = 0, maxy = 0;
float pixel_color[4];
- /* We are comparing to sum of three squared values (assumed in range [0,1]), so need to multiply... */
+ /* We are comparing to sum of three squared values
+ * (assumed in range [0,1]), so need to multiply... */
float threshold_sq = br->fill_threshold * br->fill_threshold * 3;
UI_view2d_region_to_view(s->v2d, mouse_init[0], mouse_init[1], &image_init[0], &image_init[1]);
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 1285616e6a2..0a972e76c9a 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -172,7 +172,8 @@ BLI_INLINE unsigned char f_to_char(const float val)
#define PROJ_SRC_VIEW_FILL 4
#define PROJ_VIEW_DATA_ID "view_data"
-#define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3) /* viewmat + winmat + clipsta + clipend + is_ortho */
+/* viewmat + winmat + clipsta + clipend + is_ortho */
+#define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3)
#define PROJ_BUCKET_NULL 0
#define PROJ_BUCKET_INIT (1 << 0)
@@ -270,7 +271,8 @@ typedef struct ProjPaintState {
/** store options per vert, now only store if the vert is pointing away from the view. */
char *vertFlags;
- /** The size of the bucket grid, the grid span's screenMin/screenMax so you can paint outsize the screen or with 2 brushes at once. */
+ /** The size of the bucket grid, the grid span's screenMin/screenMax
+ * so you can paint outsize the screen or with 2 brushes at once. */
int buckets_x;
int buckets_y;
@@ -458,7 +460,8 @@ typedef struct ProjPixel {
* new mask value is lower then mask_accum */
unsigned short *mask_accum;
- /* horrible hack, store tile valid flag pointer here to re-validate tiles used for anchored and drag-dot strokes */
+ /* horrible hack, store tile valid flag pointer here to re-validate tiles
+ * used for anchored and drag-dot strokes */
bool *valid;
PixelPointer origColor;
@@ -687,7 +690,8 @@ static void uvco_to_wrapped_pxco(const float uv[2], int ibuf_x, int ibuf_y, floa
*y = *y * ibuf_y - 0.5f;
}
-/* Set the top-most face color that the screen space coord 'pt' touches (or return 0 if none touch) */
+/* Set the top-most face color that the screen space coord 'pt' touches
+ * (or return 0 if none touch) */
static bool project_paint_PickColor(
const ProjPaintState *ps, const float pt[2],
float *rgba_fp, unsigned char *rgba, const bool interp)
@@ -848,7 +852,8 @@ static int project_paint_occlude_ptv_clip(
/* Check if a screenspace location is occluded by any other faces
* check, pixelScreenCo must be in screenspace, its Z-Depth only needs to be used for comparison
- * and doesn't need to be correct in relation to X and Y coords (this is the case in perspective view) */
+ * and doesn't need to be correct in relation to X and Y coords
+ * (this is the case in perspective view) */
static bool project_bucket_point_occluded(
const ProjPaintState *ps, LinkNode *bucketFace,
const int orig_face, const float pixelScreenCo[4])
@@ -1438,8 +1443,10 @@ static float project_paint_uvpixel_mask(
BKE_image_release_ibuf(other_tpage, ibuf_other, NULL);
- if (!ps->do_layer_stencil_inv) /* matching the gimps layer mask black/white rules, white==full opacity */
+ if (!ps->do_layer_stencil_inv) {
+ /* matching the gimps layer mask black/white rules, white==full opacity */
mask = (1.0f - mask);
+ }
if (mask == 0.0f) {
return 0.0f;
@@ -1795,7 +1802,8 @@ static bool line_clip_rect2f(
}
- if (fabsf(l1[0] - l2[0]) < PROJ_PIXEL_TOLERANCE) { /* this is a single point (or close to)*/
+ /* this is a single point (or close to)*/
+ if (fabsf(l1[0] - l2[0]) < PROJ_PIXEL_TOLERANCE) {
if (BLI_rctf_isect_pt_v(rect, l1)) {
copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2);
@@ -1823,7 +1831,8 @@ static bool line_clip_rect2f(
return 0;
}
- if (fabsf(l1[1] - l2[1]) < PROJ_PIXEL_TOLERANCE) { /* this is a single point (or close to)*/
+ /* this is a single point (or close to)*/
+ if (fabsf(l1[1] - l2[1]) < PROJ_PIXEL_TOLERANCE) {
if (BLI_rctf_isect_pt_v(rect, l1)) {
copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2);
@@ -2200,7 +2209,8 @@ static void project_bucket_clip_face(
float bucket_bounds_ss[4][2];
/* detect pathological case where face the three vertices are almost collinear in screen space.
- * mostly those will be culled but when flood filling or with smooth shading it's a possibility */
+ * mostly those will be culled but when flood filling or with
+ * smooth shading it's a possibility */
if (min_fff(dist_squared_to_line_v2(v1coSS, v2coSS, v3coSS),
dist_squared_to_line_v2(v2coSS, v3coSS, v1coSS),
dist_squared_to_line_v2(v3coSS, v1coSS, v2coSS)) < PROJ_PIXEL_TOLERANCE)
@@ -2234,7 +2244,8 @@ static void project_bucket_clip_face(
*tot = 3;
return;
}
- /* handle pathological case here, no need for further intersections below since tringle area is almost zero */
+ /* handle pathological case here,
+ * no need for further intersections below since tringle area is almost zero */
if (collinear) {
int flag;
@@ -2282,7 +2293,8 @@ static void project_bucket_clip_face(
}
/* get the UV space bounding box */
- /* use IsectPT2Df_limit here so we catch points are are touching the tri edge (or a small fraction over) */
+ /* use IsectPT2Df_limit here so we catch points are are touching the tri edge
+ * (or a small fraction over) */
bucket_bounds_ss[0][0] = bucket_bounds->xmax;
bucket_bounds_ss[0][1] = bucket_bounds->ymin;
inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[0], v1coSS, v2coSS, v3coSS, 1 + PROJ_GEOM_TOLERANCE) ? ISECT_1 : 0);
@@ -2763,7 +2775,8 @@ static void project_paint_face_init(
#if 0 /* TODO - investigate why this dosnt work sometimes! it should! */
- /* no intersection for this entire row, after some intersection above means we can quit now */
+ /* no intersection for this entire row,
+ * after some intersection above means we can quit now */
if (has_x_isect == 0 && has_isect) {
break;
}
@@ -2898,15 +2911,17 @@ static void project_paint_face_init(
float fac;
/* We need to find the closest point along the face edge,
- * getting the screen_px_from_*** wont work because our actual location
- * is not relevant, since we are outside the face, Use VecLerpf to find
- * our location on the side of the face's UV */
+ * getting the screen_px_from_*** wont work because our
+ * actual location is not relevant, since we are outside
+ * the face, Use VecLerpf to find our location on the side
+ * of the face's UV */
#if 0
if (is_ortho) screen_px_from_ortho(ps, uv, v1co, v2co, v3co, uv1co, uv2co, uv3co, pixelScreenCo);
else screen_px_from_persp(ps, uv, v1co, v2co, v3co, uv1co, uv2co, uv3co, pixelScreenCo);
#endif
- /* Since this is a seam we need to work out where on the line this pixel is */
+ /* Since this is a seam we need to work out where on
+ * the line this pixel is */
//fac = line_point_factor_v2(uv, uv_seam_quad[0], uv_seam_quad[1]);
fac = resolve_quad_u_v2(uv, UNPACK4(seam_subsection));
interp_v3_v3v3(pixelScreenCo, edge_verts_inset_clip[0], edge_verts_inset_clip[1], fac);
@@ -2928,25 +2943,29 @@ static void project_paint_face_init(
if (ps->do_mask_normal || ps->poly_to_loop_uv_clone) {
const float uv_fac = fac1 + (fac * (fac2 - fac1));
#if 0
- /* get the UV on the line since we want to copy the pixels from there for bleeding */
+ /* get the UV on the line since we want to copy the
+ * pixels from there for bleeding */
float uv_close[2];
interp_v2_v2v2(uv_close, lt_uv_pxoffset[fidx1], lt_uv_pxoffset[fidx2], uv_fac);
barycentric_weights_v2(lt_uv_pxoffset[0], lt_uv_pxoffset[1], lt_uv_pxoffset[2], uv_close, w);
#else
- /* Cheat, we know where we are along the edge so work out the weights from that */
+ /* Cheat, we know where we are along the edge
+ * so work out the weights from that */
w[0] = w[1] = w[2] = 0.0;
w[fidx1] = 1.0f - uv_fac;
w[fidx2] = uv_fac;
#endif
}
- /* a pity we need to get the worldspace pixel location here */
+ /* a pity we need to get the worldspace
+ * pixel location here */
if (do_clip || do_3d_mapping) {
interp_v3_v3v3v3(wco, vCo[0], vCo[1], vCo[2], w);
if (do_clip && ED_view3d_clipping_test(ps->rv3d, wco, true)) {
- /* Watch out that no code below this needs to run */
+ /* Watch out that no code below
+ * this needs to run */
continue;
}
}
@@ -2965,13 +2984,15 @@ static void project_paint_face_init(
}
}
else if (has_x_isect) {
- /* assuming the face is not a bow-tie - we know we cant intersect again on the X */
+ /* assuming the face is not a bow-tie - we know
+ * we cant intersect again on the X */
break;
}
}
#if 0 /* TODO - investigate why this dosnt work sometimes! it should! */
- /* no intersection for this entire row, after some intersection above means we can quit now */
+ /* no intersection for this entire row,
+ * after some intersection above means we can quit now */
if (has_x_isect == 0 && has_isect) {
break;
}
@@ -2993,10 +3014,16 @@ static void project_paint_face_init(
* Takes floating point screenspace min/max and
* returns int min/max to be used as indices for ps->bucketRect, ps->bucketFlags
*/
-static void project_paint_bucket_bounds(const ProjPaintState *ps, const float min[2], const float max[2], int bucketMin[2], int bucketMax[2])
+static void project_paint_bucket_bounds(
+ const ProjPaintState *ps,
+ const float min[2], const float max[2],
+ int bucketMin[2], int bucketMax[2])
{
/* divide by bucketWidth & bucketHeight so the bounds are offset in bucket grid units */
- /* XXX: the offset of 0.5 is always truncated to zero and the offset of 1.5f is always truncated to 1, is this really correct?? - jwilkins */
+
+ /* XXX: the offset of 0.5 is always truncated to zero and the offset of 1.5f
+ * is always truncated to 1, is this really correct?? - jwilkins */
+
/* these offsets of 0.5 and 1.5 seem odd but they are correct */
bucketMin[0] = (int)((int)(((float)(min[0] - ps->screenMin[0]) / ps->screen_width) * ps->buckets_x) + 0.5f);
bucketMin[1] = (int)((int)(((float)(min[1] - ps->screenMin[1]) / ps->screen_height) * ps->buckets_y) + 0.5f);
@@ -3089,13 +3116,14 @@ static void project_bucket_init(
/* We want to know if a bucket and a face overlap in screen-space
*
- * Note, if this ever returns false positives its not that bad, since a face in the bounding area will have its pixels
- * calculated when it might not be needed later, (at the moment at least)
+ * Note, if this ever returns false positives its not that bad, since a face in the bounding area
+ * will have its pixels calculated when it might not be needed later, (at the moment at least)
* obviously it shouldn't have bugs though */
static bool project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucket_y, const MLoopTri *lt)
{
- /* TODO - replace this with a tricker method that uses sideofline for all screenCoords's edges against the closest bucket corner */
+ /* TODO - replace this with a tricker method that uses sideofline for all
+ * screenCoords's edges against the closest bucket corner */
const int lt_vtri[3] = { PS_LOOPTRI_AS_VERT_INDEX_3(ps, lt) };
rctf bucket_bounds;
float p1[2], p2[2], p3[2], p4[2];
@@ -3184,7 +3212,8 @@ static void project_paint_delayed_face_init(ProjPaintState *ps, const MLoopTri *
}
}
- /* no intersection for this entire row, after some intersection above means we can quit now */
+ /* no intersection for this entire row,
+ * after some intersection above means we can quit now */
if (has_x_isect == 0 && has_isect) {
break;
}
@@ -3483,7 +3512,8 @@ static void proj_paint_state_vert_flags_init(ProjPaintState *ps)
}
if (ps->is_ortho) {
- if (dot_v3v3(ps->viewDir, no) <= ps->normal_angle__cos) { /* 1 vert of this face is towards us */
+ if (dot_v3v3(ps->viewDir, no) <= ps->normal_angle__cos) {
+ /* 1 vert of this face is towards us */
ps->vertFlags[a] |= PROJ_VERT_CULL;
}
}
@@ -3493,7 +3523,8 @@ static void proj_paint_state_vert_flags_init(ProjPaintState *ps)
if (UNLIKELY(ps->is_flip_object)) {
negate_v3(viewDirPersp);
}
- if (dot_v3v3(viewDirPersp, no) <= ps->normal_angle__cos) { /* 1 vert of this face is towards us */
+ if (dot_v3v3(viewDirPersp, no) <= ps->normal_angle__cos) {
+ /* 1 vert of this face is towards us */
ps->vertFlags[a] |= PROJ_VERT_CULL;
}
}
@@ -3828,7 +3859,8 @@ static void project_paint_prepare_all_faces(
/* don't allow using the same inage for painting and stencilling */
if (slot->ima == ps->stencil_ima) {
/* While this shouldn't be used, face-winding reads all polys.
- * It's less trouble to set all faces to valid UV's, avoiding NULL checks all over. */
+ * It's less trouble to set all faces to valid UV's,
+ * avoiding NULL checks all over. */
ps->poly_to_loop_uv[lt->poly] = mloopuv_base;
continue;
}
@@ -3903,7 +3935,8 @@ static void project_paint_prepare_all_faces(
image_index = BLI_linklist_index(image_LinkList.list, tpage);
- if (image_index == -1 && BKE_image_has_ibuf(tpage, NULL)) { /* MemArena dosnt have an append func */
+ if (image_index == -1 && BKE_image_has_ibuf(tpage, NULL)) {
+ /* MemArena dosnt have an append func */
BLI_linklist_append(&image_LinkList, tpage);
image_index = ps->image_tot;
ps->image_tot++;
@@ -4637,7 +4670,8 @@ static void *do_projectpaint_thread(void *ph_v)
softenArena = BLI_memarena_new(MEM_SIZE_OPTIMAL(1 << 16), "paint soften arena");
}
- /* printf("brush bounds %d %d %d %d\n", bucketMin[0], bucketMin[1], bucketMax[0], bucketMax[1]); */
+ /* printf("brush bounds %d %d %d %d\n",
+ * bucketMin[0], bucketMin[1], bucketMax[0], bucketMax[1]); */
while (project_bucket_iter_next(ps, &bucket_index, &bucket_bounds, pos)) {
@@ -4836,7 +4870,8 @@ static void *do_projectpaint_thread(void *ph_v)
float samplecos[3];
float texrgba[4];
- /* taking 3d copy to account for 3D mapping too. It gets concatenated during sampling */
+ /* taking 3d copy to account for 3D mapping too.
+ * It gets concatenated during sampling */
if (mtex->brush_map_mode == MTEX_MAP_MODE_3D) {
copy_v3_v3(samplecos, projPixel->worldCoSS);
}
@@ -4845,7 +4880,8 @@ static void *do_projectpaint_thread(void *ph_v)
samplecos[2] = 0.0f;
}
- /* note, for clone and smear, we only use the alpha, could be a special function */
+ /* note, for clone and smear,
+ * we only use the alpha, could be a special function */
BKE_brush_sample_tex_3d(ps->scene, brush, samplecos, texrgba, thread_index, pool);
copy_v3_v3(texrgb, texrgba);
@@ -5186,7 +5222,8 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
Brush *brush = ps->brush;
ps->tool = brush->imagepaint_tool;
ps->blend = brush->blend;
- /* only check for inversion for the soften tool, elsewhere, a resident brush inversion flag can cause issues */
+ /* only check for inversion for the soften tool, elsewhere,
+ * a resident brush inversion flag can cause issues */
if (brush->imagepaint_tool == PAINT_TOOL_SOFTEN) {
ps->mode = (((ps->mode == BRUSH_STROKE_INVERT) ^ ((brush->flag & BRUSH_DIR_IN) != 0)) ?
BRUSH_STROKE_INVERT : BRUSH_STROKE_NORMAL);
@@ -5670,7 +5707,8 @@ void BKE_paint_data_warning(struct ReportList *reports, bool uvs, bool mat, bool
);
}
-/* Make sure that active object has a material, and assign UVs and image layers if they do not exist */
+/* Make sure that active object has a material,
+ * and assign UVs and image layers if they do not exist */
bool BKE_paint_proj_mesh_data_check(Scene *scene, Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil)
{
Mesh *me;
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index b8175e3d368..3f193de9031 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -484,7 +484,8 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
data.symmpass = symmpass;
- /* gather nodes inside lasso's enclosing rectangle (should greatly help with bigger meshes) */
+ /* gather nodes inside lasso's enclosing rectangle
+ * (should greatly help with bigger meshes) */
BKE_pbvh_search_gather(pbvh, BKE_pbvh_node_planes_contain_AABB, clip_planes_final, &nodes, &totnode);
data.task_data.ob = ob;
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 15dd0438585..4e9feb7ace4 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -494,8 +494,11 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const float
}
/* This can be removed once fixed properly in
- * BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user)
- * at zero pressure we should do nothing 1/2^12 is 0.0002 which is the sensitivity of the most sensitive pen tablet available */
+ * BKE_brush_painter_paint(
+ * BrushPainter *painter, BrushFunc func,
+ * float *pos, double time, float pressure, void *user);
+ * at zero pressure we should do nothing 1/2^12 is 0.0002
+ * which is the sensitivity of the most sensitive pen tablet available */
if (tablet && (pressure < 0.0002f) &&
((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) ||
BKE_brush_use_alpha_pressure(scene, pop->s.brush) ||
@@ -980,7 +983,7 @@ static void paint_stroke_sample_average(
mul_v2_fl(average->mouse, 1.0f / stroke->num_samples);
average->pressure /= stroke->num_samples;
- /*printf("avg=(%f, %f), num=%d\n", average->mouse[0], average->mouse[1], stroke->num_samples);*/
+ // printf("avg=(%f, %f), num=%d\n", average->mouse[0], average->mouse[1], stroke->num_samples);
}
/**
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index f91c5f71b2f..2d7cd2f83a5 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -823,7 +823,8 @@ static void do_weight_paint_vertex_single(
dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags, wpi->active.lock);
if (index_mirr != -1) {
- /* only normalize if this is not a center vertex, else we get a conflict, normalizing twice */
+ /* only normalize if this is not a center vertex,
+ * else we get a conflict, normalizing twice */
if (index != index_mirr) {
do_weight_paint_normalize_all_locked_try_active(
dv_mirr, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags, wpi->mirror.lock);
@@ -2136,7 +2137,8 @@ static void wpaint_do_radial_symmetry(
}
}
-/* near duplicate of: sculpt.c's, 'do_symmetrical_brush_actions' and 'vpaint_do_symmetrical_brush_actions'. */
+/* near duplicate of: sculpt.c's,
+ * 'do_symmetrical_brush_actions' and 'vpaint_do_symmetrical_brush_actions'. */
static void wpaint_do_symmetrical_brush_actions(
bContext *C, Object *ob, VPaint *wp, Sculpt *sd, struct WPaintData *wpd, WeightPaintInfo *wpi)
{
@@ -2155,7 +2157,8 @@ static void wpaint_do_symmetrical_brush_actions(
cache->symmetry = symm;
- /* symm is a bit combination of XYZ - 1 is mirror X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
+ /* symm is a bit combination of XYZ - 1 is mirror
+ * X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
for (i = 1; i <= symm; i++) {
if ((symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5)))) {
cache->mirror_symmetry_pass = i;
@@ -2820,7 +2823,8 @@ static void do_vpaint_brush_blur_task_cb_ex(
col[2] = round_fl_to_uchar(sqrtf(divide_round_i(blend[2], total_hit_loops)));
col[3] = round_fl_to_uchar(sqrtf(divide_round_i(blend[3], total_hit_loops)));
- /* For each poly owning this vert, paint each loop belonging to this vert. */
+ /* For each poly owning this vert,
+ * paint each loop belonging to this vert. */
for (int j = 0; j < gmap->vert_to_poly[v_index].count; j++) {
const int p_index = gmap->vert_to_poly[v_index].indices[j];
const int l_index = gmap->vert_to_loop[v_index].indices[j];
@@ -2917,7 +2921,8 @@ static void do_vpaint_brush_smear_task_cb_ex(
* to neighbor direction is 0.0, meaning orthogonal. */
float stroke_dot_max = 0.0f;
- /* Get the color of the loop in the opposite direction of the brush movement */
+ /* Get the color of the loop in the opposite
+ * direction of the brush movement */
uint color_final = 0;
for (int j = 0; j < gmap->vert_to_poly[v_index].count; j++) {
const int p_index = gmap->vert_to_poly[v_index].indices[j];
@@ -2932,7 +2937,8 @@ static void do_vpaint_brush_smear_task_cb_ex(
if (v_other_index != v_index) {
const MVert *mv_other = &data->me->mvert[v_other_index];
- /* Get the direction from the selected vert to the neighbor. */
+ /* Get the direction from the
+ * selected vert to the neighbor. */
float other_dir[3];
sub_v3_v3v3(other_dir, mv_curr->co, mv_other->co);
project_plane_v3_v3v3(other_dir, other_dir, cache->view_normal);
@@ -2956,7 +2962,8 @@ static void do_vpaint_brush_smear_task_cb_ex(
255 * brush_fade * brush_strength *
brush_alpha_pressure * grid_alpha;
- /* For each poly owning this vert, paint each loop belonging to this vert. */
+ /* For each poly owning this vert,
+ * paint each loop belonging to this vert. */
for (int j = 0; j < gmap->vert_to_poly[v_index].count; j++) {
const int p_index = gmap->vert_to_poly[v_index].indices[j];
const int l_index = gmap->vert_to_loop[v_index].indices[j];
@@ -3097,7 +3104,8 @@ static void vpaint_do_radial_symmetry(
}
}
-/* near duplicate of: sculpt.c's, 'do_symmetrical_brush_actions' and 'wpaint_do_symmetrical_brush_actions'. */
+/* near duplicate of: sculpt.c's,
+ * 'do_symmetrical_brush_actions' and 'wpaint_do_symmetrical_brush_actions'. */
static void vpaint_do_symmetrical_brush_actions(
bContext *C, Sculpt *sd, VPaint *vp, struct VPaintData *vpd, Object *ob)
{
@@ -3116,7 +3124,8 @@ static void vpaint_do_symmetrical_brush_actions(
cache->symmetry = symm;
- /* symm is a bit combination of XYZ - 1 is mirror X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
+ /* symm is a bit combination of XYZ - 1 is mirror
+ * X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
for (i = 1; i <= symm; i++) {
if (symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5))) {
cache->mirror_symmetry_pass = i;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
index fe326ad7337..fe4472c76fe 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
@@ -214,7 +214,8 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even
const int vgroup_active = vc.obact->actdef - 1;
float vgroup_weight = defvert_find_weight(&me->dvert[v_idx_best], vgroup_active);
- /* use combined weight in multipaint mode, since that's what is displayed to the user in the colors */
+ /* use combined weight in multipaint mode,
+ * since that's what is displayed to the user in the colors */
if (ts->multipaint) {
int defbase_tot_sel;
const int defbase_tot = BLI_listbase_count(&vc.obact->defbase);
@@ -229,7 +230,8 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even
vgroup_weight = BKE_defvert_multipaint_collective_weight(
&me->dvert[v_idx_best], defbase_tot, defbase_sel, defbase_tot_sel, ts->auto_normalize);
- /* if autonormalize is enabled, but weights are not normalized, the value can exceed 1 */
+ /* if autonormalize is enabled, but weights are not normalized,
+ * the value can exceed 1 */
CLAMP(vgroup_weight, 0.0f, 1.0f);
}
@@ -376,7 +378,8 @@ static int weight_sample_group_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-/* TODO, we could make this a menu into OBJECT_OT_vertex_group_set_active rather than its own operator */
+/* TODO, we could make this a menu into OBJECT_OT_vertex_group_set_active
+ * rather than its own operator */
void PAINT_OT_weight_sample_group(wmOperatorType *ot)
{
PropertyRNA *prop = NULL;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 5694c760371..4081f46708d 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -108,7 +108,8 @@
*
* \{ */
-/* Check if there are any active modifiers in stack (used for flushing updates at enter/exit sculpt mode) */
+/* Check if there are any active modifiers in stack
+ * (used for flushing updates at enter/exit sculpt mode) */
static bool sculpt_has_active_modifiers(Scene *scene, Object *ob)
{
ModifierData *md;
@@ -2458,7 +2459,8 @@ static void do_snake_hook_brush_task_cb_ex(
project_plane_v3_v3v3(delta_pinch, delta_pinch, ss->cache->true_view_normal);
}
- /* important to calculate based on the grabbed location (intentionally ignore fade here). */
+ /* important to calculate based on the grabbed location
+ * (intentionally ignore fade here). */
add_v3_v3(delta_pinch, grab_delta);
sculpt_project_v3(spvc, delta_pinch, delta_pinch);
@@ -3960,7 +3962,8 @@ static void do_tiled(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings
const float *step = sd->paint.tile_offset;
int dim;
- /* These are integer locations, for real location: multiply with step and add orgLoc. So 0,0,0 is at orgLoc. */
+ /* These are integer locations, for real location: multiply with step and add orgLoc.
+ * So 0,0,0 is at orgLoc. */
int start[3];
int end[3];
int cur[3];
@@ -4352,7 +4355,8 @@ static void sculpt_update_cache_invariants(
if (ss->bm) {
/* Free any remaining layer displacements from nodes. If not and topology changes
- * from using another tool, then next layer toolstroke can access past disp array bounds */
+ * from using another tool, then next layer toolstroke
+ * can access past disp array bounds */
BKE_pbvh_free_layer_disp(ss->pbvh);
}
}
@@ -4805,8 +4809,10 @@ static void sculpt_brush_init_tex(const Scene *scene, Sculpt *sd, SculptSession
MTex *mtex = &brush->mtex;
/* init mtex nodes */
- if (mtex->tex && mtex->tex->nodetree)
- ntreeTexBeginExecTree(mtex->tex->nodetree); /* has internal flag to detect it only does it once */
+ if (mtex->tex && mtex->tex->nodetree) {
+ /* has internal flag to detect it only does it once */
+ ntreeTexBeginExecTree(mtex->tex->nodetree);
+ }
/* TODO: Shouldn't really have to do this at the start of every
* stroke, but sculpt would need some sort of notification when
@@ -4932,7 +4938,8 @@ static bool sculpt_stroke_test_start(bContext *C, struct wmOperator *op,
{
/* Don't start the stroke until mouse goes over the mesh.
* note: mouse will only be null when re-executing the saved stroke.
- * We have exception for 'exec' strokes since they may not set 'mouse', only 'location', see: T52195. */
+ * We have exception for 'exec' strokes since they may not set 'mouse',
+ * only 'location', see: T52195. */
if (((op->flag & OP_IS_INVOKE) == 0) ||
(mouse == NULL) || over_mesh(C, op, mouse[0], mouse[1]))
{
@@ -5177,7 +5184,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot)
"Clicks on the background do not start the stroke");
}
-/**** Reset the copy of the mesh that is being sculpted on (currently just for the layer brush) ****/
+/* Reset the copy of the mesh that is being sculpted on (currently just for the layer brush) */
static int sculpt_set_persistent_base_exec(bContext *C, wmOperator *UNUSED(op))
{
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index 7fa7c7f37b5..5488d1fd2e9 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -86,7 +86,8 @@ typedef struct UvAdjacencyElement {
typedef struct UvEdge {
unsigned int uv1;
unsigned int uv2;
- /* general use flag (Used to check if edge is boundary here, and propagates to adjacency elements) */
+ /* general use flag
+ * (Used to check if edge is boundary here, and propagates to adjacency elements) */
char flag;
} UvEdge;
@@ -745,7 +746,8 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm
edges[counter].uv1 = offset2;
edges[counter].uv2 = offset1;
}
- /* Hack! Set the value of the key to its flag. Now we can set the flag when an edge exists twice :) */
+ /* Hack! Set the value of the key to its flag.
+ * Now we can set the flag when an edge exists twice :) */
flag = BLI_ghash_lookup(edgeHash, &edges[counter]);
if (flag) {
*flag = 1;