Commit: 351744f2b01c30d7a2caeeb64680d41ede4644b0
Author: aousdfh
Date: Tue Jul 6 01:21:14 2021 +0200
Branches: sculpt-dev
https://developer.blender.org/rB351744f2b01c30d7a2caeeb64680d41ede4644b0
Sculpt Array: Debug path drawing
===================================================================
M source/blender/editors/sculpt_paint/paint_cursor.c
M source/blender/editors/sculpt_paint/sculpt_array.c
M source/blender/editors/sculpt_paint/sculpt_intern.h
===================================================================
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c
b/source/blender/editors/sculpt_paint/paint_cursor.c
index d2581c866ce..9247ddd422b 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1782,6 +1782,11 @@ static void
paint_cursor_cursor_draw_3d_view_brush_cursor_active(PaintCursorCont
pcontext->pos, brush, ss, pcontext->outline_col,
pcontext->outline_alpha);
}
+ if (brush->sculpt_tool == SCULPT_TOOL_ARRAY) {
+ /* Draw Array Path. */
+ SCULPT_array_path_draw(pcontext->pos, brush, ss);
+ }
+
if (brush->sculpt_tool == SCULPT_TOOL_CLOTH) {
if (brush->cloth_force_falloff_type == BRUSH_CLOTH_FORCE_FALLOFF_PLANE) {
SCULPT_cloth_plane_falloff_preview_draw(
diff --git a/source/blender/editors/sculpt_paint/sculpt_array.c
b/source/blender/editors/sculpt_paint/sculpt_array.c
index 6aabc8f05a0..d69853fc93c 100644
--- a/source/blender/editors/sculpt_paint/sculpt_array.c
+++ b/source/blender/editors/sculpt_paint/sculpt_array.c
@@ -400,7 +400,28 @@ void SCULPT_do_array_brush(Sculpt *sd, Object *ob,
PBVHNode **nodes, int totnode
}
sculpt_array_ensure_original_coordinates(ob, ss->cache->array);
+ sculpt_array_stroke_sample_add(ob, ss->cache->array);
sculpt_array_update(ob, brush, ss->cache->array);
sculpt_array_deform(sd, ob, nodes, totnode);
+}
+
+void SCULPT_scultp_array_path_draw(const uint gpuattr,
+ Brush *brush,
+ SculptSession *ss) {
+ SculptArray *array = ss->cache->array;
+ if (!array) {
+ return;
+ }
+
+ if (!array->path.points) {
+ return;
+ }
+
+ const int tot_points = array->path.tot_points - 1;
+ immBegin(GPU_PRIM_LINE_STRIP, tot_points);
+ for (int i = 0; i < tot_points; i++) {
+ immVertex3fv(gpuattr, array->path.points[i].co);
+ }
+ immEnd();
}
\ No newline at end of file
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h
b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 10bad3cd72b..ba6981edce3 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -543,6 +543,9 @@ void SCULPT_boundary_pivot_line_preview_draw(const uint
gpuattr, struct SculptSe
/* Array Brush. */
void SCULPT_do_array_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int
totnode);
void SCULPT_array_datalayers_free(Object *ob);
+void SCULPT_array_path_draw(const uint gpuattr,
+ Brush *brush,
+ SculptSession *ss);
/* Multi-plane Scrape Brush. */
void SCULPT_do_multiplane_scrape_brush(Sculpt *sd, Object *ob, PBVHNode
**nodes, int totnode);
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs