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:
authorJeroen Bakker <jeroen@blender.org>2022-09-20 09:28:35 +0300
committerJeroen Bakker <jeroen@blender.org>2022-09-20 09:28:35 +0300
commitb950a8fb797a6248f0a89e47b960ae9a3638ac89 (patch)
treeb43decf75ac4b4ed3c079f4c6c788138d996e511
parentc279a0d931afab9dab9b7f5516d24fbe304d2103 (diff)
Painting: Don't calculate rake rotation when texture is not set.
Currently the rake rotation is calculated when the angle mode is set. Even when the texture isn't valid. This change will only calculate the rake rotation when the texture is valid and the angle mode is set.
-rw-r--r--source/blender/blenkernel/intern/paint.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/paint.cc b/source/blender/blenkernel/intern/paint.cc
index 5dc8e3e0112..0181c6e7eac 100644
--- a/source/blender/blenkernel/intern/paint.cc
+++ b/source/blender/blenkernel/intern/paint.cc
@@ -1315,13 +1315,22 @@ void paint_update_brush_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, f
}
}
+static bool paint_rake_rotation_active(const MTex &mtex)
+{
+ return mtex.tex && mtex.brush_angle_mode & MTEX_ANGLE_RAKE;
+}
+
+static bool paint_rake_rotation_active(const Brush &brush)
+{
+ return paint_rake_rotation_active(brush.mtex) || paint_rake_rotation_active(brush.mask_mtex);
+}
+
bool paint_calculate_rake_rotation(UnifiedPaintSettings *ups,
Brush *brush,
const float mouse_pos[2])
{
bool ok = false;
- if ((brush->mtex.brush_angle_mode & MTEX_ANGLE_RAKE) ||
- (brush->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE)) {
+ if (paint_rake_rotation_active(*brush)) {
const float r = RAKE_THRESHHOLD;
float rotation;