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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-06-15 22:31:46 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-06-15 22:31:46 +0400
commit8fd2267e56d3d0b6bb860800eb8059bcbfa0b501 (patch)
treebeac90d8d2cb3a335f1675c4df4c3c231155518a /source/blender/editors/space_clip/clip_draw.c
parentcde4d7284891b07f4a221868f15b4b90a6b42585 (diff)
Changed behavior of how pattern is controlling by mouse:
- Removed scaling option which used to be Ctrl+Slide of individual pattern corner. - Added extra rectangle area which is being drawing around pattern and which supports the following things: * Slide by it's left upper corner would define offset of marker * Slide by it's right bottom corner would scale overall pattern - Added extra handle which is drawing from pattern center and which is being used to define scale and rotation of pattern area.
Diffstat (limited to 'source/blender/editors/space_clip/clip_draw.c')
-rw-r--r--source/blender/editors/space_clip/clip_draw.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 9b0c5f6296d..8deb83b6f0d 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -812,6 +812,9 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
if ((sc->flag & SC_SHOW_MARKER_PATTERN) && ((track->pat_flag & SELECT) == sel || outline)) {
int i;
+ float pat_min[2], pat_max[2];
+ float dx = 12.0f / width, dy = 12.0f / height;
+ float tilt_ctrl[2];
if (!outline) {
if (track->pat_flag & SELECT)
@@ -825,6 +828,37 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
draw_marker_slide_square(marker->pattern_corners[i][0], marker->pattern_corners[i][1],
patdx / 1.5f, patdy / 1.5f, outline, px);
}
+
+ /* ** sliders to control overall pattern ** */
+ add_v2_v2v2(tilt_ctrl, marker->pattern_corners[1], marker->pattern_corners[2]);
+
+ BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max);
+
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple(3, 0xaaaa);
+
+ glBegin(GL_LINE_LOOP);
+ glVertex2f(pat_min[0] - dx, pat_min[1] - dy);
+ glVertex2f(pat_max[0] + dx, pat_min[1] - dy);
+ glVertex2f(pat_max[0] + dx, pat_max[1] + dy);
+ glVertex2f(pat_min[0] - dx, pat_max[1] + dy);
+ glEnd();
+
+ glBegin(GL_LINES);
+ glVertex2f(0.0f, 0.0f);
+ glVertex2fv(tilt_ctrl);
+ glEnd();
+
+ glDisable(GL_LINE_STIPPLE);
+
+ /* marker's offset slider */
+ draw_marker_slide_square(pat_min[0] - dx, pat_max[1] + dy, patdx, patdy, outline, px);
+
+ /* pattern re-sizing triangle */
+ draw_marker_slide_triangle(pat_max[0] + dx, pat_min[1] - dy, patdx, patdy, outline, px);
+
+ /* slider to control pattern tilt */
+ draw_marker_slide_square(tilt_ctrl[0], tilt_ctrl[1], patdx, patdy, outline, px);
}
glPopMatrix();