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:
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c b/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c
index b52036d753c..e47a94dff90 100644
--- a/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c
+++ b/source/blender/editors/sculpt_paint/sculpt_multiplane_scrape.c
@@ -47,7 +47,6 @@
#include "paint_intern.h"
#include "sculpt_intern.h"
-#include "GPU_draw.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_matrix.h"
@@ -376,7 +375,7 @@ void SCULPT_do_multiplane_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes,
/* Calculate the final left and right scrape planes. */
float plane_no[3];
float plane_no_rot[3];
- float y_axis[3] = {0.0f, 1.0f, 0.0f};
+ const float y_axis[3] = {0.0f, 1.0f, 0.0f};
float mat_inv[4][4];
invert_m4_m4(mat_inv, mat);
@@ -400,10 +399,15 @@ void SCULPT_do_multiplane_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes,
}
void SCULPT_multiplane_scrape_preview_draw(const uint gpuattr,
+ Brush *brush,
SculptSession *ss,
const float outline_col[3],
const float outline_alpha)
{
+ if (!(brush->flag2 & BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW)) {
+ return;
+ }
+
float local_mat_inv[4][4];
invert_m4_m4(local_mat_inv, ss->cache->stroke_local_mat);
GPU_matrix_mul(local_mat_inv);
@@ -414,11 +418,11 @@ void SCULPT_multiplane_scrape_preview_draw(const uint gpuattr,
float offset = ss->cache->radius * 0.25f;
- float p[3] = {0.0f, 0.0f, ss->cache->radius};
- float y_axis[3] = {0.0f, 1.0f, 0.0f};
+ const float p[3] = {0.0f, 0.0f, ss->cache->radius};
+ const float y_axis[3] = {0.0f, 1.0f, 0.0f};
float p_l[3];
float p_r[3];
- float area_center[3] = {0.0f, 0.0f, 0.0f};
+ const float area_center[3] = {0.0f, 0.0f, 0.0f};
rotate_v3_v3v3fl(p_r, p, y_axis, DEG2RADF((angle + 180) * 0.5f));
rotate_v3_v3v3fl(p_l, p, y_axis, DEG2RADF(-(angle + 180) * 0.5f));