Commit Graph

167 Commits

Author SHA1 Message Date
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
52310bd4a7 code cleanup: remove dead assignments, gave mask vars clearer names & moved some mask evaluation funcs into mask_evaluate.c 2012-08-26 18:09:01 +00:00
d35957ba94 code cleanup: split out mask spline evaluation into its own file. 2012-08-26 13:41:40 +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
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
5e78327b92 fix for mask feather intersection checks not working right for non-filled, feathered masks.
now do intersection checks for both sides of the feather.
2012-08-20 16:34:14 +00:00
be513d1b15 fix for missing NULL checks when sequence-strip pointers become NULL because of problems with library linking. 2012-08-13 17:25:03 +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
b282b5275c Mask feather self-intersection check
Enable self-intersection check for preview. In own tests average
time for this operation on mango files was ~0.0015sec, and it was
like 20 splines max which still gives pretty smooth performance
on my core quad machine.

Would think let's check how it works for now, if it'll give some
issues here, would just avoid tessellation on every redraw by
storing tessellation in some cache (probably in mask user).

Another change is related on a way which loop to collapse.
Changed length check with AABB size check. A bit slower but
should be a bit more predictable.
2012-08-06 13:53:38 +00:00
7beb47bd69 fix for freeing NULL pointer. 2012-08-06 13:04:40 +00:00
9ddbd8329e fix uninitialized memory use for mask feather points, also remove some double promotions. 2012-08-05 13:26:39 +00:00
2044b62370 resolve some issues with curve resolution calculaction
- resolution could become so high that it would wrap around  to a negative number, now check for small numbers before doing float division.
- resolution was being calculated in some cases when it already met the clamp value - now this is skipped.
2012-08-04 20:17:22 +00:00
72a3fb15d7 changes to mask editing
- use Alt to modify all mask feather at once while dragging.
- copying a multi-user mask from the interface works now.
- show masks when UV editing isnt used, rather then checking editmode (would give some odd/annoying image space header).
- add a fake mask user by default.
- moving points with LMB drag no longer selects them.
2012-07-31 17:31:34 +00:00
4c02549d5d remove references to raskter from compositor and BKE mask. 2012-07-31 16:04:47 +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
9a2d862123 clamp mask resolution, the occasional crash would happen failing to alloc when adding feather points very close together. 2012-07-27 11:05:08 +00:00
52aa7a4a4c Added utility function to return marker's subframe position
Used in mask parenting stuff.
2012-07-27 10:12:58 +00:00
1543a713a8 copying a mask now copies its animation data too 2012-07-27 08:36:48 +00:00
c42b23030b copy support for mask datablocks 2012-07-27 08:18:11 +00:00
2b133b14ab mask/image viewer now works with non 1:1 image aspect, editing masks in the image viewer should be generally usable now though still some TODO's left. 2012-07-25 20:39:49 +00:00
d9dbea1836 move mask and draw settings into its own struct to be shared between spaces. 2012-07-24 20:33:55 +00:00
9b51503307 style cleanup 2012-07-21 22:58:08 +00:00
1bb7cfded6 Merge mask fixes from tomato branch
--
svn merge -r49075:49076 -r49086:49087  ^/branches/soc-2011-tomato
2012-07-21 09:01:39 +00:00
e80918604a Fixed wrong self-intersection check for non-closed splines 2012-07-18 11:48:13 +00:00
c05af6210e Fixed crash of self-intersection loop in special cases
It was wrongly calculated bucket number per side in cases when some
of segments is filling the whole bounding box across some of dimension.

Solved by limiting buckets at least to 1 in such cases.
2012-07-18 10:22:56 +00:00
2c2e1775f9 Feather self-intersection test speed up
Made some minor optimization such as:

- Avoid using "%" operation in loops, replace with a check
  for index "overflow".
- Use pre-computed values for scaling feather coordinates
  to 0 .. 1 space.

This allowed to reach couple of milliseconds of boost.

Another change is to use higher number of buckets (up to 512).
This doesn't took significantly more memory (like uses only 10MB
of memory for average splines) and allows to have 30-50x boost
for average splines.

Use dynamically calculated number of buckets for this, to be
sure segments would fit two buckets.

