Commit Graph

36 Commits

Author SHA1 Message Date
9a7bfca448 WM: set circle select minimum radius to 1 2014-06-22 13:03:20 +10:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
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
4ae7ae6f2e Code Cleanup: use bool for return values and correct comments
also remove CDDM_Check, theres no need for it.
2014-01-22 02:53:48 +11:00
63caaa2b12 Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
2013-11-26 06:39:14 +11:00
34aa68f299 fix for using uninitialized boolean vars for mask select more/less 2013-08-06 03:45:11 +00:00
49c61e169b misc edits
- fix for missing None check with recent 'Hidden Wire' draw option.
- avoid int overflow with mesh selection.
- remove ';' outside of functions.
2013-07-20 15:07:57 +00:00
8ff67f12c7 Fix descriptions for mask selection operators and use less ambiguous "letter-spacing" term 2013-07-20 12:24:53 +00:00
3de1458cdf Select more/less tool for mask splines 2013-07-20 10:24:16 +00:00
5c4f96af2c code cleanup: use 'const float[2]' where possible. 2013-05-08 12:54:33 +00:00
e7c15beaf6 code cleanup: use booleans for mesh and selection code. 2013-03-19 23:17:44 +00:00
aaa8a13c49 code cleanup: use const events for modal and invoke operators. 2013-03-13 09:03:46 +00:00
fec81d9b56 use min_ max_ functions in more places.
also fix minor error in MOD decimate when the modifier did nothing the reported face count would be wrong.
2012-10-23 16:21:55 +00:00
27e54f4d37 code cleanup: remove redundant casts. quiet some qualifier warnings. 2012-10-14 07:40:16 +00:00
db70bfc206 code cleanup: use functions to initialize selection user data structs, use radius-squared for circle select comparisons.
edge_fully_inside_rect() & edge_inside_rect() args were shorts when all callers were passing ints.
2012-10-05 15:44:11 +00:00
589ada7f0c code cleanup: correct spelling 2012-09-28 06:45:20 +00:00
56b28635e7 code cleanup: rename BLI_in_rctf() --> BLI_rctf_isect_pt(), to conform with our naming convention. 2012-08-23 18:25:45 +00:00
5e0f254afa utility functions for getting/setting rectangles for operators. 2012-08-08 20:38:55 +00:00
e9d73dbba5 use -FLT_MAX where FLT_MIN was misused 2012-08-07 19:49:38 +00:00
dd6d788400 mask selection invert wasnt working. 2012-08-01 13:34:20 +00:00
f1acd6ac3e code cleanup: pass mouse position as int[2] rather then wmEvent 2012-07-27 15:15:55 +00:00
bef3be5326 code cleanup: mask keys now dont use space-clip keys - could give troubles later on. 2012-07-27 11:56:36 +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
77e7ca6aa8 mask/image editor now works for border select and lasso 2012-07-26 09:54:52 +00:00
c3a8894f57 wip mask/image commit, mostly internal function & added some TODO's 2012-07-25 10:39:54 +00:00
a5127dba57 vector versions of BLI_in_rctf / BLI_in_rcti, (BLI_in_rctf_v, BLI_in_rcti_v)
use where possible.
2012-07-11 18:17:48 +00:00
4b955a60ed Cleanup up space clip API:
- Remove clip/mask specific size/aspect getters, they shall just
  use the same size/aspect ratio.
- Made size getter (and some other public functions) accept context
  instead of SpaceClip. Currently only SpaceClip is being get from
  this context, but later it'll be helpful when adding support of
  editing mask without opening clip in clip editor (in this case
  using render resolution for mask would be ideal, but this
  requires knowing scene in size getter).
- Rearrange some functions in clip_editor.c for easier navigation
  in the file.
2012-06-20 10:28:51 +00:00
4f044f4ec1 Changes in clip editor's public api to make it's more clear
whether getting of some property happens or this property is
being changed.

Also made it more clear whether affecting property belongs
to clip or mask datablock.
2012-06-19 14:26:29 +00:00
6f0ad4ff0f A few UI messages fixes. 2012-06-04 19:43:12 +00:00
d46a6dc59c abbreviate mask-editing to mask-edit 2012-06-04 17:30:54 +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