Commit Graph

34 Commits

Author SHA1 Message Date
5e4f789173 Code cleanup: use false/true/bool for masking 2014-03-31 15:23:27 +06:00
1af69b6df3 Implement asymmetric and free handles type for masks
Summary:
The title actually says it all, it's just possible to
have independent free handles for mask splines. Also
it's now possible to have aligned handles displayed
as independent handles.

Required changes in quite a few places, but they're
rather straightforward.

From user perspective there's one really visible change
which is removed Handle Type menu from the panel. With
asymmetric handles it's not clear which handle type to
display there. So now the only way to change handle type
is via V-key menu.

Rewrote normal evaluation function to make it deal
with new type of handles we support. Now it works in
the following way:

- Offset the original spline by maximal weight
- Calculate vector between corresponding U positions
  on offset and original spline
- Normalize this vector.

Seems to be giving more adequate results and doesn't
tend to self-intersect as much as old behavior used to,

There're still some changes which needed to be done, but
which are planned for further patch:

- Support colors and handle size via themes.
- Make handles color-coded, just the same as done for
  regular bezier splines in 3D viewport.

Additional changes to make roto workflow even better:
- Use circles to draw handles
- Support AA for handles
- Change click-create-drag to change curvature of the
  spline instead of adjusting point position.

Reviewers: campbellbarton

CC: sebastian_k, hype, cronk

Differential Revision: http://developer.blender.org/D121
2014-03-28 17:54:38 +06:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
e5aaa9d387 Code cleanup: no need to switch to threaded alloc, it's done by task pool 2013-12-25 20:35:20 +06:00
39daf283ae Don't use with_resol suffix for functions which doesn't get resolution 2013-12-20 16:00:05 +06:00
d7983e3638 Option to overlay mask over the footage
Currently supports only two modes:
- Show alpha channel of the mask
- Multiply footage by the mask, which will give
  you final-looking combined image.

TODO: Currently rasterization happens on every
      redraw, need to cache rasterized mask
      somewhere to make redraw more realtime.
2013-10-12 14:09:05 +00:00
98c574e41a use 'greater/less then or equal to' operators rather then adding 1. 2013-08-11 05:40:35 +00:00
8238cd6992 use unsigned int, for mask rasterizer. 2013-05-08 12:54:47 +00:00
5c4f96af2c code cleanup: use 'const float[2]' where possible. 2013-05-08 12:54:33 +00:00
ac224a64f4 Fix #34941: Space.draw_handler_add now supports PRE_VIEW and POST_VIEW callbacks
for more editors: timeline, graph, action, NLA, sequencer, image, clip.
2013-04-10 16:59:55 +00:00
d760a86927 code cleanup: minor changes, replace len_v3 with len_squared_v3 for comparison. 2013-01-21 18:45:31 +00:00
f213ae0b19 style cleanup 2012-11-01 09:54:00 +00:00
f70d2c65d8 rename api functions...
- minf, maxf, mini, maxi --> min_ff, max_ff, min_ii, max_ii
2012-10-23 13:28:22 +00:00
82329ba1c3 Fix #32851: Mouse click coordinates when adding and selecting mask vertices on undistorted footage are off 2012-10-18 13:18:11 +00:00
959dc02f96 fix for error in mask drawing, was using glVertex3fv on 2d verts. (buffer overrun) 2012-10-02 01:10:18 +00:00
232571c61a code cleanup: replace macro for BLI_rect size/center with inline functions. 2012-09-15 11:48:20 +00:00
c5310521f8 fix for drawing non 1:1 aspect masks, transform and selection still need support. 2012-09-13 02:28:48 +00:00
c68890cb87 ensure there are always the same number of feather points and non feather points when drawing. 2012-08-26 20:22:42 +00:00
869382403a mask: skip self intersection on drawing when fill is disabled, since it was only drawing on one side of an unfilled spline. 2012-08-21 09:20:35 +00:00
77f47799dd code cleanup: use BLI_RCT_SIZE macro 2012-08-20 23:06:17 +00:00
719aedaf60 mask - draw both sides of the curve when filled option is disabled. 2012-08-07 13:37:16 +00:00
26cc3dd708 misc mask fixes
- image space used wrong notifiers.
- image notifier now checks for mask mode before listening to mask edits.
- mask keyframes now draw in the image space.
2012-08-01 10:50:39 +00:00
b9f72394fd Fixed wrong mask display with clip's pixel aspect and image editor display aspect != 1.0 2012-07-31 16:40:14 +00:00
ff078d309e change clip utility function arguments to take space data and region rather then the context.
this allows a fix to be applied that corrects the helper line in the image view when transforming a mask.
2012-07-26 22:41:40 +00:00
8509e94d3a initial commit for supporting masks in the image view, currently active seq strip is used as the mask source.
also unify mask drawing code for clip/sequencer/image
2012-07-24 19:29:24 +00:00
7949f0057f generalize mask poll functions and sequencer mask code. 2012-07-24 09:53:29 +00:00
41fe8b9ea9 use a different setting for fill/cyclic - you may want to have unfilled cyclic curves. 2012-07-14 20:53:52 +00:00
468ef74ed7 More spell and typo fixes (mostly visualise->visualize, grey->gray, normalise->normalize). 2012-07-03 19:09:07 +00:00
850d734147 make mask handles draw with an outline - when outline option is enabled. 2012-06-20 18:46:18 +00:00
14a68d3a5f Mark context as const when it's possible and avoid typecasts from const bContext* to bContext* 2012-06-19 14:09:44 +00:00
4cf66322f3 tint non-active mask layers grey 2012-06-13 08:20:43 +00:00
fc07b1fce3 Mask editing: remove use_parent property and use check if paren't id is set instead 2012-06-08 07:54:46 +00:00
c517247fc6 include cleanup, also raskter wasn't building on osx 2012-06-04 17:27:22 +00:00
115322ef08 mask merge (initial copy of editor files) 2012-06-04 15:36:16 +00:00