Nicholas Bishop
1c8ac33970
Fix incorrect comments in listbase, add unit test to verify change
...
Reviewers: campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D708
2014-08-05 10:33:24 -04:00
Campbell Barton
6b6ea0485f
Macros: replace UNPACK#OP -> UNPACK#_EX, allow suffix
2014-08-05 08:06:19 +10:00
Campbell Barton
a90e49e40a
Tweaks to macros
2014-08-04 11:43:10 +10:00
Campbell Barton
a039f2bfc4
Macros: prevent instantiation of args for type checks
...
also make CHECK_TYPE_INLINE more strict
2014-08-04 11:18:33 +10:00
Campbell Barton
88a0d5ebe8
Make CHECK_TYPE_NONCONST macro portable
...
also replace __typeof -> typeof
2014-08-02 18:08:44 +10:00
Bastien Montagne
3c9e11df37
Cleanup: Move SpaceTransform helpers from BKE_shrinkwrap to BLI_math_matrix.
2014-08-01 16:31:06 +02:00
Gaia Clary
0d1484e4ad
Make function definition consistent with function declaration (as discussed with campbell)
2014-08-01 14:32:04 +02:00
Campbell Barton
7f32cf4605
Prevent macros hiding casts from const pointers
2014-08-01 22:03:03 +10:00
jens verwiebe
a4c287ed7d
OSX/scons: Change Blender bundle datastructures + referennces to match the upcoming codesigning needs
...
- i used deprecated rules up to now which will break in OSX > 10.9.5 and 10.10 > dp4
- todo: adapt cmake due it will break with this commit
2014-08-01 00:57:17 +02:00
Campbell Barton
099038a6f9
BLI_path_utils: rename BLI_clean -> BLI_path_native_slash
2014-07-31 01:40:47 +10:00
Bastien Montagne
74758576fc
Cleanup: general cleanup in BLI_math code (mostly, use 'const' where possible, true/false for booleans, format for float litterals).
2014-07-30 12:19:41 +02:00
Bastien Montagne
eea7521e21
leanup: style, use 'const' where possible, and simplified blend funcs.
...
Much better to use small loops when doing complex operations over color elements
(any serious compiler will flatten them anyway), avoids (some!) stupid mistakes when
editing their code.
Also, use min/max funcs instead of lengthier 'if (foo < 0) foo = 0'.
2014-07-30 12:19:41 +02:00
Campbell Barton
f06be2b4f4
missed last commit
2014-07-30 15:02:42 +10:00
Campbell Barton
b64e36d26d
BLI_listbase: consistent name prefix
2014-07-30 15:01:16 +10:00
Campbell Barton
ce0ff266e9
GHash: generic comparison for int[4]
2014-07-30 07:30:18 +10:00
Campbell Barton
93d0a2c224
Warnings
2014-07-28 20:45:36 +10:00
Sergey Sharybin
5bfbe64a21
Fix T40831: Shrink wrap modifier causes very high CPU usage when targeting meshes with shaped keys
...
Same issue as revious one -- need to start OMP threads only
when there's enough data to crunch.
2014-07-28 16:14:52 +06:00
Antonis Ryakiotakis
25fab54e09
Fix errors in hsv calculation from recent optimization patch.
...
Code was different from original here, result was apparent in color
picker wedge position.
2014-07-21 12:34:45 +02:00
Antonis Ryakiotakis
f745564e4e
GSOC 2013 paint
...
Yep, at last it's here!
There are a few minor issues remaining but development can go on in
master after discussion at blender institute.
For full list of features see:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.72/Painting
Thanks to Sergey and Campbell for the extensive review and to the
countless artists that have given their input and reported issues during
development.
2014-07-21 12:02:05 +02:00
Campbell Barton
8489b94e07
Math Lib: rename mul_serie_m3 to mul_m3_series & reorder args
...
Importantly, reversed mul_serie_m3 argument order (so it matches the m4 function)
2014-07-21 18:57:35 +10:00
Antonis Ryakiotakis
1fdaf5862f
Optimisation to rgb <-> hsv/l conversion
...
Basically avoid redundant computations. Gives ~1-4% speedup in the compositor depending on the use case.
For more info see: http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv
Reviewers: psy-fi, sergey
Subscribers: campbellbarton
Differential Revision: https://developer.blender.org/D596
2014-07-21 09:26:39 +02:00
Campbell Barton
ce47231cdb
Math Lib: Add isect_point_tri_v3
...
Add to Python via mathutils.geometry
2014-07-21 16:58:17 +10:00
Sergey Sharybin
6f1f5771ff
Correction to 7c7b730, multiplication order was flipped
...
That's really annoying that multiplication order is flipped
comparing mat3 and mat4 cases, but for the purposes of not
breaking all the branches which might use this stuff we'd
better keep order consistent with old version for now.
Suggestion here would be to make order consistent but rename
this functions to mult_* to make compilation fail instead
of failing and using wrong order silently.
2014-07-20 20:44:42 +06:00
Campbell Barton
7c7b7302d3
Math Lib: use variable length args for mul_serie_m3,m4 (instead of trailing NULL's)
2014-07-20 14:01:42 +10:00
Campbell Barton
00b29156e0
Defines: replace ELEM3-16 with ELEM(...), that can take varargs
2014-07-20 01:33:40 +10:00
Campbell Barton
7e8626bbce
Code cleanup: warnings
2014-07-20 00:38:52 +10:00
Campbell Barton
8ad607bbe0
Cleanup: Use more logically constructed ELEM macros
...
- name primary comparison var 'v'
- names remain same when expanded
- no odd mixing of macros, use prev ELEM + extra arg
- use 16, even if not used yet, saves adding more in future
2014-07-19 15:00:09 +10:00
Campbell Barton
737cb8cf7c
Use compiler attributes for more BLI libs
2014-07-17 18:58:58 +10:00
Campbell Barton
4cc93123c8
Add thousands separators to scene stats (D646)
...
by januz with own modifications
2014-07-17 14:54:12 +10:00
Campbell Barton
b26daac398
BLI_kdopbvh: assert for bad input
...
also hint UNLIKELY branches
2014-07-16 11:12:19 +10:00
Campbell Barton
c2dba7e344
BLI_kdopbvh: Replace realloc's with BLI_stack
2014-07-15 21:35:50 +10:00
Campbell Barton
5c4180d898
BLI_stack: various small additions
...
- add BLI_stack_count
- add BLI_stack_pop_n to pop into an array
- add BLI_stack_push_r, which returns a pointer that can be filled in
Also remove sanity check in BLI_stack_pop, assert if the stack is empty.
2014-07-15 21:09:03 +10:00
Campbell Barton
fa8ff63b48
Edgehash: Improve magic number for hashing
...
Gives consistently better results. Tested with wide variety of meshes.
2014-07-15 13:08:46 +10:00
Campbell Barton
8554fa2fad
GHash, EdgeHash: add debugging function to measure the hash quality
...
Can use to check on improvements to hash functions.
2014-07-14 23:59:47 +10:00
Campbell Barton
98cb7ad237
Remove redundant NULL check
2014-07-14 14:23:23 +10:00
Campbell Barton
d9f39257f4
Math Lib: add compare_len_squared_v3v3 from paint branch
2014-07-14 11:55:38 +10:00
Campbell Barton
d56e6bf1bf
Math Lib: accept a limit of 0.0 when comparing vectors
2014-07-14 11:33:19 +10:00
Campbell Barton
c04f301fc3
Replace BLI_SMALLSTACK_FREE with fake user (quiet warnings in msvc)
2014-07-12 16:48:52 +10:00
Lukas Tönne
4633e655dc
Fix T41019: Calculate Mass does not calculate actual volume.
...
This was a ToDo item, for mesh-based rigid body shapes (trimesh, convex)
the operator was simply using the bounding box volume, which can grossly
overestimate the volume and mass.
Calculating the actual volume of a mesh is not so difficult after all,
see e.g.
http://research.microsoft.com/en-us/um/people/chazhang/publications/icip01_ChaZhang.pdf
This patch also allows calculating the center-of-mass in the same way.
This is currently unused, because the rigid body system assumes the CoM
to be the same as the geometric object center. This is fine most of the
time, adding such user settings for "center-of-mass offset" would also
add quite a bit of complexity in user space, but it could be necessary
at some point. A number of other physical properties could be calculated
using the same principle, e.g. the moment of inertia.
2014-07-11 12:16:32 +02:00
Campbell Barton
78d38a9033
BLI_array: avoid mixing terms count/length
2014-07-11 15:30:42 +10:00
Campbell Barton
d419e2e90c
WM: add WM_operator_properties_create_ptr
...
Call operator types directly and avoid a lookup when their known.
2014-07-11 15:07:55 +10:00
Campbell Barton
9c48ea3979
Math Lib: add function to get signed angle about an axis
2014-07-09 11:15:08 +10:00
Campbell Barton
f4484daed3
Correct IS_EMPTY macro
...
also prevent reading from BM_ELEM_API_FLAG_ get/setters
2014-07-09 07:53:43 +10:00
Campbell Barton
ea1f1fe0c2
BLI_string, dont pass unicode to ascii BLI_str_partition functions
2014-07-08 06:06:34 +10:00
Bastien Montagne
e3c8cf0a9e
Add (r)partition funcs to BLI_string, to get left-most/right-most first occurence of delimiters.
...
Inspired by Python (r)partition str functions. Also added some Gtest cases for those new funcs.
Reviewed by Campbell Barton, many thanks!
2014-07-04 14:14:06 +02:00
Campbell Barton
5588e45f01
BLI_stack, use memory chunks rather then realloc when resizing
2014-06-30 11:55:01 +10:00
Campbell Barton
f32079d4b9
BLI_stackdefines
...
Bounds check the stack while debugging, also add STACK_PEEK
2014-06-29 05:57:48 +10:00
Campbell Barton
dcc361708c
BLI_stack: use strict flags
...
also use size_t, rename BLI_stack_empty
2014-06-28 23:17:11 +10:00
Campbell Barton
8df6769040
CMake: update source files
2014-06-28 23:17:11 +10:00
Jason Wilkins
9bcb2e7603
warning fix: use of __restrict was inconsistent in BLI_dynstr between declaration and definition
2014-06-27 06:02:59 -05:00