Commit Graph

2286 Commits

Author SHA1 Message Date
f0ca40f9c1 Code cleanup: function calls 2014-03-25 10:10:00 +11:00
05deec3204 Code cleanup: rename easing functions with BLI_easing_ prefix 2014-03-25 09:59:10 +11:00
673b665471 Code cleanup: rename BLI_math_easing to BLI_easing
Many hard coded values and really specific to time & keyframes.
2014-03-25 09:59:10 +11:00
32d5d072a0 Code cleanup: float/double promotion 2014-03-24 13:31:14 +11:00
551d1a1ed5 Code cleanup: style 2014-03-24 13:14:19 +11:00
25b4b5fb9f Fix for invalid abs() use (from daccaa7) 2014-03-24 12:57:18 +11:00
1206faeb99 Warning cleanup:
* Comparison in utf detection code always failed
* Cast to integer to silence grumpy 64bit gcc
2014-03-22 14:41:38 +02:00
44dc72334d Compile fix for Windows, M_PI was undefined. 2014-03-21 17:46:18 +01:00
daccaa713b Patch T22084: Robert Penner Easing Equations for FCurves
This commit introduces support for a number of new interpolation types
which are useful for motion-graphics work. These define a number of
"easing equations" (basically, equations which define some preset
ways that one keyframe transitions to another) which reduce the amount
of manual work (inserting and tweaking keyframes) to achieve certain
common effects. For example, snappy movements, and fake-physics such
as bouncing/springing effects.

The additional interpolation types introduced in this commit can be found
in many packages and toolkits (notably Qt and all modern web browsers).
For more info and a few live demos, see [1] and [2].


Credits:
* Dan Eicher (dna)              - Original patch
* Thomas Beck (plasmasolutions) - Porting/updating patch to 2.70 codebase
* Joshua Leung (aligorith)      - Code review and a few polishing tweaks

Additional Resources:
[1] http://easings.net
[2] http://www.robertpenner.com/easing/
2014-03-22 03:00:27 +13:00
27e86ed832 Code cleanup: use bools 2014-03-20 22:56:28 +11:00
c6252d6e60 Math Lib: add angle_qt functions 2014-03-20 15:15:29 +11:00
19fcb4de44 Fix kdopbvh incorrect checks for failed allocs
also assert for invalid args
2014-03-20 10:49:30 +11:00
a91247c2b4 Code cleanup: unreachable break/return 2014-03-19 12:47:09 +11:00
ec55074f89 Code cleanup: jitter, use 2d float array 2014-03-18 10:52:38 +11:00
06de5be90e Fix T39228 Gamma/lift/gain are burned out in the circular color pickers
and value/lightness slider stops midway.

Issue here is manyfold:

Color wheel does not support properties with different soft min/max
values than 1.0 (which after experimenting a little I left as is), and
also color management is completely destroying the mapping between the
value slider and the RNA property value range. To solve this I have
disabled color management by setting the property to gamma corrected
(only in RNA, Sequence editor coders please check!), otherwise it will
just become a big mess of tracking where color comes from and what kind
of color transforms it needs in different color pickers (if property has
non normalized range etc). HSL is not really meant to represent colors
outside a normalized space so I have disabled setting lightness above
1.0 in this model.

This will work, however it is hacking a color picker to do something
other than what it is supposed to do: pick a color from the screen
accurately. Which means normalized values always. The non normalized
colors picked for lift/gain/gamma through the pickers do not correspond
to any accurate colors; they are rather a user friendly way to 'sort of'
choose a color and a gamma with an indication of maximum value.

I think that lift/gamma/gain nodes need a dedicated widget for this
(besides it is quite clear that some options are written for that use
case) -or- a separate gamma multiplier for the picked color (which
should itself be in a normalized space)
2014-03-18 01:08:36 +02:00
7da2175271 KDTree: deprecate 'normal' argument
Normals for each kdtree node were allocated but never used,
and search args only use in particles/boids code.
2014-03-18 09:14:47 +11:00
ec4e12d9a2 Code cleanup: comments and typos 2014-03-18 05:40:18 +11:00
0e9084d5ec Fix T39210: Grid Fill is generating mesh that's inconsistent with selected edge loops
Issue was in BLI's rotation_between_vecs_to_quat(), which did not handled correctly cases where both vectors are colinear.

Patch by Campbell Barton and me.

