Commit Graph

2699 Commits

Author SHA1 Message Date
Campbell Barton
f0ca40f9c1 Code cleanup: function calls 2014-03-25 10:10:00 +11:00
Campbell Barton
05deec3204 Code cleanup: rename easing functions with BLI_easing_ prefix 2014-03-25 09:59:10 +11:00
Campbell Barton
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
Campbell Barton
32d5d072a0 Code cleanup: float/double promotion 2014-03-24 13:31:14 +11:00
Campbell Barton
551d1a1ed5 Code cleanup: style 2014-03-24 13:14:19 +11:00
Campbell Barton
25b4b5fb9f Fix for invalid abs() use (from daccaa7) 2014-03-24 12:57:18 +11:00
Antony Riakiotakis
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
Thomas Dinges
44dc72334d Compile fix for Windows, M_PI was undefined. 2014-03-21 17:46:18 +01:00
Joshua Leung
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
Lukas Tönne
2ea78fb28f Fix for clang build warnings: ATTR_WARN_UNUSED_RESULT is used after
the inline definitions are included, which gives lots of warnings
"attribute declaration must precede definition".

See also rB83617429cf28f2a19e991a0f71d892fc159a4419
2014-03-20 13:16:59 +01:00
Campbell Barton
27e86ed832 Code cleanup: use bools 2014-03-20 22:56:28 +11:00
Campbell Barton
c6252d6e60 Math Lib: add angle_qt functions 2014-03-20 15:15:29 +11:00
Campbell Barton
19fcb4de44 Fix kdopbvh incorrect checks for failed allocs
also assert for invalid args
2014-03-20 10:49:30 +11:00
Campbell Barton
a91247c2b4 Code cleanup: unreachable break/return 2014-03-19 12:47:09 +11:00
Campbell Barton
ec55074f89 Code cleanup: jitter, use 2d float array 2014-03-18 10:52:38 +11:00
Antony Riakiotakis
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
Campbell Barton
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
Campbell Barton
ec4e12d9a2 Code cleanup: comments and typos 2014-03-18 05:40:18 +11:00
Bastien Montagne
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
Campbell Barton
2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
Antony Riakiotakis
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
Campbell Barton
921c829bcf Code cleanup: redundant normalize in bmbvh ray cast 2014-03-12 18:30:37 +11:00
Campbell Barton
6a4567b9ab BLI Rect: utility function to transform a point using 2 rect's 2014-03-09 15:48:09 +11:00
Bastien Montagne
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
Campbell Barton
9737717234 Fix for some unlikely memory leaks, remove redundant checks 2014-03-01 20:14:20 +11:00
Campbell Barton
13ea967cce Code cleanup: correct abs use and quiet warnings 2014-03-01 14:26:18 +11:00
Campbell Barton
3a99fa5d7f Revert own changes to CLAMP and CLAMPIS, caused T38875 2014-02-28 11:47:02 +11:00
Campbell Barton
b5d6f14290 Fix T38858: Crazy spaces was unpredictable with co-linear edges 2014-02-27 12:28:40 +11:00
Campbell Barton
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
Campbell Barton
c9233bfd82 Code cleanup: style 2014-02-19 08:02:59 +11:00
Campbell Barton
4c512fb642 Compile Attrs: add ATTR_RETURNS_NONNULL 2014-02-17 23:32:00 +11:00
Campbell Barton
05235d86ef Fix for issue in mask overlap with no splines in the mask. 2014-02-17 18:55:03 +11:00
Campbell Barton
4134bdc75c Fix for rare crash in recent mask option to check overlaps 2014-02-17 15:15:49 +11:00
Campbell Barton
78bd029bbe MSVC: add errors for BLI_strict_flags.h 2014-02-16 14:50:15 +11:00
Thomas Dinges
aa517ab3a4 Compile fix for 004decc1d940... 2014-02-15 14:38:49 +01:00
Campbell Barton
004decc1d9 Code cleanup: warnings 2014-02-15 18:21:07 +11:00
Campbell Barton
80e21f6fc5 Code clearnup: warnings 2014-02-14 22:03:09 +11:00
Campbell Barton
dd1e02432e workaround for building with mingw32 2014-02-14 15:15:20 +11:00
Sergey Sharybin
83617d24d5 Rework carve integration into boolean modifier
Goal of this commit is to support NGons for boolean modifier
(currently mesh is being tessellated before performing boolean
operation) and also solve the limitation of loosing edge custom
data layers after boolean operation is performed.

Main idea is to make it so boolean modifier uses Carve library
directly via it's C-API, avoiding BSP intermediate level which
was doubling amount of memory needed for the operation and which
also used quite reasonable amount of overhead time.

Perhaps memory usage and CPU usage are the same after all the
features are implemented but we've got support now:

- ORIGINDEX for all the geometry
- Interpolation of edge custom data (seams, crease)
- NGons support

Triangulation rule is changed now as well, so now non-flat
polygons are not being merged back after Carve work. This is
so because it's not so trivial to support for NGons and
having different behavior for quads and NGons is even more
creepy.

Reviewers: lukastoenne, campbellbarton

Differential Revision: https://developer.blender.org/D274
2014-02-13 17:16:53 +06:00
Campbell Barton
ae8327dbf3 Mask: add option to detect self intersections 2014-02-13 19:12:28 +11:00
Campbell Barton
c85e66e7fe Scanfill: add user-flags for edges and verts, useful elsewhere. 2014-02-13 16:46:51 +11:00
Campbell Barton
fcb06097a5 Scanfill: name flags better and comment unused SF_EDGE_BOUNDARY flag. 2014-02-13 14:13:42 +11:00
Campbell Barton
3fe036ad5f ListBase: add attributes to api functions 2014-02-13 13:21:16 +11:00
Campbell Barton
f27acb5b56 ListBase: add BLI_sortlist_r api function, remove check for NULL callback 2014-02-13 13:21:16 +11:00
Campbell Barton
108ad34429 Mask: option not to treat overlapping curves as holes 2014-02-13 11:48:46 +11:00
Campbell Barton
e2089e1406 NDOF: fix for negative colors and flickering hue when picking with HSVCUBE 2014-02-12 21:05:24 +11:00
Campbell Barton
2f01be2b2f UI: panel tabs, use simple color interpolation that ignores alpha 2014-02-10 17:06:56 +11:00
Jens Verwiebe
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
Campbell Barton
f54e3589a4 some systems didnt define NULL 2014-02-08 08:09:49 +11:00
Campbell Barton
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00