Commit Graph

3758 Commits

Author SHA1 Message Date
Germano Cavalcante ac19483e63 BKE bvhtree: Add tree_type parameter to bvhtree_from_mesh_get.
This will allow greater control of the bvhtrees that are obtained, and helps identify problems.
It is also an additional step to unify the functions.
2018-05-03 14:26:39 -03:00
Aaron Carlisle 128506eeb1 BLI Color: YUV to/from rgb colorspace option
This commit does two things:

- Adds an option to do the calculation in different color spaces (BT601
or BT709).
- Changes the default caluclation from legacy BT601 to BT709.

This affects several areas:

- UI areas (mainly scopes)
- ViewLevelsNode
- Several other nodes that use `COM_ConvertOperation.h`
2018-04-29 18:00:45 -04:00
Germano Cavalcante bb92d9a946 BLI BVHTree Walk DFS: Decreases the size of the stack space used for the recursive function.
Each parameter of the function is copied into the memory stack.
This also brought an improvement in peformance of snapping functions between 5% and 12% in my tests.
2018-04-24 09:48:14 -03:00
Campbell Barton 92f36586e3 BLI_math: avoid assert with non-finite numbers 2018-04-23 21:09:01 +02:00
Campbell Barton 46a9038f60 Cleanup: variable naming 2018-04-21 20:22:12 +02:00
Campbell Barton 1e9fb355bf BLI_bitmap: 2D triangle drawing function
Matching polygon filling but no need for allocation or qsort.
2018-04-21 18:34:34 +02:00
Campbell Barton 83cb387944 BLI math: clamped barycentric weight calculation 2018-04-21 18:34:20 +02:00
Campbell Barton fcac9e8410 Cleanup: style 2018-04-19 08:18:16 +02:00
Campbell Barton 95eb9f22e6 Cleanup: indentation 2018-04-16 17:16:29 +02:00
Sergey Sharybin 5bfe6126f8 Added lock-free single linked list implementation
Only supports lock-free insertion for now, can not delete element
or traverse the list at the same time.
2018-04-16 10:18:43 +02:00
Campbell Barton 3a864f5ee4 BLI_string_utf8: macros that de-duplicate sizeof arg 2018-04-05 18:37:54 +02:00
Campbell Barton f0f6c96a92 BLI_string: macros that de-duplicate sizeof arg 2018-04-05 16:44:48 +02:00
Campbell Barton bfdb88f3f4 Cleanup: rename list count_ex -> count_at_most 2018-04-03 17:05:21 +02:00
Milan Jaros 888a04c7e4 Build: fixes for the Intel compiler versions 2016, 2017, 2018.
Differential Revision: https://developer.blender.org/D3109
2018-04-02 16:39:04 +02:00
Campbell Barton 91d0825b55 BLI_sort_utils: add pointer sorting callback
Also rename Pointer -> Ptr
2018-03-31 19:25:27 +02:00
Campbell Barton e49d66f22c Cleanup: typo in function name 2018-03-28 11:23:38 +02:00
Campbell Barton a970ac5d55 BLI_array: utility to check memory is zerod 2018-03-28 11:13:54 +02:00
Campbell Barton 7cc2b27099 Cleanup: stray tabs
Tabs in middle of code (mostly for no reason / by accident).
2018-03-23 11:51:19 +01:00
Campbell Barton 1782abf6e2 Fix BLI_assert for MSVC
Also use `_BLI_ASSERT` prefix for internal defines.
2018-03-20 11:56:11 +01:00
Joshua Leung 8e5c407fc4 Fix compile error with MSVC2013 - Can't use __func__ (from BLI_assert) in inlined functions
ERROR: blenlib/intern/math_base_inline.c:371 - '__func__' : undeclared identifier (C:\blenderdev\master2\blender\source\blender\editors\lattice\editlattice_tools.c)  [C2065]
2018-03-20 16:03:43 +13:00
Campbell Barton 342a18287f Cleanup: type conversion warning 2018-03-19 09:12:48 +01:00
Campbell Barton 2a9f000806 Cleanup: kdopbvh, only set parent nodes once 2018-03-18 05:08:12 +01:00
Sergey Sharybin 295d8510af Add Truecolor ANSI console constants
They are used to start and end colored output in console.
Use with care, it is up to you to check that console actually
supports Truecolor ANSII.

In thew future we can extend this to other consoles and platforms.
2018-03-16 12:16:29 +01:00
Sergey Sharybin f0596bf660 Hash: Add utility function to convert address to rgb values
Some magic hashing, will become handy to make debug messages
easier to follow.
2018-03-16 12:11:55 +01:00
Campbell Barton 995ccf8168 BLI_assert: extract from BLI_utildefines
BLI_utildefines is quite large, defining many unrelated things.
Add BLI_assert to include in inline headers, so math defines don't
pull in too much.
2018-03-16 06:03:29 +11:00
Campbell Barton 71139cedcb Missed last commit 2018-03-15 11:16:32 +11:00
Campbell Barton e55c29b4ec BLI_math: don't use asserts in inline API
Requires BLI_utildefines.h to be included first,
(already noted in other inline code).

