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>2016-01-21 13:05:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-01-21 13:28:07 +0300
commitf758ee50e6d96e5342a9971bd76d9ff0352aafa3 (patch)
tree17dd061e81f09a0966984ceaf13818c908b76109 /source/blender/editors/sculpt_paint/paint_utils.c
parentadcef2bd3686a887fba8f08192751ab6736b9782 (diff)
Sculpt: Add rake option to snake-hook
This allows for dragging out shapes that rotate to follow the cursor motion. Values over 1 can be set for 'interesting' artistic effects.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_utils.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 7b66632fa42..dc0852aaee0 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -397,6 +397,29 @@ void flip_v3_v3(float out[3], const float in[3], const char symm)
out[2] = in[2];
}
+void flip_qt_qt(float out[4], const float in[4], const char symm)
+{
+ float axis[3], angle;
+
+ quat_to_axis_angle(axis, &angle, in);
+ normalize_v3(axis);
+
+ if (symm & PAINT_SYMM_X) {
+ axis[0] *= -1.0f;
+ angle *= -1.0f;
+ }
+ if (symm & PAINT_SYMM_Y) {
+ axis[1] *= -1.0f;
+ angle *= -1.0f;
+ }
+ if (symm & PAINT_SYMM_Z) {
+ axis[2] *= -1.0f;
+ angle *= -1.0f;
+ }
+
+ axis_angle_normalized_to_quat(out, axis, angle);
+}
+
/* used for both 3d view and image window */
void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_proj, bool use_palette)
{