Commit Graph

50 Commits

Author SHA1 Message Date
676d790d29 Cleanup: use rna_enum_ prefix for RNA enums
Definitions could shadow local vars.
2015-11-23 17:40:09 +11:00
d5fb0e517c Cleanup: rename 'datablocks' -> 'data-blocks'
Similar to addons -> add-ons, for reading it fits better to hyphenate.
2015-10-24 02:44:43 +11:00
2e2dc9b9e3 Refactor translation code out of blenfont
- Add blentranslation `BLT_*` module.
- moved & split `BLF_translation.h` into (`BLT_translation.h`, `BLT_lang.h`).
- moved `BLF_*_unifont` functions from `blf_translation.c` to new source file `blf_font_i18n.c`.
2015-08-18 07:01:26 +10:00
3ce4a58aa9 Cleanup: duplicate includes 2015-06-18 06:32:01 +10:00
5114637967 Fix T45016, mask animation data lost after layer rename
We need to fix up animation data.
2015-06-11 19:34:21 +02: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
ae8327dbf3 Mask: add option to detect self intersections 2014-02-13 19:12:28 +11:00
108ad34429 Mask: option not to treat overlapping curves as holes 2014-02-13 11:48:46 +11:00
70f2389f5a Code cleanup: be less vague checking invalid index values 2014-02-01 02:01:00 +11:00
348cf17448 Code Cleanup: no need to pass empty strings as default values 2014-01-16 22:00:29 +11:00
8f747c4923 Code cleanup: use bool instead of int in mask module 2013-10-29 18:46:45 +00:00
202109a8f5 code cleanup: set enums as static or add RNA_enum_types.h where they are used elsewhere.
also minor style cleanup.
2013-09-11 21:27:14 +00:00
24ce60cfe4 Merge plane track feature from tomato branch
This commit includes all the changes made for plane tracker
in tomato branch.

Movie clip editor changes:

- Artist might create a plane track out of multiple point
  tracks which belongs to the same track (minimum amount of
  point tracks is 4, maximum is not actually limited).

  When new plane track is added, it's getting "tracked"
  across all point tracks, which makes it stick to the same
  plane point tracks belong to.

- After plane track was added, it need to be manually adjusted
  in a way it covers feature one might to mask/replace.

  General transform tools (G, R, S) or sliding corners with
  a mouse could be sued for this. Plane corner which
  corresponds to left bottom image corner has got X/Y axis
  on it (red is for X axis, green for Y).

- Re-adjusting plane corners makes plane to be "re-tracked"
  for the frames sequence between current frame and next
  and previous keyframes.

- Kayframes might be removed from the plane, using Shit-X
  (Marker Delete) operator. However, currently manual
  re-adjustment or "re-track" trigger is needed.

Compositor changes:

- Added new node called Plane Track Deform.

- User selects which plane track to use (for this he need
  to select movie clip datablock, object and track names).

- Node gets an image input, which need to be warped into
  the plane.

- Node outputs:
  * Input image warped into the plane.
  * Plane, rasterized to a mask.

Masking changes:

- Mask points might be parented to a plane track, which
  makes this point deforming in a way as if it belongs
  to the tracked plane.

Some video tutorials are available:
- Coder video: http://www.youtube.com/watch?v=vISEwqNHqe4
- Artist video: https://vimeo.com/71727578

This is mine and Keir's holiday code project :)
2013-08-16 09:46:30 +00:00
1693988926 Changes for masks API
Made it more consistent with blender convensions
and now it's very familiar to curve's python api.

- Made it spline.points.add(count) wich is more
  efficient in cases lots of points are adding.
  (points.new was removed tho).

- Removed mask_layer.splines.add(), now it's only
  mask_layer.splines.new(), which is how splines
  are adding for curves.
2013-05-24 11:19:57 +00:00
80a6654a81 Masks api improvements
- Added MaskLayer.splines.new (which creates single spline
  and returns pointer to it).
- Added MaskLayer.splines.remove() to remove given spline.
- Added MaskSpline.points.new() which creates new point
  in the origin and returns pointer to it.
- Added MaskSpline.points.remove() to remove given point.
2013-05-23 10:50:55 +00:00
fb6d696f6a Added RNA access to mask spline's points.
Straightforward patch, point tructure was already defined,
was just matter of defining RNA collection property for
mask spline.