Issue originaly tracked down by Yan Shi, many thanks!
2014-03-16 16:31:19 +01:00
2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
bce924b43c HSL color wheel implementation.
This is a standard Hue - Saturation - Lightness model
(see for instance entry on wikipedia here: https://en.wikipedia.org/wiki/HSL_and_HSV)
Note though the difference between HSV and HSL saturation, which are not the same.

The advantage of having this color selection scheme is that artists can select
shades and tints of a color easily by using the lightness slider. Also colors
are arranged on (approximated) perceived lightness on the color wheel.

Beware, Old files opened with this preference saved will crash!

Reviewers: sergey, brecht, campbellbarton

Differential Revision: https://developer.blender.org/D385
2014-03-12 18:58:50 +02:00
921c829bcf Code cleanup: redundant normalize in bmbvh ray cast 2014-03-12 18:30:37 +11:00
6a4567b9ab BLI Rect: utility function to transform a point using 2 rect's 2014-03-09 15:48:09 +11:00
f01d19431d Fix T38873: Crashing on undo of ocean modifier.
Issue of this bug is that most part of fftw is not thread safe, only compute-intensive fftw_execute & co are.

Since smoke was affected by this issue as well, a global fftw mutex was added to BLI_threads.
Audaspace also uses fftw in one of its readers (AUD_BandPassReader.cpp),
but this is not an issue currently since this code is disabled in CMake/scons files.

There was another threading issue with smoke, we need to copy dm used by emit_from_derivedmesh(),
as it is modified by this func.

Reviewers: sergey, brecht

Reviewed By: brecht

CC: brecht

Differential Revision: https://developer.blender.org/D374
2014-03-01 21:05:50 +01:00
9737717234 Fix for some unlikely memory leaks, remove redundant checks 2014-03-01 20:14:20 +11:00
13ea967cce Code cleanup: correct abs use and quiet warnings 2014-03-01 14:26:18 +11:00
b5d6f14290 Fix T38858: Crazy spaces was unpredictable with co-linear edges 2014-02-27 12:28:40 +11:00
d76bcf98a3 MSVC: improve warnings for scons and cmake
Some int/float conversion warnings were disabled by buildsystems but
re-enabled by BLI_winstuff.h, the warnigns relate to conversions not
considered issues on other systems so better just quiet them.
2014-02-19 17:37:02 +11:00
c9233bfd82 Code cleanup: style 2014-02-19 08:02:59 +11:00
05235d86ef Fix for issue in mask overlap with no splines in the mask. 2014-02-17 18:55:03 +11:00
4134bdc75c Fix for rare crash in recent mask option to check overlaps 2014-02-17 15:15:49 +11:00
80e21f6fc5 Code clearnup: warnings 2014-02-14 22:03:09 +11:00
dd1e02432e workaround for building with mingw32 2014-02-14 15:15:20 +11:00
ae8327dbf3 Mask: add option to detect self intersections 2014-02-13 19:12:28 +11:00
c85e66e7fe Scanfill: add user-flags for edges and verts, useful elsewhere. 2014-02-13 16:46:51 +11:00
fcb06097a5 Scanfill: name flags better and comment unused SF_EDGE_BOUNDARY flag. 2014-02-13 14:13:42 +11:00
f27acb5b56 ListBase: add BLI_sortlist_r api function, remove check for NULL callback 2014-02-13 13:21:16 +11:00
108ad34429 Mask: option not to treat overlapping curves as holes 2014-02-13 11:48:46 +11:00
e2089e1406 NDOF: fix for negative colors and flickering hue when picking with HSVCUBE 2014-02-12 21:05:24 +11:00
2f01be2b2f UI: panel tabs, use simple color interpolation that ignores alpha 2014-02-10 17:06:56 +11:00
a84bcea070 OSX/scons: allow for compiling with clang-openmp-3.4
See: http://clang-omp.github.io
+ fix a longstanding bad include in darwin-config
2014-02-09 18:03:13 +01:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
6110a5bdef Scanfill: use poly_nr as an index rather then index + 1 2014-02-06 02:12:46 +11:00
41d23116aa Scanfill: malloc arrays and zero init members 2014-02-06 01:03:02 +11:00
d598dcd461 Code cleanup: remove scdata from ScanFillContext 2014-02-05 05:39:28 +11:00
6c17d2141b Scanfill: optimize filling curves, text, masks - skip calculating holes
Support for tagging polygon numbers when adding scanfill data,
saves having to calculate connectivity afterwards (which can take approx half overall scanfill time for complex curves).
2014-02-05 05:27:01 +11:00
db74968402 Scanfill: minor optimization, comment unused code, avoid vert loop 2014-02-05 05:27:01 +11:00
76543574bc Code cleanup: declarations for removed functions 2014-02-04 07:20:19 +11:00
8b1731e13d Scanfill: skip checks for loose edges when they can't occur
Only editmesh needs this, text, curves, masks - can all skip this check
2014-02-04 02:57:27 +11:00
0d7586739a Code cleanup: replace while -> for loops 2014-02-04 02:23:34 +11:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00