Possible alternative could be to move BLI_assert into own header.
2018-03-15 11:12:10 +11:00
Campbell Barton 342593f124 Cleanup: rename BLI_array_count -> len
Match naming convention used everywhere else.
Count should only be used when this isn't directly accessible.
2018-03-15 01:53:20 +11:00
Campbell Barton bf8f5f5142 Cleanup: doxygen comments 2018-03-14 02:08:07 +11:00
Campbell Barton c52df4fc7c Cleanup: typos
D3081 by @rjg, with others.
2018-02-26 19:58:31 +11:00
Campbell Barton dd77e45151 Cleanup: header guards & style 2018-02-23 12:59:55 +11:00
Campbell Barton 7ff3cd2693 Cleanup: group BLI_ghash_utils.c API in BLU_ghash.h 2018-02-18 22:12:27 +11:00
Campbell Barton 41ad08f3c3 Cleanup: split GHash helpers from implementation 2018-02-18 21:44:56 +11:00
Campbell Barton deacb3d6b8 Cleanup: add 2d suffix to BLI files
Some of these API's can have 3D versions, explicitly name them 2D.
2018-02-18 21:27:33 +11:00
Campbell Barton 2aef87bfae Cleanup: rename BLI_thread.h API
- Use BLI_threadpool_ prefix for (deprecated)
  thread/listbase API.
- Use BLI_thread as prefix for other functions.

See P614 to apply instead of manually resolving conflicts.
2018-02-16 01:13:46 +11:00
Campbell Barton ccdacf1c9b Cleanup: use '_len' instead of '_size' w/ BLI API
- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
  (hint this isn't a simple getter).

See P611 to apply instead of manually resolving conflicts.
2018-02-15 23:39:08 +11:00
Sergey Sharybin 4da6c49613 Cleanup: Style, braces with macros
See https://wiki.blender.org/index.php/Dev:Doc/Code_Style#Braces_with_Macros
2018-02-15 12:41:35 +01:00
Sergey Sharybin c0bbc4abf5 Cleanup: Remove BLI_ prefix from listbase macro
This is kind of doesn't matter where macro itself is defined.

We should stick to the following:

- If some macro is actually more an inline function, follow regular
  function name conventions.
- If macro is a macro, type it in capitals. Use module prefix if that
  helps readability or it if helps avoiding accidents.
2018-02-15 12:38:21 +01:00
Sergey Sharybin bb3efe6127 Blenlib: Assert when attempting to rotate point around vector and store result in the point
This isn't supported since there are subsequent reads to all point coordinates
after modification started.

Probably we need to create a temp copy of point, but that's like extra CPU
ticks.
2018-02-15 11:53:57 +01:00
Campbell Barton 70f1b8cc40 Cleanup: style 2018-02-15 11:13:54 +11:00
Brecht Van Lommel f6107af4cf Cycles: change Index output of Hair and Particle Info to Random, in 0..1 range.
These are used for randomization, so it's convenient if the index is already
hashed and consistent with the Object Info node.
2018-02-14 14:55:46 +01:00
Sergey Sharybin c09e4ae08a Math utils: Add clamping functions 2018-02-14 11:21:27 +01:00
Campbell Barton f088c6b9f6 Mesh: concave quad support
Previously quads always split along first-third vertices.
This is still the default, to avoid flickering with animated deformation
however concave quads that would create two opposing triangles now use
second-fourth split.

Reported as T53999 although this issue has been known limitation
for a long time.
2018-02-08 23:38:17 +11:00
Ray molenkamp 7e928c3bbc Fix: msvc build error with bli_fileops.h
bli_fileops.h was using uint64_t without including the proper header.

issue triggered by rBb0af44fa4d7a2e134b315c49a4fbdf573f781004
2018-02-01 07:59:52 -07:00
Campbell Barton 078e012cd9 Cleanup: rename BLI_*_empty() -> clear()
Consistent with other BLI API's
2018-02-01 13:40:53 +11:00
Dalai Felinto 0f69026b1c Fix windows building (log10)
Error: math_base_inline.c(402): error C2668: 'log10' : ambiguous call to
overloaded function
2018-01-22 11:37:19 -02:00
Campbell Barton e767d21b74 Cleanup: BLI_kdopbvh avoid negative array access
It's harder to reason about array access with negative indices.
2018-01-21 20:17:29 +11:00
Campbell Barton a7dc5e12ac Cleanup: style 2018-01-21 11:41:52 +11:00
Dalai Felinto 431d5772bb Fixup for integer digits commit 2018-01-19 17:04:19 -02:00
Dalai Felinto 075def8fbd Util function to determine number of digits from an integer 2018-01-19 16:54:07 -02:00