Also fixed intersection detection in some cases when edge is
shared between two buckets -- it is possible that such edge
would cross third bucket and intersect edge from there.
2012-07-17 16:22:18 +00:00
e35d3083ec Fixed crash when rasterizing spline with only one point
It was an issue in new feather self-intersection test code.
2012-07-17 10:43:57 +00:00
f4cff34392 disable feather collapse during drawing, its very slow. 2012-07-17 09:56:10 +00:00
1f96470b5d Fixed disappearing in some circumstances feather
Real fix would be to find a point which is definitely now on loop
to be collapsed, but that's for a bit later. This commit should
remove possible stoppers.
2012-07-16 19:23:15 +00:00
5915b53350 Fixed crash caused by recent feather collapse commit 2012-07-16 18:34:57 +00:00
92205486e7 Masks: feather self-intersection collapse function
This implements simple function which collapses internal loops
caused by self-intersections into a singularity.

This loops can't be removed because rasterizer expects points
of feather be aligned with points from spline itself.
2012-07-16 17:54:28 +00:00
f9e63430ac use calculated spline resoltion rather then fixed at 32. 2012-07-16 14:17:01 +00:00
5b4a455569 defailt to ease weight interpolation 2012-07-16 13:12:52 +00:00
8ce53a2a98 new mask rasterizer written to take advantage of the compositors threading, mostly functional but disabled by default (still a little wip). 2012-07-12 20:10:41 +00:00
c8d29b1996 feather points now align with mask outline when called with same resolution. 2012-07-12 09:03:45 +00:00
83d2314edf ability to calculate mask curve and feather with predefined resolution (*_ex functions) 2012-07-11 20:18:46 +00:00
492d9aabe0 some code refactors in raskter.c to sync it with build where mask tiling is being developed. Also adds a bit more mask tiling code. 2012-07-10 04:51:08 +00:00
689403bf57 updating raskter to support tiles compositor. this commit puts in some groundwork code to support tiles's pixel processor 2012-07-09 22:57:23 +00:00
facc2429ab Mask node: create a copy of layers to be rasterized in initExecution
This creates a list of splines to be rasterized in nitExecution which
is being called from main thread. This should resolve possible threading
issues discovered in tomato branch.
2012-07-04 07:10:23 +00:00
32478997ec style cleanup 2012-06-27 18:29:47 +00:00
238d3fa4bb mask re-key feature - mango request. ability to reset selected points shape key data.
useful if you add many keys to one part of a curve, then later want to key another part - but dont want to continuously make the same corrections.
2012-06-22 11:53:49 +00:00
54156e2b82 option to disable feather, since its so slow - for interactively editing masks its useful to be able to disable.
also rename RNA to 'use_antialiasing'
2012-06-21 12:27:57 +00:00
a550b6fe39 Silent masks "alloc new deform spline" debug print 2012-06-20 13:32:30 +00:00
470ad6fc0e Do not check result of BKE_tracking_marker_get -- it shall always
return valid marker. If not -- let blender crash, because that means
something went really bad and silencing this isn't good idea.

Also made mask parenting to tracking data aware of clip's start frame.
2012-06-20 10:54:56 +00:00
f0c724219d Internal refactoring of tracking module, should be no functional changes
- Re-arrange functions in headers and implementation file to make them
  more grouped by entity they're operating with. Also order of functions
  in implementation file should match order of functions in header for
  easier navigation.

- Rename some functions to match conventions of naming public functions.
- Some code de-duplication, still some room for improvements tho.
- Split main 2D tracking functions into smaller steps to make it more clear.

Accidentally OpenMP was disabled in some of previous commits, re-enable it.
2012-06-15 11:03:23 +00:00
ceffc2cd50 add Anti-Aliasing (very rough draft algorithm, NOT FINAL version) to raskter lib. Code is still quite messy but will be replaced when final algo comes in anyway. 2012-06-13 19:57:23 +00:00
c83d37ccc0 mango request
- highlight active mask layers.
- remove keyframes when all layer data is removed.
2012-06-13 08:35:50 +00:00
16dededdf3 remove input socket of mask node, this wasnt used. 2012-06-12 18:36:49 +00:00
b33c5168f4 mask animation keys now editable in the dope sheet (duplicate, transform, delete, select- etc). 2012-06-08 14:31:38 +00:00
4413903370 support for subframe animation evaluation for masks. 2012-06-08 09:35:51 +00:00