Commit Graph

336 Commits

Author SHA1 Message Date
bdc41ca756 Code cleanup: Move output arguments to the end of the list 2014-10-13 18:06:18 +02:00
bcee57e74e Roto: Improve spline sliding vs. curvature detection
If the mouse is closer to the spline than to it's center do a
spline curvature correction operator instead.
2014-10-13 17:59:03 +02:00
99a386da9e Code cleanup: Prevent possible int->float conversion 2014-10-13 17:52:14 +02:00
fa021e3a44 Code cleanup: Use new SQUARE() macro to get squared distance threshold 2014-10-13 17:48:10 +02:00
0a738280e1 Cleanup 2014-10-11 11:44:28 +02:00
8d084e8c8f Ghost Context Refactor
https://developer.blender.org/D643
Separates graphics context creation from window code in Ghost so that they can vary separately.
2014-10-07 15:47:32 -05:00
96c2d67797 Fix T42030: Grabbing the whole mask interfere with grabbing individual curve
This fix is for the final 2.72 release.
2014-10-02 19:28:07 +06:00
2cca83caf1 Fix T41981: Crash by Copy mask splines without splines 2014-09-28 14:37:33 +06:00
6dab4ce598 Fix for missing shortcuts for mask copy/paste
It's a safe fix and would be real cool to have in final release,
it makes roto even easier than mentioned in the previous commit.
2014-09-26 14:40:27 +06:00
dcc281b74a Fix T41961: Crash by Copy n Paste splines to new mask without layer
It makes much more sense to ensure layer before pasteing, makes roto
as easy as it has never been before!
2014-09-26 14:37:30 +06:00
569eafc745 Fix incorrect 2d stabilization for masks
Reported by Sebastian Koenig in IRC>
2014-08-21 15:03:44 +06:00
09fc5d6a37 Roto: Add spline dragging zone in it's center
This dragging zone is visualized as the circle (the same as object origin)
in the spline bounding box center and dragging that circle drags the whole
spline.

Pretty much basic functionality, but quite useful in practice.

Requested by our roto team (Sebastian and Sean :) in IRC.
2014-08-19 21:29:45 +06:00
3196a230a6 Mask slide can be cancelled with RMB now 2014-08-19 17:23:18 +06:00
9a7bfca448 WM: set circle select minimum radius to 1 2014-06-22 13:03:20 +10:00
22a961317a Fix T40546: Duplicate spline breaks shape keys 2014-06-19 13:53:43 +10:00
11a156255d Fix T40412: Moving mask layers does not invalidate mask drawing in the movie clip editor
Issue was caused by a missing WM_event_add_notifier(..) in the mask_layer_move_exec() function...
2014-05-28 20:00:41 +02:00
9bbe42a4d8 Mask vertex colors used to be totally ignored 2014-05-15 18:34:55 +02:00
48881ad1e0 Code cleanup: doxy comments 2014-05-14 15:00:47 +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
c67bd49e56 Code cleanup: use 'const' for arrays (editors) 2014-04-27 00:25:15 +10:00
43d695e82e Code cleanup: view2d api naming 2014-04-21 18:47:17 +10:00
9ae0e585b0 View2d: API Cleanup for view<->region conversion
View2D had some inconsistencies making it error prone in some cases.

- Inconstant checking for NULL x/y args.
  Disallow NULL args for x/y destination pointers, instead add:
  - UI_view2d_region_to_view_x/y
  - UI_view2d_view_to_region_x/y

- '_no_clip' suffix wasn't always used for non-clipping conversion,
  switch it around and use a '_clip' suffix for all funcs that clip.

- UI_view2d_text_cache_add now clips before adding cache.

- '_clip' funcs return a bool to quickly check if its in the view.

- add conversion for rectangles, since this is a common task:
  - UI_view2d_view_to_region_rcti
  - UI_view2d_region_to_view_rctf
2014-04-21 16:59:40 +10:00
ba61992cc3 Fix T39767: Parent in Mask mode crashes 2014-04-17 13:23:53 +10:00
d1b1d194dc Fix for half pixel offset rasterizing masks 2014-04-16 23:25:10 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
392065ed40 Fix for typos in array size 2014-04-04 18:03:17 +06:00
41e2dc7746 Fix for mask slide operators didn't work with LMB selection 2014-04-04 17:23:45 +06:00
1aa753ce88 Mask spline slide didn't respect auto-key 2014-04-04 17:19:36 +06:00
2a62a06e86 Mask spline slide: holding Ctrl will make handles free 2014-04-04 17:08:35 +06:00
0579a6e209 Followup to the previous commit: forgot to tweak handle type 2014-04-04 16:49:50 +06:00
68bc675af4 Mask spline segment slide improvement
This implements weighted slide of second handle, just the
same exact way as it works in Gimp.
2014-04-04 16:44:09 +06:00
896725e0bb Mask point slide: clean-up of SlidePointData structure 2014-04-04 15:11:39 +06:00
31c73586d6 Maks point slide: get rid of jump when you press shift 2014-04-04 15:03:14 +06:00
6cf86f2725 Mask point slide: remove commented out code
The code wasn't needed for quite a while already, so
let's get rid of it.
2014-04-04 14:36:41 +06:00
884b9e27f6 Mask curvature slide: reduce jumps on slide
Also correct wrong logic around tweaking handles type.
2014-04-04 14:34:11 +06:00
0102d57c1d Slide mask spline segment to define it's curvature
This actually implements the idea used in Gimp which is grabbing
an arbitrary point on the spline and dragging it, ensuring spline
goes over this point. This is really useful way to tweak spline
curvature.

Currently only affects on a closest handle, meaning no weighting
on changes for both handles which are adjacent to the same segment
will happen just yet,

Another limitation is that currently such a slide is a big jumpy
when you start sliding. This is because projection is not used
to calculate u value because projection used to fail a lot for
me here and didn't find a nice solution for this yet. But this is
to be improved for sure!
2014-04-03 18:20:17 +06:00
f38331adef Code cleanup: style 2014-04-03 09:24:09 +11:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
42fca2f145 Usual UI messages fixes... 2014-03-31 21:15:56 +02:00
c58f000e57 Vector handles were hidden but were allowed to slide apparently 2014-03-31 18:33:09 +06:00
5e4f789173 Code cleanup: use false/true/bool for masking 2014-03-31 15:23:27 +06:00
851805d84e Masking: fix for initialdeather point not being offset to the mouse position 2014-03-31 15:00:40 +06:00
f06a1b77e2 Maksing: fix issue when it's not possible to drag right handle of aligned handles 2014-03-31 15:00:40 +06:00
482201d1a0 Style cleanup 2014-03-31 05:46:19 +11:00
8b43b9f255 Fix for mask vert add-slide dragging flipped direction 2014-03-29 06:44:40 +11: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
98abc80dcf Correction to previous commit 2014-03-07 21:17:26 +11:00
6ddd54f5a5 Fix T38990: Crash in mask shape re-key 2014-03-07 14:37:14 +11:00
9c79fd1193 Fix T38669: Mask duplicate fails with multiple layers
Allow duplicating splines from inactive layers. This way it's
more useful IMO than restricting duplication to an active layer.

TODO: What should be a behavior for clipboard (currently it copies
splines from an active layer only)?
2014-02-17 12:39:15 +06:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00