Available via: mask.layers[0].splines[0].points
2013-05-13 12:24:35 +00:00
c1f408c058 Partial revert of own commits r56604 and r56603:
* Reverted the changes to code comments, as suggested by Campbell. It makes it more hard to follow.
* Only keep changes to actual UI messages.
2013-05-09 10:03:38 +00:00
b98550590b UI naming consistency:
* DopeSheet -> Dope Sheet. No need to glue the words together. 

Only changed comments and UI strings, no functional changes. Request by Dalai Felinto.
2013-05-08 21:05:52 +00:00
7dde355185 fix [#34958] keyframe many items would fail if there was a (") in the text. 2013-04-23 20:10:22 +00:00
5262fcd4d3 I18n: various fixing.
* Reflect changes stated in prev commit about contexts in py code.

* Add a "Plural" context, to handle cases where english does not mark plural at all (e.g. shorten labels of only one adjective). Not so happy with that, but can't see any other way to do it, for now.

* Abuse "ID_CURVE" context for all falloff curves (this should solve some confusion issues, e.g. "sharp"...).
2013-03-28 15:41:43 +00:00
dfa8540cdf use bool for rna funcs. 2013-03-07 02:44:55 +00:00
34fecdd60e code cleanup: use min/max functions rather then macros. 2012-11-07 12:31:05 +00:00
a31449edad all remove functions now invalidate the RNA objects passed, to help script authors to avoid bugs with accessing removed data. 2012-11-02 09:41:26 +00:00
c9dade4fe0 Big i18n commit: add "reports" from bmesh/readfile/tracking/dynapaint (and a few others), and another bunch of UI messages tweaks/fixes, as well as some BKE_report()<->BKE_reportf()... 2012-10-26 17:32:50 +00:00
6c1da4d022 code cleanup: make many functions static 2012-09-22 14:07:55 +00:00
13254cde8c Alternate mask spline feather offset calculation method: now there are 2 [Even | Smooth]
- Even preserves thickness but can give unsightly loops
- Smooth gives nicer shape but can give unsightly feather/spline mismatch for 'S' shapes created by beziers.

This is an example where smooth works much nicer.

http://www.graphicall.org/ftp/ideasman42/mask_compare.png
2012-08-27 09:44:56 +00:00
f67d0e63a4 add new mask blend mode: 'Merge Subtract'. gives better results when using feather on overlapping masks when one subtracts from another. 2012-08-22 11:58:59 +00:00
a334b5a4b6 Made feather self-intersection check an option.
Useful in cases when masking stuff like self-intersecting
ropes. This could probably be smarter option, but can't
currently think about robust approach here.
2012-08-06 15:20:14 +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
c41e1e434a code cleanup: replace MIN2/MAX2 with minf/maxf 2012-07-29 16:59:51 +00:00
3ec212fd71 patch [#32195] MASKS: Canonical Porter Duff algorithm for merge missing.
from Troy Sobotka (sobotka)

This gives nicer blending then 'ADD', setting as default for new masks.
2012-07-28 11:36:01 +00:00
603842fad4 use 2d vectors for mask point access. 2012-07-23 22:39:26 +00:00
2029b0205a mask layer rna api: add exception when removing incorrect masklayer from mask, add mask.layers.clear() 2012-07-23 21:47:11 +00:00
c8029bffd9 workaround for a bug with zero edges getting removed got feather faces out of sync and crashed 2012-07-18 16:24:13 +00:00
c0e004bd61 add difference blending mode, also fix error in last commit 2012-07-18 13:44:48 +00:00
407347fd1f mask fill/cyclic toggle wasnt refreshing compo nodes 2012-07-16 09:41:38 +00:00
60cfbaeb1e mask blending modes: lighten/darken/multiply/replace 2012-07-16 07:23:16 +00:00
02bac0bebf falloff option for mask layers 2012-07-15 03:11:07 +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
32478997ec style cleanup 2012-06-27 18:29:47 +00:00
906a635bd0 Store parent's initial position when setting mask's parent from the interface 2012-06-20 11:16:51 +00:00
4cf66322f3 tint non-active mask layers grey 2012-06-13 08:20:43 +00:00
5f2409e5ec add listener in action space for mask changes so dopesheet redraws + other minor changes. 2012-06-08 14:46:17 +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
bdf9e02346 new sequence strip type for masks. 2012-06-07 18:24:36 +00:00
ae8103240d mask editing
- clear feather weights (alt+s)
- fix for glitch where placing the feather would jitter.
2012-06-05 09:37:44 +00:00
6f0ad4ff0f A few UI messages fixes. 2012-06-04 19:43:12 +00:00
489fa2d108 remaining mask files from tomato. these wont get svn history carried over. 2012-06-04 15:49:58 +00:00